/* ==========================================================================
   AM Devices - Header + Mobile Drawer (1400px container)

   Default: white sticky header with dark text (inner pages, and once scrolled).
   Pages with [am_hero_banner] (body.am-has-hero): transparent over the banner,
   white text, until scrolled (.is-stuck, set by am-header.js).
   ========================================================================== */

:root {
	--am-header-h: 80px;
}

.am-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: #fff;
	color: var(--am-heading);
	font-family: var(--am-font);
	box-shadow: 0 1px 0 var(--am-border);
	transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.am-header.is-stuck {
	box-shadow: 0 8px 24px rgba(39, 39, 39, 0.12);
}

/* Hero pages: the banner slides up underneath the header (fixed offset, never changes on scroll) */
.am-has-hero .am-header {
	margin-bottom: calc(var(--am-header-h) * -1);
}

.am-header.is-transparent {
	background: transparent;
	color: #fff;
	box-shadow: none;
}

/* WordPress admin bar (logged in): fixed 32px / 46px, scrolls away below 601px */
@media (min-width: 783px) {
	.admin-bar .am-header {
		top: 32px;
	}
}

@media (min-width: 601px) and (max-width: 782px) {
	.admin-bar .am-header {
		top: 46px;
	}
}

/* In-page anchors (#id) land below the sticky bar */
html {
	scroll-padding-top: calc(var(--am-header-h) + 10px);
}

/* ---------- Main bar ---------- */

.am-mainbar__inner {
	display: flex;
	align-items: center;
	gap: 40px;
	min-height: var(--am-header-h);
}

.am-logo {
	flex: 0 0 auto;
	line-height: 0;
}

/* Size comes from max-height only: a % max-width inside this shrink-to-fit box can collapse it to 0 */
.am-logo .custom-logo {
	width: auto;
	max-width: none;
	height: auto;
	max-height: 60px;
}

/* White header: dark logo (Customize > Site Identity), or the main logo turned dark */
.am-logo .am-logo__dark {
	display: none;
}

.am-header:not(.is-transparent) .has-dark .custom-logo:not(.am-logo__dark) {
	display: none;
}

.am-header:not(.is-transparent) .has-dark .am-logo__dark {
	display: block;
}

.am-header:not(.is-transparent) .custom-logo-link:not(.has-dark) .custom-logo {
	filter: brightness(0);
}

/* Site name until a logo is set in Customize > Site Identity */
.am-logo-text {
	color: inherit;
	font: 700 26px/1.1 var(--am-font-heading);
	text-decoration: none;
}

.am-logo-text:hover {
	color: inherit;
}

.am-icon-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background-color 0.2s;
}

.am-icon-btn:hover,
.am-icon-btn:focus-visible {
	background: color-mix(in srgb, currentColor 12%, transparent);
	color: inherit;
}

.am-icon-btn .am-icon {
	width: 24px;
	height: 24px;
}

.am-burger {
	display: none;
	margin-left: -8px;
}

/* ---------- Primary nav ---------- */

.am-nav {
	flex: 1 1 auto;
	display: flex;
	justify-content: center;
	min-width: 0;
}

.am-nav__list {
	display: flex;
	align-items: center;
	gap: 4px 26px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.am-nav__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 8px 0;
	border: 0;
	background: none;
	color: inherit;
	font: 500 16px/1.2 var(--am-font-heading);
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	transition: color 0.2s;
}

.am-nav__link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 2px;
	height: 2px;
	border-radius: 2px;
	background: var(--am-primary);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s ease;
}

.am-nav__link:hover,
.am-nav__link:focus-visible,
.am-nav__link.is-current {
	color: var(--am-primary);
}

.am-nav__link:hover::after,
.am-nav__link:focus-visible::after,
.am-nav__link.is-current::after {
	transform: scaleX(1);
}

/* Over the hero: white links, white underline */
.am-header.is-transparent .am-nav__link:hover,
.am-header.is-transparent .am-nav__link:focus-visible,
.am-header.is-transparent .am-nav__link.is-current {
	color: #fff;
}

.am-header.is-transparent .am-nav__link::after {
	background: #fff;
}

/* ---------- Actions: phone (round icon + number) ---------- */

.am-header__actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 16px;
	margin-left: auto;
}

.am-header__phone {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: inherit;
	font-family: var(--am-font-heading);
	font-size: 16px;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none;
	transition: color 0.2s;
}

