/* ==========================================================================
   Co Pacific Distributors – site chrome
   Utility bar, sticky condensing header, navigation / mobile drawer, footer,
   sticky mobile action bar. Breakpoints match Elementor (tablet ≤1024, mobile ≤767).
   ========================================================================== */

.cp-icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
}

/* ---------- Utility bar ---------- */
.cp-topbar {
	--cp-focus: #fff;
	position: relative;
	z-index: 1001;
	background: var(--cp-navy-deep);
	color: rgba(255, 255, 255, 0.82);
	font-size: 0.84rem;
	line-height: 1.3;
}

.cp-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 40px;
}

.cp-topbar__note {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
	margin: 0;
	color: inherit;
}

.cp-topbar__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #fff;
	font-weight: 700;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.cp-topbar__badge .cp-icon {
	width: 16px;
	height: 16px;
	color: var(--cp-red-light);
}

.cp-topbar__hint {
	padding-left: 14px;
	border-left: 1px solid rgba(255, 255, 255, 0.2);
	color: rgba(255, 255, 255, 0.72);
	white-space: nowrap;
}

.cp-topbar__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cp-topbar__link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 40px;
	color: rgba(255, 255, 255, 0.9);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.cp-topbar__link:hover {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cp-topbar__link .cp-icon {
	width: 15px;
	height: 15px;
	color: var(--cp-red-light);
}

.cp-topbar__short { display: none; }

@media (max-width: 1180px) {
	.cp-topbar__hint { display: none; }
}

@media (max-width: 900px) {
	.cp-topbar__address { display: none; }
}

@media (max-width: 640px) {
	.cp-topbar__note { display: none; }
	.cp-topbar__inner { justify-content: center; }
}

@media (max-width: 480px) {
	.cp-topbar__long {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(1px, 1px, 1px, 1px);
		clip-path: inset(50%);
		white-space: nowrap;
	}
	.cp-topbar__short { display: inline; }
}

/* ---------- Header ---------- */
.cp-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 1000;
	height: var(--cp-header-h);
	margin-bottom: 0;
	border-bottom: 1px solid rgba(6, 26, 58, 0.08);
	background-color: rgba(255, 255, 255, 0.97);
	transition: height 0.25s var(--cp-ease), margin 0.25s var(--cp-ease), box-shadow 0.25s ease, background-color 0.25s ease;
}

@supports (backdrop-filter: blur(1px)) {
	.cp-header {
		background-color: rgba(255, 255, 255, 0.88);
		backdrop-filter: saturate(1.4) blur(14px);
	}
}

/* Condensed: header shrinks, the margin keeps the in-flow height constant → no layout shift. */
.cp-header.is-condensed {
	height: var(--cp-header-h-condensed);
	margin-bottom: calc(var(--cp-header-h) - var(--cp-header-h-condensed));
	box-shadow: 0 12px 32px rgba(6, 26, 58, 0.12);
}

@media screen and (max-width: 600px) {
	.admin-bar .cp-header { top: 0; }
}

.cp-header__inner {
	display: flex;
	align-items: center;
	gap: clamp(12px, 2vw, 24px);
	height: 100%;
}

.cp-logo {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	border-radius: 8px;
	line-height: 0;
}

.cp-header .cp-logo__img {
	display: block;
	width: auto;
	height: 60px;
	max-width: none;
	transition: height 0.25s var(--cp-ease);
}

.cp-header.is-condensed .cp-logo__img { height: 48px; }

/* Desktop navigation (drawer becomes an inline nav) */
.cp-drawer {
	display: flex;
	align-items: center;
	margin-left: auto;
}

.cp-drawer__head,
.cp-drawer__extras {
	display: none;
}