.am-header__phone .am-icon {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	padding: 11px;
	border-radius: 50%;
	background: var(--am-primary-soft);
	color: var(--am-primary);
	transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.am-header__phone:hover {
	color: var(--am-primary);
}

.am-header__phone:hover .am-icon {
	background: var(--am-primary);
	color: #fff;
}

/* Over the hero */
.am-header.is-transparent .am-header__phone:hover {
	color: #fff;
}

.am-header.is-transparent .am-header__phone .am-icon {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.am-header.is-transparent .am-header__phone:hover .am-icon {
	background: #fff;
	color: var(--am-primary);
}

.am-cart-count {
	position: absolute;
	top: 2px;
	right: 0;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--am-primary);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

.am-cart-count.is-empty {
	display: none;
}

/* ---------- Mobile drawer ---------- */

.am-drawer {
	position: fixed;
	inset: 0;
	z-index: 1000;
	visibility: hidden;
	transition: visibility 0s linear 0.3s;
}

.am-drawer.is-open {
	visibility: visible;
	transition-delay: 0s;
}

.am-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(39, 39, 39, 0.6);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.am-drawer__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	width: min(360px, 88vw);
	background: #fff;
	color: var(--am-text);
	box-shadow: 8px 0 30px rgba(39, 39, 39, 0.18);
	transform: translateX(-100%);
	transition: transform 0.3s ease;
	outline: 0;
}

.am-drawer.is-open .am-drawer__overlay {
	opacity: 1;
}

.am-drawer.is-open .am-drawer__panel {
	transform: none;
}

.am-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: var(--am-primary);
	color: #fff;
}

.am-drawer__head .custom-logo {
	width: auto;
	max-height: 42px;
}

.am-drawer__body {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 8px 0 16px;
}

.am-drawer__label {
	margin: 16px 20px 6px;
	color: var(--am-muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.am-drawer__list,
.am-drawer__sub {
	margin: 0;
	padding: 0;
	list-style: none;
}

.am-drawer__list > li {
	border-bottom: 1px solid var(--am-border);
}

.am-drawer__list--plain {
	margin-top: 16px;
	border-top: 1px solid var(--am-border);
}

.am-drawer__link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 20px;
	color: var(--am-text);
	font-size: 16px;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	list-style: none;
}

.am-drawer__link::-webkit-details-marker {
	display: none;
}

.am-drawer__link:hover {
	color: var(--am-primary);
}

.am-drawer__link .am-icon {
	width: 20px;
	height: 20px;
	color: var(--am-primary);
}

.am-drawer__group > summary {
	justify-content: space-between;
}

.am-drawer__group > summary .am-icon {
	color: var(--am-muted);
	transition: transform 0.2s ease;
}

.am-drawer__group[open] > summary {
	color: var(--am-primary);
}

.am-drawer__group[open] > summary .am-icon {
	transform: rotate(90deg);
}

.am-drawer__sub {
	padding: 0 0 10px;
	background: var(--am-bg-soft);
}

.am-drawer__sub a {
	display: block;
	padding: 10px 20px 10px 36px;
	color: var(--am-text-soft);
	font-size: 15px;
	text-decoration: none;
}

.am-drawer__sub a:hover {
	color: var(--am-primary);
}

.am-drawer__foot {
	display: grid;
	gap: 10px;
	padding: 16px 20px;
	border-top: 1px solid var(--am-border);
	background: var(--am-bg-soft);
}

.am-drawer__foot a {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--am-text);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
}

.am-drawer__foot .am-icon {
	width: 18px;
	height: 18px;
	color: var(--am-primary);
}

/* ---------- Responsive ---------- */

@media (max-width: 1360px) {
	.am-mainbar__inner {
		gap: 32px;
	}

	.am-nav__list {
		column-gap: 22px;
	}

	.am-nav__link {
		font-size: 15px;
	}
}

@media (max-width: 1200px) {
	.am-nav__list {
		column-gap: 18px;
	}

	.am-nav__link {
		font-size: 14px;
	}
}

/* Phone: icon only (still a tel: link) */
@media (max-width: 1100px) {
	.am-header__phone span {
		display: none;
	}
}

@media (max-width: 1024px) {
	:root {
		--am-header-h: 66px;
	}

	.am-burger {
		display: inline-flex;
	}

	.am-nav {
		display: none;
	}

	.am-mainbar__inner {
		gap: 12px;
	}

	.am-logo .custom-logo {
		max-height: 44px;
	}

	.am-logo-text {
		font-size: 22px;
	}

	.am-header__actions {
		gap: 8px;
	}

	.am-header__phone .am-icon {
		width: 36px;
		height: 36px;
		padding: 9px;
	}
}

@media (max-width: 575px) {
	.am-logo {
		flex: 1 1 auto;
		min-width: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.am-header,
	.am-drawer,
	.am-drawer__panel,
	.am-drawer__overlay,
	.am-nav__link::after {
		transition: none;
	}
}

/* Headings / labels use Poppins */
.am-drawer__link,
.am-drawer__label {
	font-family: var(--am-font-heading);
}

/* ---------- Mini cart dropdown ---------- */

.am-minicart {
	position: relative;
}

.am-minicart__panel {
	position: absolute;
	top: calc(100% + 19px);
	right: 0;
	z-index: 120;
	display: flex;
	flex-direction: column;
	width: 380px;
	max-height: calc(100vh - 140px);
	border-radius: var(--am-radius);
	background: #fff;
	color: var(--am-text);
	box-shadow: 0 18px 40px rgba(39, 39, 39, 0.18);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.am-minicart__panel::before {
	content: "";
	position: absolute;
	top: -7px;
	right: 14px;
	border: 7px solid transparent;
	border-top: 0;
	border-bottom-color: #fff;
}

.am-minicart.is-open .am-minicart__panel {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

.am-minicart__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid var(--am-border);
}

.am-minicart__title {
	margin: 0;
	color: var(--am-heading);
	font-family: var(--am-font-heading);
	font-size: 17px;
	font-weight: 600;
}

.am-minicart__close {
	display: inline-flex;
	padding: 4px;
	border: 0;
	background: none;
	color: var(--am-muted);
	cursor: pointer;
}

.am-minicart__close:hover {
	color: var(--am-primary);
}

.am-minicart__close .am-icon {
	width: 20px;
	height: 20px;
}

.am-minicart .widget_shopping_cart_content {
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.am-minicart .woocommerce-mini-cart {
	flex: 1 1 auto;
	min-height: 0;
	margin: 0;
	padding: 4px 18px;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
}

.am-minicart .woocommerce-mini-cart-item {
	position: relative;
	display: block;
	min-height: 88px;
	padding: 14px 30px 14px 76px;
	border-bottom: 1px solid var(--am-border);
	font-size: 14px;
	line-height: 1.4;
}

.am-minicart .woocommerce-mini-cart-item:last-child {
	border-bottom: 0;
}

.am-minicart .woocommerce-mini-cart-item > a:not(.remove) {
	display: block;
	color: var(--am-heading);
	font-family: var(--am-font-heading);
	font-weight: 500;
}

.am-minicart .woocommerce-mini-cart-item > a:not(.remove):hover {
	color: var(--am-primary);
}

.am-minicart .woocommerce-mini-cart-item img {
	position: absolute;
	top: 14px;
	left: 0;
	width: 60px;
	height: 60px;
	padding: 4px;
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-sm);
	object-fit: contain;
}

.am-minicart .woocommerce-mini-cart-item .remove {
	position: absolute;
	top: 14px;
	right: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border: 1px solid var(--am-border);
	border-radius: 50%;
	color: var(--am-muted);
	font-size: 16px;
	line-height: 1;
}

.am-minicart .woocommerce-mini-cart-item .remove:hover {
	border-color: var(--am-primary);
	background: var(--am-primary);
	color: #fff;
}

.am-minicart .woocommerce-mini-cart-item .quantity {
	display: block;
	margin-top: 6px;
	color: var(--am-muted);
}

.am-minicart .woocommerce-mini-cart-item .quantity .amount {
	color: var(--am-primary);
	font-weight: 700;
}

.am-minicart .woocommerce-mini-cart-item dl.variation {
	margin: 4px 0 0;
	color: var(--am-muted);
	font-size: 12px;
}

.am-minicart .woocommerce-mini-cart-item dl.variation dt,
.am-minicart .woocommerce-mini-cart-item dl.variation dd,
.am-minicart .woocommerce-mini-cart-item dl.variation p {
	display: inline;
	margin: 0;
}

.am-minicart .woocommerce-mini-cart__total {
	display: flex;
	justify-content: space-between;
	margin: 0;
	padding: 14px 18px;
	border-top: 1px solid var(--am-border);
	background: var(--am-bg-soft);
	font-size: 16px;
}

.am-minicart .woocommerce-mini-cart__total strong {
	color: var(--am-heading);
	font-family: var(--am-font-heading);
	font-weight: 600;
}

.am-minicart .woocommerce-mini-cart__total .amount {
	color: var(--am-primary);
	font-weight: 700;
}

.am-minicart .woocommerce-mini-cart__buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin: 0;
	padding: 14px 18px 18px;
}

.am-minicart .woocommerce-mini-cart__buttons .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--am-primary);
	border-radius: var(--am-radius-sm);
	background: transparent;
	color: var(--am-primary);
	font-family: var(--am-font-heading);
	font-size: 15px;
	font-weight: 500;
	transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.am-minicart .woocommerce-mini-cart__buttons .button.checkout {
	background: var(--am-primary);
	color: #fff;
}

.am-minicart .woocommerce-mini-cart__buttons .button:hover {
	border-color: var(--am-dark);
	background: var(--am-dark);
	color: #fff;
}

.am-minicart .woocommerce-mini-cart__empty-message {
	margin: 0;
	padding: 36px 18px;
	color: var(--am-muted);
	text-align: center;
}

/* WooCommerce AJAX loading overlay */
.am-minicart .blockUI.blockOverlay {
	background: rgba(255, 255, 255, 0.7) !important;
}

@media (max-width: 575px) {
	.am-minicart {
		position: static;
	}

	.am-minicart__panel {
		top: calc(100% + 8px);
		left: 12px;
		right: 12px;
		width: auto;
	}

	.am-minicart__panel::before {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.am-minicart__panel {
		transition: none;
	}
}