.cp-nav__list {
	display: flex;
	align-items: center;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cp-nav__list li {
	position: relative;
	margin: 0;
}

.cp-nav__list a {
	position: relative;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 10px 15px;
	border-radius: 999px;
	color: var(--cp-navy);
	font-size: 0.97rem;
	font-weight: 700;
	letter-spacing: -0.005em;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.cp-nav__list a:hover {
	background-color: var(--cp-light);
	color: var(--cp-navy);
}

.cp-nav__list > li > a::after {
	content: '';
	position: absolute;
	right: 15px;
	bottom: 6px;
	left: 15px;
	height: 3px;
	border-radius: 3px;
	background: var(--cp-red);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.25s var(--cp-ease);
}

.cp-nav__list > li > a:hover::after { transform: scaleX(0.4); }

.cp-nav__list > :is(.current-menu-item, .current_page_item, .current-menu-ancestor, .current_page_parent, .current_page_ancestor) > a {
	background-color: rgba(227, 27, 35, 0.07);
	color: var(--cp-navy);
	font-weight: 800;
}

.cp-nav__list > :is(.current-menu-item, .current_page_item, .current-menu-ancestor, .current_page_parent, .current_page_ancestor) > a::after {
	transform: scaleX(1);
}

/* Sub-menus (not used by default, supported for completeness) */
.cp-nav__list .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 10;
	min-width: 220px;
	margin: 0;
	padding: 8px;
	border: 1px solid var(--cp-gray);
	border-radius: var(--cp-radius-sm);
	background: #fff;
	box-shadow: var(--cp-shadow);
	list-style: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.cp-nav__list li:is(:hover, :focus-within) > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.cp-nav__list .sub-menu a {
	display: flex;
	border-radius: 10px;
	font-size: 0.93rem;
}

.cp-header__cta {
	flex: 0 0 auto;
	margin-left: 6px;
}

.cp-header .cp-btn.cp-header__cta {
	min-height: 46px;
	padding: 0.7rem 1.35rem;
	font-size: 0.95rem;
	white-space: nowrap;
}

/* Hamburger */
.cp-menu-toggle {
	display: none;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid var(--cp-gray);
	border-radius: 14px;
	background: #fff;
	color: var(--cp-navy);
	cursor: pointer;
}

.cp-menu-toggle:hover,
.cp-menu-toggle:focus {
	border-color: var(--cp-navy);
	background: var(--cp-light);
	color: var(--cp-navy);
}

.cp-menu-toggle__bars {
	display: grid;
	gap: 5px;
	width: 22px;
}

.cp-menu-toggle__bars span {
	display: block;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	transition: transform 0.25s ease, opacity 0.2s ease;
}

.cp-menu-toggle__bars span:nth-child(2) { width: 70%; justify-self: end; }

.cp-menu-toggle[aria-expanded="true"] .cp-menu-toggle__bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cp-menu-toggle[aria-expanded="true"] .cp-menu-toggle__bars span:nth-child(2) { opacity: 0; }
.cp-menu-toggle[aria-expanded="true"] .cp-menu-toggle__bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.cp-drawer-backdrop { display: none; }

/* ---------- Tablet & mobile: off-canvas drawer ---------- */
@media (max-width: 1024px) {
	:root {
		--cp-header-h: 74px;
		--cp-header-h-condensed: 62px;
	}

	.cp-header .cp-logo__img { height: 52px; }
	.cp-header.is-condensed .cp-logo__img { height: 44px; }

	.cp-menu-toggle { display: inline-flex; }
	.cp-header__cta { margin-left: auto; }

	.cp-drawer {
		--cp-focus: var(--cp-red-dark);
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 2; /* inside the header's stacking context, above the backdrop */
		display: none; /* mounted by JS before opening, so the off-canvas panel never widens the page */
		flex-direction: column;
		align-items: stretch;
		width: min(400px, 88vw);
		height: 100vh;
		height: 100dvh;
		margin: 0;
		padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px));
		overflow-y: auto;
		overscroll-behavior: contain;
		background: #fff;
		box-shadow: -24px 0 60px rgba(6, 26, 58, 0.28);
		visibility: hidden;
		transform: translateX(100%);
		transition: transform 0.32s var(--cp-ease), visibility 0s linear 0.32s;
	}

	.admin-bar .cp-drawer {
		top: var(--wp-admin--admin-bar--height, 0px);
		height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
	}

	.cp-drawer.is-mounted { display: flex; }

	.cp-drawer.is-open {
		visibility: visible;
		transform: none;
		transition: transform 0.32s var(--cp-ease), visibility 0s;
	}

	.cp-drawer__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 10px;
		padding-bottom: 14px;
		border-bottom: 1px solid var(--cp-gray);
	}

	.cp-drawer__title {
		color: var(--cp-navy);
		font-size: 0.8rem;
		font-weight: 800;
		letter-spacing: 0.16em;
		text-transform: uppercase;
	}

	.cp-drawer__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 1px solid var(--cp-gray);
		border-radius: 14px;
		background: #fff;
		color: var(--cp-navy);
		cursor: pointer;
	}

	.cp-drawer__close:hover,
	.cp-drawer__close:focus {
		border-color: var(--cp-navy);
		background: var(--cp-light);
		color: var(--cp-navy);
	}

	.cp-drawer__close .cp-icon { width: 22px; height: 22px; }

	.cp-nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 2px;
	}

	.cp-nav__list a {
		display: flex;
		min-height: 52px;
		padding: 12px 16px 12px 20px;
		border-radius: 14px;
		font-size: 1.08rem;
	}

	.cp-nav__list > li > a::after {
		top: 14px;
		right: auto;
		bottom: 14px;
		left: 6px;
		width: 4px;
		height: auto;
		transform: scaleY(0);
		transform-origin: center;
	}

	.cp-nav__list > li > a:hover::after { transform: scaleY(0.5); }

	.cp-nav__list > :is(.current-menu-item, .current_page_item, .current-menu-ancestor, .current_page_parent, .current_page_ancestor) > a::after {
		transform: scaleY(1);
	}

	.cp-nav__list .sub-menu {
		position: static;
		min-width: 0;
		padding: 0 0 0 14px;
		border: 0;
		box-shadow: none;
		opacity: 1;
		visibility: inherit;
		transform: none;
	}

	.cp-drawer__extras {
		display: grid;
		gap: 18px;
		margin-top: auto;
		padding-top: 24px;
	}

	.cp-drawer__cta.cp-btn { width: 100%; }

	.cp-drawer__contact {
		display: grid;
		gap: 4px;
		margin: 0;
		padding: 16px 0 0;
		border-top: 1px solid var(--cp-gray);
		list-style: none;
	}

	.cp-drawer__contact a {
		display: inline-flex;
		align-items: flex-start;
		gap: 10px;
		padding: 8px 0;
		color: var(--cp-text);
		font-size: 0.95rem;
		font-weight: 600;
		text-decoration: none;
		overflow-wrap: anywhere;
	}

	.cp-drawer__contact a:hover { color: var(--cp-red-dark); }
	.cp-drawer__contact .cp-icon { margin-top: 2px; color: var(--cp-red); }

	.cp-drawer-backdrop {
		position: fixed;
		inset: 0;
		z-index: 1;
		display: block;
		background: rgba(4, 18, 41, 0.58);
		opacity: 0;
		transition: opacity 0.3s ease;
	}

	.cp-drawer-backdrop[hidden] { display: none; }
	.cp-drawer-backdrop.is-visible { opacity: 1; }
}

@media (max-width: 767px) {
	.cp-header .cp-btn.cp-header__cta { display: none; }
	.cp-menu-toggle { margin-left: auto; }

	:root {
		--cp-header-h: 68px;
		--cp-header-h-condensed: 60px;
	}

	.cp-header .cp-logo__img { height: 48px; }
	.cp-header.is-condensed .cp-logo__img { height: 42px; }
}

html.cp-scroll-lock,
html.cp-scroll-lock body {
	overflow: hidden;
}

/* While the drawer is open: lift the header above the utility & mobile bars and drop
   backdrop-filter (it would make the header the containing block of the fixed drawer). */
html.cp-drawer-active .cp-header {
	z-index: 1100;
	background-color: #fff;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

/* ---------- Footer ---------- */
.cp-footer {
	--cp-focus: #fff;
	--cp-heading: #fff;
	position: relative;
	padding: clamp(56px, 7vw, 88px) 0 32px;
	background-color: var(--cp-navy-deep);
	background-image:
		radial-gradient(circle at 8% 0%, rgba(18, 62, 115, 0.55), transparent 45%),
		radial-gradient(circle at 96% 100%, rgba(227, 27, 35, 0.12), transparent 35%);
	color: rgba(255, 255, 255, 0.74);
	font-size: 0.95rem;
}

.cp-footer::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: min(240px, 30%);
	height: 4px;
	background: var(--cp-red);
}

/* After a red full-bleed CTA band the red accent would read as a stray tab */
.cp-theme:has(.e-parent.cp-cta-band--red:last-child) .cp-footer::before {
	display: none;
}

.cp-footer__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr) minmax(0, 1.2fr) minmax(0, 1.1fr);
	gap: clamp(28px, 4vw, 48px);
}

.cp-footer p {
	margin: 0 0 14px;
	color: rgba(255, 255, 255, 0.74);
}

.cp-logo--footer {
	margin-bottom: 20px;
	padding: 10px 14px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.cp-logo--footer .cp-logo__img {
	display: block;
	width: auto;
	height: 72px;
	max-width: none;
}

.cp-footer__positioning { max-width: 36ch; }

.cp-footer__title {
	position: relative;
	margin: 0 0 18px;
	padding-bottom: 12px;
	color: #fff;
	font-size: 0.82rem;
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.cp-footer__title::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 28px;
	height: 2px;
	border-radius: 2px;
	background: var(--cp-red);
}

.cp-footer__menu,
.cp-footer__contact {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cp-footer__menu li,
.cp-footer__contact li {
	margin: 0;
}

.cp-footer__menu a,
.cp-footer__contact a {
	display: inline-flex;
	align-items: flex-start;
	gap: 10px;
	min-height: 32px;
	padding: 5px 0;
	color: rgba(255, 255, 255, 0.82);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.cp-footer__menu a:hover,
.cp-footer__contact a:hover {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cp-footer__menu :is(.current-menu-item, .current_page_item, .current-menu-ancestor) > a {
	color: #fff;
	font-weight: 700;
}

.cp-footer__contact .cp-icon {
	width: 16px;
	height: 16px;
	margin-top: 3px;
	color: var(--cp-red-light);
}

.cp-footer__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding-bottom: 4px;
	border-bottom: 2px solid var(--cp-red);
	color: #fff;
	font-weight: 800;
	text-decoration: none;
}

.cp-footer__cta:hover { color: #fff; border-bottom-color: #fff; }
.cp-footer__cta .cp-icon { transition: transform 0.2s ease; }
.cp-footer__cta:hover .cp-icon { transform: translateX(3px); }

.cp-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 10px 32px;
	margin-top: clamp(40px, 5vw, 56px);
	padding-top: 22px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 0.86rem;
}

.cp-footer__bottom p {
	margin: 0;
	color: rgba(255, 255, 255, 0.64);
}

.cp-footer__bottom p:last-child { max-width: 70ch; }

@media (max-width: 1024px) {
	.cp-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
	.cp-footer__grid { grid-template-columns: minmax(0, 1fr); }
	.cp-footer__bottom { flex-direction: column; }
}

/* ---------- Sticky mobile action bar ---------- */
.cp-mobile-bar { display: none; }

@media (max-width: 767px) {
	body.cp-theme {
		padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
	}

	.cp-mobile-bar {
		--cp-focus: #fff;
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 1050;
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		padding-bottom: env(safe-area-inset-bottom, 0px);
		border-top: 1px solid rgba(255, 255, 255, 0.12);
		background: var(--cp-navy);
		box-shadow: 0 -10px 28px rgba(6, 26, 58, 0.22);
	}

	.cp-mobile-bar__item {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-height: 62px;
		color: #fff;
		font-size: 0.8rem;
		font-weight: 800;
		letter-spacing: 0.03em;
		text-decoration: none;
	}

	.cp-mobile-bar__item + .cp-mobile-bar__item { border-left: 1px solid rgba(255, 255, 255, 0.1); }

	.cp-mobile-bar__item:hover,
	.cp-mobile-bar__item:focus { color: #fff; background: var(--cp-blue); }

	.cp-mobile-bar__item:focus-visible { outline-offset: -5px; }

	.cp-mobile-bar__item--primary,
	.cp-mobile-bar__item--primary:hover,
	.cp-mobile-bar__item--primary:focus { background: var(--cp-red-dark); }

	.cp-mobile-bar__item .cp-icon { width: 20px; height: 20px; }
}

/* Elementor editor preview: keep chrome out of the way */
.elementor-editor-active .cp-mobile-bar { display: none; }
.elementor-editor-active .cp-header { position: relative; top: 0; }

/* Header search shortcut (opens the catalog-aware search page). */
.cp-header-search {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin-left: .75rem;
	border: 1px solid var(--cp-gray);
	border-radius: 14px;
	background: #fff;
	color: var(--cp-navy);
	transition: border-color .2s ease, color .2s ease;
}
.cp-header-search .cp-icon { width: 20px; height: 20px; }
.cp-header-search:hover,
.cp-header-search:focus-visible { border-color: var(--cp-red); color: var(--cp-red); }
@media (max-width: 1024px) {
	.cp-header-search { margin-left: auto; }
	.cp-header-search + .cp-header__cta { margin-left: .5rem; }
}
