/* ===========================
   AromaEterica v2
   Modern minimal critical CSS
   WCAG AA · prefers-reduced-motion · dark mode ready
   =========================== */

/* ---- GLOBAL ---- */
:root {
  --wp--preset--spacing--2-xl: 4rem;
  --wp--preset--spacing--3-xl: 6rem;
  --wp--preset--spacing--4-xl: 8rem;
  /* Duplicate font-size vars with non-hyphenated names — WP < 7.0
     outputs var(--wp--preset--font-size--5xl) instead of --5-xl,
     so these aliases ensure the browser always resolves correctly. */
  --wp--preset--font-size--2xl: 1.5rem;
  --wp--preset--font-size--3xl: clamp(1.5rem, 3vw, 2rem);
  --wp--preset--font-size--4xl: clamp(2rem, 5vw, 3rem);
  --wp--preset--font-size--5xl: clamp(3rem, 7vw, 5rem);
}

body, html { height: 100%; }
body { overflow-x: clip; }

.wp-site-blocks {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wp-site-blocks main,
.wp-site-blocks > .wp-block-group:not(.site-header):not(.site-footer) {
  flex: 1 0 auto;
}

footer { margin-block-start: auto; }

:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
}

p, li, td, th { line-height: 1.7; }

/* ---- SKIP LINK ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 10000;
  padding: .75rem 1.5rem;
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
  font-size: .875rem;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ---- HEADER ---- */
.site-header {
  z-index: 100;
  border-bottom: 1px solid var(--wp--preset--color--border);
}

/* ---- SHOP NOTICE ---- */
.ae-shop-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: .5rem var(--wp--preset--spacing--lg);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  min-height: 38px;
  box-sizing: border-box;
  transition: max-height .25s ease, opacity .25s ease, padding .25s ease, margin .25s ease;
}
.ae-shop-notice.is-dismissed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  overflow: hidden;
  min-height: 0;
}

/* ---- SHOP NOTICE COLOR PRESETS ---- */
/* Amber (default) — warm golden, same in both modes */
.ae-shop-notice--amber {
  background: #C49A6C;
  color: #1A1A1A;
}
[data-theme="dark"] .ae-shop-notice--amber {
  background: #C49A6C;
  color: #1A1A1A;
}

/* Green — forest green, lighter in dark mode */
.ae-shop-notice--green {
  background: #2B4D3B;
  color: #F8F4F0;
}
[data-theme="dark"] .ae-shop-notice--green {
  background: #3A6B4A;
  color: #F8F4F0;
}

/* Blue — cool info tone */
.ae-shop-notice--blue {
  background: #3B6B8A;
  color: #FFFFFF;
}
[data-theme="dark"] .ae-shop-notice--blue {
  background: #4A7A9A;
  color: #FFFFFF;
}

/* Red — urgent/warning */
.ae-shop-notice--red {
  background: #B8403A;
  color: #FFFFFF;
}
[data-theme="dark"] .ae-shop-notice--red {
  background: #C94A44;
  color: #FFFFFF;
}

/* Neutral — subtle gray */
.ae-shop-notice--neutral {
  background: #6B6B6B;
  color: #FFFFFF;
}
[data-theme="dark"] .ae-shop-notice--neutral {
  background: #5A5A5A;
  color: #F8F4F0;
}
.ae-shop-notice__text {
  flex: 1;
  max-width: 800px;
}
.ae-shop-notice__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,.1);
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s;
}
.ae-shop-notice__close:hover,
.ae-shop-notice__close:focus-visible {
  background: rgba(0,0,0,.2);
}

/* ---- HEADER LAYOUT ---- */
.ae-header-brand {
  flex-shrink: 0;
}

.ae-header-icons {
  flex-shrink: 0;
}

/* Site logo: compact in header */
.ae-site-logo img {
  max-height: 36px;
  width: auto;
}

/* Text logo: inline with icon logo */
.ae-text-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.ae-text-logo img {
  height: 100px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  display: block;
}

[data-theme="dark"] .ae-text-logo img {
  filter: brightness(0) invert(1);
  opacity: .9;
}

/* Account nav: compact with dot separator */
.ae-account-nav {
  gap: 0;
}
.ae-account-nav .wp-block-navigation-item {
  font-size: 0.6875rem;
  padding-inline: 0;
}
/* Dot separator between account links */
.ae-account-nav > * + *::before {
  content: "·";
  margin-inline: 0.25rem;
  color: var(--wp--preset--color--border);
  font-weight: 400;
}

/* ---- SEARCH ---- */
.header-search {
  width: 220px;
}

.header-search .wp-block-search__inside-wrapper {
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 0;
  background: var(--wp--preset--color--surface);
  padding: 0;
  transition: border-color .2s;
}

.header-search .wp-block-search__inside-wrapper:focus-within {
  border-color: var(--wp--preset--color--primary);
}

.header-search .wp-block-search__input {
  border: none;
  background: transparent;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  font-family: var(--wp--preset--font-family--body);
  color: var(--wp--preset--color--contrast);
  outline: none;
  border-radius: 0;
}

.header-search .wp-block-search__input::placeholder {
  color: var(--wp--preset--color--secondary);
  opacity: 0.7;
}

.header-search .wp-block-search__button {
  border: none;
  background: transparent;
  padding: 0.45rem 0.65rem;
  color: var(--wp--preset--color--secondary);
  cursor: pointer;
  transition: color .2s;
  margin: 0;
}

.header-search .wp-block-search__button:hover {
  color: var(--wp--preset--color--primary);
}

.header-search .wp-block-search__button svg {
  width: 16px;
  height: 16px;
}

/* ---- NAVIGATION ---- */
.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
  border: 1px solid var(--wp--preset--color--border);
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  padding: .5rem 0;
  min-width: 220px;
}

/* Primary navigation: in header row alongside logo */
.primary-navigation {
  flex-wrap: nowrap;
}

.wp-block-navigation__submenu-container {
  position: absolute;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}

.wp-block-navigation-item {
  position: relative;
}

.wp-block-navigation-item:hover > .wp-block-navigation__submenu-container,
.wp-block-navigation-item:focus-within > .wp-block-navigation__submenu-container {
  opacity: 1;
  visibility: visible;
}

.wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
  top: 0;
  left: 100%;
  margin-top: calc(var(--wp--preset--spacing--2-xs) * -1);
}

/* ---- BLOCK STYLES ---- */
.wp-block-separator.is-style-short { width: 80px !important; margin-inline: auto; }
.wp-block-navigation.is-style-underline .wp-block-navigation-item.current-menu-item,
.wp-block-navigation.is-style-underline .wp-block-navigation-item:hover {
  border-bottom: 2px solid var(--wp--preset--color--accent);
}

/* ---- BUTTONS ---- */
.is-style-outline .wp-block-button__link {
  background: transparent !important;
  border: 1px solid currentColor;
}

.is-style-outline .wp-block-button__link:hover,
.is-style-outline .wp-block-button__link:focus-visible {
  background: var(--wp--preset--color--contrast) !important;
  color: var(--wp--preset--color--surface) !important;
  border-color: var(--wp--preset--color--contrast) !important;
}

.is-style-text .wp-block-button__link {
  background: transparent !important;
  padding-inline: 0 !important;
  text-decoration: underline;
}

/* ---- THEME TOGGLE ---- */
.theme-toggle-btn .wp-block-button__link {
  background: transparent !important;
  min-width: 36px;
  padding: .25rem .5rem !important;
  font-size: .75rem !important;
  cursor: pointer;
}
[data-theme="dark"] .theme-toggle-btn .wp-block-button__link { color: var(--wp--preset--color--accent); }

/* ---- DARK MODE ---- */
[data-theme="dark"] {
  --wp--preset--color--base: #141412;
  --wp--preset--color--contrast: #F8F4F0;
  --wp--preset--color--primary: #5A7D5C;
  --wp--preset--color--secondary: #7D9E7E;
  --wp--preset--color--accent: #D4A574;
  --wp--preset--color--surface: #1E1E1A;
  --wp--preset--color--subtle: #262622;
  --wp--preset--color--border: #3A3A34;
  --wp--preset--color--sale: #B8403A;
  --wp--preset--color--success: #5A8E66;
}

/* ---- BACK TO TOP ---- */
.back-to-top {
  position: fixed;
  inset-block-end: 1.5rem;
  inset-inline-end: 1.5rem;
  z-index: 80;
  inline-size: 44px;
  block-size: 44px;
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s, visibility .25s, transform .25s;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--surface);
  border-color: var(--wp--preset--color--primary);
}

/* ---- MINI CART ---- */

/* Badge */
.wc-block-mini-cart__badge {
  transition: transform .2s;
  background: var(--wp--preset--color--primary) !important;
  color: var(--wp--preset--color--surface) !important;
  font-family: var(--wp--preset--font-family--body);
  font-size: .6875rem;
  font-weight: 600;
}

/* Button icon hover */
.wc-block-mini-cart__button:hover .wc-block-mini-cart__icon {
  color: var(--wp--preset--color--primary);
}

/* Drawer overlay */
.wc-block-components-drawer__screen-overlay {
  background-color: rgba(26, 26, 26, .2);
  backdrop-filter: blur(3px);
}

/* Drawer panel */
.wc-block-mini-cart__drawer .wc-block-components-drawer {
  background: var(--wp--preset--color--surface);
  border-left: 1px solid var(--wp--preset--color--border);
}

/* Mini cart contents */
.wp-block-woocommerce-mini-cart-contents {
  background: var(--wp--preset--color--surface);
}

/* Title */
.wc-block-mini-cart__drawer h2.wc-block-mini-cart__title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: var(--wp--preset--font-size--xl);
  font-weight: 400;
  letter-spacing: -.01em;
  margin: 16px 16px -24px;
  mask-image: none;
}
.wc-block-mini-cart__drawer h2.wc-block-mini-cart__title span:first-child {
  color: var(--wp--preset--color--contrast);
}

/* Close button */
.wc-block-mini-cart__drawer .wc-block-components-drawer__close {
  color: var(--wp--preset--color--contrast);
  opacity: .45;
}
.wc-block-mini-cart__drawer .wc-block-components-drawer__close:hover,
.wc-block-mini-cart__drawer .wc-block-components-drawer__close:focus-visible {
  opacity: 1;
  background: transparent !important;
}

/* Items container */
.wc-block-mini-cart__items {
  padding: 16px;
}

/* Product table rows */
.wc-block-mini-cart__products-table .wc-block-cart-items__row {
  padding: 12px 0;
  border-bottom: 1px solid var(--wp--preset--color--border);
}
.wc-block-mini-cart__products-table .wc-block-cart-items__row:last-child {
  border-bottom: 0;
}

/* Product image */
.wc-block-mini-cart__products-table .wc-block-cart-item__image img {
  border-radius: 4px;
  border: 1px solid var(--wp--preset--color--border);
}

/* Product wrap container */
.wc-block-mini-cart__products-table .wc-block-cart-item__wrap {
  gap: 2px;
}

/* Product name */
.wc-block-mini-cart__products-table .wc-block-components-product-name {
  font-family: var(--wp--preset--font-family--heading);
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 400;
  line-height: 1.3;
}
.wc-block-mini-cart__products-table .wc-block-components-product-name a {
  color: var(--wp--preset--color--contrast);
  text-decoration: none;
}
.wc-block-mini-cart__products-table .wc-block-components-product-name a:hover {
  color: var(--wp--preset--color--primary);
  text-decoration: underline;
}

/* Price */
.wc-block-mini-cart__products-table .wc-block-cart-item__prices {
  font-family: var(--wp--preset--font-family--body);
  font-weight: 500;
  font-size: var(--wp--preset--font-size--sm);
}
.wc-block-mini-cart__products-table .wc-block-components-product-price {
  font-weight: 600;
}

/* Quantity selector */
.wc-block-mini-cart .wc-block-components-quantity-selector {
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 0;
}
.wc-block-mini-cart .wc-block-components-quantity-selector__button {
  color: var(--wp--preset--color--contrast);
  font-size: .75rem;
}
.wc-block-mini-cart .wc-block-components-quantity-selector__button:hover {
  color: var(--wp--preset--color--primary);
}
.wc-block-mini-cart .wc-block-components-quantity-selector__input {
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--xs);
  font-weight: 500;
}

/* Remove link */
.wc-block-mini-cart .wc-block-cart-item__remove-link {
  color: var(--wp--preset--color--secondary);
  opacity: .5;
  transition: opacity .15s, color .15s;
}
.wc-block-mini-cart .wc-block-cart-item__remove-link:hover {
  color: var(--wp--preset--color--sale);
  opacity: 1;
}

/* Footer */
.wc-block-mini-cart__footer {
  border-top: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--surface);
  padding: 20px 16px 24px;
}

/* Footer subtotal */
.wc-block-mini-cart__footer .wc-block-mini-cart__footer-subtotal {
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--sm);
  margin-bottom: 16px;
}
.wc-block-mini-cart__footer .wc-block-mini-cart__footer-subtotal .wc-block-components-totals-item__label {
  font-weight: 500;
  color: var(--wp--preset--color--secondary);
  text-transform: uppercase;
  font-size: var(--wp--preset--font-size--xs);
  letter-spacing: .04em;
}
.wc-block-mini-cart__footer .wc-block-mini-cart__footer-subtotal .wc-block-components-totals-item__value {
  font-weight: 600;
  color: var(--wp--preset--color--contrast);
}

/* Footer buttons container */
.wc-block-mini-cart__footer-actions {
  gap: 12px;
}
.wc-block-mini-cart__footer-actions .wc-block-components-button {
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 500;
  border-radius: 0;
  padding: .65rem 1.25rem;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
  text-decoration: none;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  min-height: auto;
  box-shadow: none !important;
}
.wc-block-mini-cart__footer-actions .wc-block-components-button:focus-visible {
  box-shadow: 0 0 0 2px var(--wp--preset--color--primary) !important;
  outline: 3px solid transparent;
}

/* Checkout button (primary — filled) */
.wc-block-mini-cart__footer-checkout.wc-block-components-button {
  background: var(--wp--preset--color--primary) !important;
  color: var(--wp--preset--color--surface) !important;
  border: 1px solid var(--wp--preset--color--primary) !important;
}
.wc-block-mini-cart__footer-checkout.wc-block-components-button:hover {
  background: var(--wp--preset--color--contrast) !important;
  border-color: var(--wp--preset--color--contrast) !important;
  color: var(--wp--preset--color--surface) !important;
}

/* Cart button (outline — transparent bg) */
.wc-block-mini-cart__footer-cart.wc-block-components-button {
  background: transparent !important;
  color: var(--wp--preset--color--contrast) !important;
  border: 1px solid var(--wp--preset--color--border) !important;
}
.wc-block-mini-cart__footer-cart.wc-block-components-button:hover {
  background: var(--wp--preset--color--subtle) !important;
  border-color: var(--wp--preset--color--contrast) !important;
  color: var(--wp--preset--color--contrast) !important;
}

/* Empty cart */
.wp-block-woocommerce-empty-mini-cart-contents-block {
  font-family: var(--wp--preset--font-family--body);
}
.wc-block-mini-cart__empty-cart-wrapper {
  padding: 48px 24px 24px;
}

/* Shopping button (empty cart) */
.wc-block-mini-cart__shopping-button a {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--surface);
  border: 0;
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-radius: 0;
  padding: .6rem 1.25rem;
  text-decoration: none;
}
.wc-block-mini-cart__shopping-button a:hover {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--surface);
}

/* Free shipping bar inside drawer */
.wc-block-mini-cart__drawer .ae-free-shipping-bar {
  margin: 0 16px;
}

/* Notices inside drawer */
.wc-block-mini-cart__drawer .wc-block-components-notices {
  margin: 0 16px;
}

/* ---- CHECKOUT ---- */
.wc-block-checkout {
  gap: var(--wp--preset--spacing--xl);
  align-items: start;
}

.wc-block-checkout > .wc-block-checkout__actions.wp-block-woocommerce-checkout-actions-block {
  display: none;
}

.wc-block-checkout .wc-block-components-form .wc-block-components-checkout-place-order-button {
  appearance: none;
  border: 1px solid var(--wp--preset--color--primary) !important;
  border-radius: 0 !important;
  background: var(--wp--preset--color--primary) !important;
  color: var(--wp--preset--color--surface) !important;
  box-shadow: none !important;
  min-height: 3.25rem;
  padding: .9rem 1.25rem !important;
  font-family: var(--wp--preset--font-family--body) !important;
  font-size: var(--wp--preset--font-size--sm) !important;
  font-weight: 600 !important;
  letter-spacing: .05em;
  line-height: 1.2;
  text-transform: uppercase;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}

.wc-block-checkout .wc-block-components-form .wc-block-components-checkout-place-order-button:hover,
.wc-block-checkout .wc-block-components-form .wc-block-components-checkout-place-order-button:focus-visible {
  background: var(--wp--preset--color--contrast) !important;
  border-color: var(--wp--preset--color--contrast) !important;
  color: var(--wp--preset--color--surface) !important;
}

.wc-block-checkout .wc-block-components-form .wc-block-components-checkout-place-order-button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.wc-block-checkout .wp-block-woocommerce-checkout-order-summary-block {
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--surface);
}

.wc-block-checkout .wc-block-components-checkout-order-summary__title {
  margin: 0;
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--subtle);
}

.wc-block-checkout .wc-block-components-checkout-order-summary__title-text {
  margin: 0;
  font-family: var(--wp--preset--font-family--heading);
  font-size: 1rem;
}

.wc-block-checkout .wc-block-components-checkout-order-summary__content > .wc-block-components-totals-wrapper {
  padding-inline: 0;
}

.wc-block-checkout .wc-block-components-checkout-order-summary__content > .wp-block-woocommerce-checkout-order-summary-coupon-form-block {
  padding: .875rem 1rem;
}

.wc-block-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-totals-item {
  padding: .75rem 1rem;
}

.wc-block-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-panel__button,
.wc-block-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-panel__button:active,
.wc-block-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-panel__button:focus,
.wc-block-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-panel__button:hover {
  padding-left: 0 !important;
  padding-right: 2rem !important;
}

.wc-block-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-totals-item__description,
.wc-block-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-totals-item__description p {
  margin: 0;
  padding: 0 1rem .875rem;
}

.wc-block-checkout .wc-block-components-totals-footer-item {
  background: var(--wp--preset--color--subtle);
}

@media (min-width: 960px) {
  .wc-block-checkout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(18rem, .95fr);
    gap: var(--wp--preset--spacing--xl);
  }

  .wc-block-checkout > .wc-block-checkout__main {
    grid-column: 1;
    min-width: 0;
  }

  .wc-block-checkout > .wp-block-woocommerce-checkout-order-summary-block {
    grid-column: 2;
    align-self: start;
    min-width: 0;
  }
}

/* ---- CHECKOUT STEP CARDS ---- */
.wc-block-checkout .wc-block-components-checkout-step {
  margin-bottom: var(--wp--preset--spacing--md);
  padding: 1.5rem;
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 0;
}

.wc-block-checkout .wc-block-components-checkout-step__heading {
  margin: 0 0 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--wp--preset--color--subtle);
}

.wc-block-checkout .wc-block-components-checkout-step__heading h2 {
  margin: 0;
  font-family: var(--wp--preset--font-family--heading);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--wp--preset--color--contrast);
}

/* ---- CHECKOUT FORM INPUTS ---- */
.wc-block-checkout .wc-block-components-text-input input,
.wc-block-checkout .wc-block-components-text-input textarea,
.wc-block-checkout .wc-block-components-combobox .wc-block-components-combobox-control input,
.wc-block-checkout .wc-blocks-components-select__select {
  border: 1px solid var(--wp--preset--color--border) !important;
  border-radius: 0 !important;
  background: var(--wp--preset--color--base) !important;
  color: var(--wp--preset--color--contrast) !important;
  font-family: var(--wp--preset--font-family--body) !important;
  font-size: 0.9375rem !important;
  padding: .75rem .875rem !important;
  line-height: 1.5;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: none !important;
}

.wc-block-checkout .wc-block-components-text-input input:focus,
.wc-block-checkout .wc-block-components-text-input textarea:focus,
.wc-block-checkout .wc-block-components-combobox .wc-block-components-combobox-control input:focus,
.wc-block-checkout .wc-blocks-components-select__select:focus {
  border-color: var(--wp--preset--color--primary) !important;
  box-shadow: 0 0 0 1px var(--wp--preset--color--primary) !important;
  outline: none;
}

/* Input labels */
.wc-block-checkout .wc-block-components-text-input label,
.wc-block-checkout .wc-block-components-combobox .wc-block-components-combobox-control label {
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--wp--preset--color--secondary);
  text-transform: none;
  margin-bottom: .25rem;
}

/* ---- CHECKOUT RADIO & CHECKBOX ---- */
.wc-block-checkout .wc-block-components-radio-control .wc-block-components-radio-control__option {
  padding: .75rem 1rem .75rem 2.75rem;
}

.wc-block-checkout .wc-block-components-checkbox-control {
  padding: .625rem 0;
}

.wc-block-checkout .wc-block-components-radio-control__input,
.wc-block-checkout .wc-block-components-checkbox-control__input {
  accent-color: var(--wp--preset--color--primary);
}

.wc-block-checkout .wc-block-components-radio-control__label,
.wc-block-checkout .wc-block-components-checkbox-control__label {
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.9375rem;
  color: var(--wp--preset--color--contrast);
}

/* Secondary label (price in shipping options) */
.wc-block-checkout .wc-block-components-radio-control__secondary-label {
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--wp--preset--color--contrast);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Radio option layout */
.wc-block-checkout .wc-block-components-radio-control__option-layout {
  width: 100%;
}

/* Let label-group grow to fill available space */
.wc-block-checkout .wc-block-components-radio-control__label-group {
  width: 100%;
}

/* Ship-to-different-address checkbox */
.wc-block-checkout .wc-block-checkout__use-address-for-billing {
  margin-top: .5rem;
  padding-top: .75rem;
  border-top: 1px solid var(--wp--preset--color--subtle);
}

/* ---- CHECKOUT BACK LINK ---- */
.ae-checkout-back {
  margin-bottom: var(--wp--preset--spacing--md);
}

.ae-checkout-back a {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.875rem;
  color: var(--wp--preset--color--secondary);
  text-decoration: none;
  transition: color .2s;
}

.ae-checkout-back a:hover,
.ae-checkout-back a:focus-visible {
  color: var(--wp--preset--color--primary);
}

.ae-checkout-back a::before {
  content: "←";
  font-size: 1rem;
  line-height: 1;
}

/* ---- CHECKOUT TRUST STRIP ---- */
.ae-checkout-trust {
  margin-top: var(--wp--preset--spacing--lg);
  padding: 1rem 1.5rem;
  background: var(--wp--preset--color--subtle);
  border: 1px solid var(--wp--preset--color--border);
}

.ae-checkout-trust p {
  margin: 0;
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.8125rem;
  color: var(--wp--preset--color--secondary);
  line-height: 1.6;
}

@media (max-width: 959px) {
  .wc-block-checkout .wc-block-components-checkout-step {
    padding: 1rem;
  }

  .wc-block-checkout .wc-block-components-checkout-step__heading {
    margin-bottom: .75rem;
  }
}

/* ---- TOAST NOTIFICATIONS ---- */
.ae-toast-container {
  position: fixed;
  inset-block-end: 5rem;
  inset-inline: 1rem;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
  pointer-events: none;
}

.ae-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--contrast);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 6px;
  padding: .75rem 1rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.12);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.4;
  max-width: 360px;
  transform: translateX(calc(100% + 1rem));
  opacity: 0;
  transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .3s;
}

.ae-toast.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.ae-toast.is-leaving {
  transform: translateX(calc(100% + 1rem));
  opacity: 0;
}

.ae-toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.ae-toast__icon svg {
  width: 100%;
  height: 100%;
}

.ae-toast__body {
  flex: 1;
  min-width: 0;
}

.ae-toast__title {
  font-weight: 600;
  margin: 0;
}

.ae-toast__link {
  display: inline-block;
  margin-block-start: .25rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--wp--preset--color--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ae-toast__link:hover {
  color: var(--wp--preset--color--secondary);
}

.ae-toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--wp--preset--color--secondary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color .2s;
}

.ae-toast__close:hover {
  color: var(--wp--preset--color--contrast);
}

@media (max-width: 600px) {
  .ae-toast-container {
    inset-inline: .5rem;
    inset-block-end: 4.5rem;
  }
  .ae-toast {
    max-width: 100%;
    font-size: .75rem;
    padding: .625rem .875rem;
  }
}

/* ---- CART ACTION BUTTONS ---- */
.ae-cart-actions {
  display: flex;
  flex-direction: column;
  gap: var(--wp--preset--spacing--sm);
  padding: var(--wp--preset--spacing--md);
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--border);
}

.ae-cart-actions__checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .9rem 1.25rem;
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--surface);
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--wp--preset--color--primary);
  transition: background .2s, border-color .2s;
}

.ae-cart-actions__checkout:hover,
.ae-cart-actions__checkout:focus-visible {
  background: var(--wp--preset--color--contrast);
  border-color: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--surface);
}

.ae-cart-actions__continue {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.875rem;
  color: var(--wp--preset--color--secondary);
  text-decoration: none;
  transition: color .2s;
}

.ae-cart-actions__continue:hover,
.ae-cart-actions__continue:focus-visible {
  color: var(--wp--preset--color--primary);
}

/* ---- FREE SHIPPING PROGRESS BAR ---- */
.ae-free-shipping-bar {
  margin: var(--wp--preset--spacing--sm) 0;
  padding: var(--wp--preset--spacing--sm);
  background: var(--wp--preset--color--subtle);
  border-radius: 6px;
  border: 1px solid var(--wp--preset--color--border);
}

.ae-free-shipping-bar__text {
  font-size: .75rem;
  font-weight: 500;
  margin: 0 0 .5rem;
  color: var(--wp--preset--color--contrast);
  line-height: 1.4;
}

.ae-free-shipping-bar__track {
  height: 6px;
  background: var(--wp--preset--color--border);
  border-radius: 3px;
  overflow: hidden;
}

.ae-free-shipping-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--wp--preset--color--primary), var(--wp--preset--color--success));
  border-radius: 3px;
  transition: width .5s ease;
}

.ae-free-shipping-bar.is-complete .ae-free-shipping-bar__fill {
  background: var(--wp--preset--color--success);
  width: 100%;
}

.ae-free-shipping-bar.is-complete .ae-free-shipping-bar__text {
  color: var(--wp--preset--color--success);
}

/* ---- FLOATING FREE SHIPPING BAR ---- */
.ae-free-shipping-float {
  position: fixed;
  inset-block-end: 1rem;
  inset-inline-start: 50%;
  z-index: 75;
  inline-size: min(calc(100vw - 2rem), 34rem);
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(26,26,26,.14);
  padding: .875rem 1rem;
  transform: translate(-50%, calc(100% + 1rem));
  transition: transform .35s ease, opacity .25s ease, visibility .25s ease;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ae-free-shipping-float.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ae-free-shipping-float__bar {
  flex: 1 1 auto;
  min-width: 0;
}

.ae-free-shipping-float__text {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--wp--preset--color--contrast);
  margin: 0 0 .5rem;
  line-height: 1.3;
}

.ae-free-shipping-float__track {
  height: 6px;
  background: var(--wp--preset--color--border);
  border-radius: 3px;
  overflow: hidden;
}

.ae-free-shipping-float__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--wp--preset--color--primary), var(--wp--preset--color--success));
  border-radius: 3px;
  transition: width .5s ease;
}

.ae-free-shipping-float.is-complete .ae-free-shipping-float__fill {
  background: var(--wp--preset--color--success);
  width: 100%;
}

.ae-free-shipping-float__close {
  flex-shrink: 0;
  inline-size: 2rem;
  block-size: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 1.125rem;
  color: var(--wp--preset--color--secondary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color .2s, background-color .2s, border-color .2s;
}

.ae-free-shipping-float__close:hover {
  color: var(--wp--preset--color--contrast);
  background: var(--wp--preset--color--subtle);
  border-color: var(--wp--preset--color--border);
}

@media (max-width: 600px) {
  .ae-free-shipping-float {
    inline-size: calc(100vw - 1rem);
    padding: .75rem .875rem;
    gap: .625rem;
  }
}

@media (max-width: 781px) {
  .ae-free-shipping-float {
    inset-block-end: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ---- SALE BANNER ---- */
.ae-sale-banner .wc-block-product-template__responsive {
  gap: var(--wp--preset--spacing--md);
}

.ae-sale-banner .wc-block-product {
  background: var(--wp--preset--color--base);
  border: 1px solid rgba(26,26,26,.08);
  box-shadow: 0 12px 24px rgba(0,0,0,.08);
  padding: 1rem;
}

.ae-sale-banner .wc-block-product .wp-block-post-title a {
  color: inherit;
  text-decoration: none;
}

.ae-sale-banner .wc-block-product .wp-block-post-title a:hover,
.ae-sale-banner .wc-block-product .wp-block-post-title a:focus-visible {
  color: var(--wp--preset--color--sale);
}

.ae-sale-banner .wc-block-product-button .wp-block-button__link {
  opacity: 1;
  transform: none;
}

/* ---- PRODUCT CARDS ---- */
.wc-block-components-product-sale-badge {
  font-family: var(--wp--preset--font-family--body);
  font-size: .625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .25rem .625rem;
  background: var(--wp--preset--color--sale);
  color: #fff;
  border-radius: 0;
}

/* Low stock urgency badge — overlays product image corner */
.ae-low-stock-badge {
  position: absolute;
  inset-block-start: .5rem;
  inset-inline-start: .5rem;
  z-index: 3;
  font-family: var(--wp--preset--font-family--body);
  font-size: .625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .25rem .625rem;
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--contrast);
  border-radius: 0;
}

.ae-low-stock-notice {
  animation: ae-pulse 2s ease-in-out infinite;
}

@keyframes ae-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ---- RECENTLY VIEWED ---- */
.ae-recently-viewed-section {
  display: none; /* Shown by JS when products exist */
}

.ae-recently-viewed-grid {
  display: flex;
  gap: var(--wp--preset--spacing--md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-block-end: var(--wp--preset--spacing--sm);
}

.ae-recently-viewed-grid::-webkit-scrollbar { display: none; }

.ae-rv-card {
  flex: 0 0 auto;
  width: 200px;
  scroll-snap-align: start;
}

.ae-rv-card__link {
  display: block;
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
}

.ae-rv-card__link:hover { color: var(--wp--preset--color--primary); }

.ae-rv-card__image {
  aspect-ratio: 4 / 5;
  background: var(--wp--preset--color--surface);
  overflow: hidden;
  margin-block-end: .5rem;
}

.ae-rv-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.ae-rv-card:hover .ae-rv-card__image img {
  transform: scale(1.05);
}

.ae-rv-card__placeholder {
  width: 100%;
  height: 100%;
  background: var(--wp--preset--color--border);
}

.ae-rv-card__title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 400;
  line-height: 1.3;
  margin: .25rem 0;
}

.ae-rv-card__price {
  display: block;
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 600;
  color: var(--wp--preset--color--contrast);
}

/* ---- PRODUCT HOVER ---- */
.woocommerce ul.products li.product,
.wc-block-product {
  transition: transform .3s, box-shadow .3s;
}

.woocommerce ul.products li.product:hover,
.wc-block-product:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,.1);
}

.woocommerce ul.products li.product a img,
.wc-block-product-image img {
  transition: transform .3s ease;
}

/* Broken image fallback — stops 404 cascade on missing product images */
.ae-img-fallback {
  object-fit: cover;
  opacity: .5;
}

/* CSS fallback for broken images: when <img> fails to load in Chrome/WebKit,
   ::after pseudo-element becomes visible, showing a placeholder. */
.wc-block-components-product-image img,
.wp-block-woocommerce-product-image img {
  position: relative;
  min-height: 200px;
}
.wc-block-components-product-image img::after,
.wp-block-woocommerce-product-image img::after {
  content: '🌿';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: var(--wp--preset--color--subtle, #EFEBE6);
  color: var(--wp--preset--color--border, #D4CEC7);
}

.woocommerce ul.products li.product:hover a img,
.wc-block-product:hover .wc-block-product-image img {
  transform: scale(1.03);
}

.woocommerce ul.products li.product .button,
.wc-block-product-button .wp-block-button__link {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  padding: 0.4rem 0.875rem !important;
  font-size: 0.75rem !important;
}

.woocommerce ul.products li.product:hover .button,
.wc-block-product:hover .wc-block-product-button .wp-block-button__link {
  opacity: 1;
  transform: translateY(0);
}

/* ---- QUICK VIEW ---- */
.quick-view-trigger {
  position: absolute;
  inset-block-end: .5rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--contrast);
  border: 1px solid var(--wp--preset--color--border);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.quick-view-trigger:hover {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--surface);
  border-color: var(--wp--preset--color--contrast);
}

/* Quickview Modal */
.ae-quickview {
  display: flex;
  gap: var(--wp--preset--spacing--xl);
  max-width: 860px;
  max-height: calc(100vh - 6rem);
  overflow: hidden;
}

.ae-quickview__image {
  flex: 0 0 50%;
  max-width: 50%;
  background: var(--wp--preset--color--subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ae-quickview__img {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 8rem);
  object-fit: contain;
}

.ae-quickview__info {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: var(--wp--preset--spacing--md) var(--wp--preset--spacing--md) var(--wp--preset--spacing--md) 0;
}

.ae-quickview__title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: var(--wp--preset--font-size--2-xl);
  font-weight: 400;
  margin: 0 0 var(--wp--preset--spacing--sm);
  line-height: 1.2;
}

.ae-quickview__price {
  font-size: var(--wp--preset--font-size--lg);
  font-weight: 600;
  margin-bottom: var(--wp--preset--spacing--md);
}

.ae-quickview__excerpt {
  font-size: var(--wp--preset--font-size--sm);
  line-height: 1.7;
  color: var(--wp--preset--color--secondary);
  margin-bottom: var(--wp--preset--spacing--md);
}

.ae-quickview__excerpt p { margin: 0 0 var(--wp--preset--spacing--sm); }

.ae-quickview__actions {
  margin-bottom: var(--wp--preset--spacing--md);
}

.ae-quickview__actions form.cart {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--sm);
  align-items: center;
}

.ae-quickview__actions .quantity input {
  width: 60px;
  height: 40px;
  text-align: center;
  border: 1px solid var(--wp--preset--color--border);
}

.ae-quickview__actions .single_add_to_cart_button {
  padding: 0.5rem 1.25rem !important;
  font-size: 0.75rem !important;
}

.ae-quickview__actions select {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--wp--preset--color--border);
  font-size: 0.8125rem;
  min-width: 200px;
}

.ae-quickview__full-link {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--wp--preset--color--secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-top: var(--wp--preset--spacing--sm);
}
.ae-quickview__full-link:hover {
  color: var(--wp--preset--color--primary);
}

/* Quickview loading state */
.ae-quickview-loading .ae-quickview {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Quickview in lightbox frame — override frame padding */
.ae-lightbox-frame:has(.ae-quickview) {
  padding: 0;
}

@media (max-width: 781px) {
  .ae-quickview {
    flex-direction: column;
  }
  .ae-quickview__image {
    flex: auto;
    max-width: 100%;
    max-height: 50vh;
  }
  .ae-quickview__img {
    max-height: 50vh;
  }
  .ae-quickview__info {
    padding: var(--wp--preset--spacing--md);
  }
}

/* ---- STICKY ADD-TO-CART ---- */
.sticky-add-to-cart {
  z-index: 90;
  transform: translateY(100%);
  transition: transform .25s;
}
.sticky-add-to-cart.is-visible { transform: translateY(0); }

/* ---- FULL-WIDTH ALIGNMENT ---- */
.wp-site-blocks > .alignfull {
  margin-inline: calc(var(--wp--preset--spacing--sm) * -1) !important;
  width: unset;
}

/* ---- WOOCOMMERCE OVERRIDES ---- */
.woocommerce div.product .product_title {
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 400;
}

.woocommerce div.product .price {
  font-family: var(--wp--preset--font-family--body);
  font-weight: 600;
}

.woocommerce div.product .single_add_to_cart_button,
.woocommerce ul.products li.product .button {
  font-family: var(--wp--preset--font-family--body) !important;
  font-size: var(--wp--preset--font-size--sm) !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  background: var(--wp--preset--color--primary) !important;
  color: var(--wp--preset--color--surface) !important;
  border-radius: 0 !important;
  padding: .5rem 1rem !important;
}

.woocommerce div.product .single_add_to_cart_button:hover,
.woocommerce ul.products li.product .button:hover {
  background: var(--wp--preset--color--contrast) !important;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  font-family: var(--wp--preset--font-family--body);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .75rem;
}

.woocommerce span.onsale {
  font-family: var(--wp--preset--font-family--body);
  font-size: .625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--wp--preset--color--sale);
  border-radius: 0;
  padding: .25rem .625rem;
  min-height: auto;
  line-height: 1.5;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 400;
}

.woocommerce ul.products li.product .price {
  font-family: var(--wp--preset--font-family--body);
  font-weight: 500;
}

/* Desktop: more breathing room for product cards */
@media (min-width: 782px) {
  .wc-block-product {
    padding: 0.75rem;
  }

  .wc-block-product .wp-block-post-title {
    font-size: var(--wp--preset--font-size--lg) !important;
  }
}

/* Wider single product: more generous 2-column split */
@media (min-width: 960px) {
  .wp-block-columns .wp-block-woocommerce-product-image-gallery {
    max-width: 560px;
    margin-inline: auto;
  }

  .wp-block-columns .wc-block-add-to-cart-form {
    max-width: 400px;
  }
}

/* ---- MEGA MENU ---- */
.mega-menu-panel {
  position: absolute;
  inset-block-start: 100%;
  inset-inline: 0;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.has-mega-submenu:hover .mega-menu-panel,
.has-mega-submenu:focus-within .mega-menu-panel {
  opacity: 1;
  visibility: visible;
}
.mega-menu-panel a { text-decoration: none; }
.mega-menu-panel a:hover { color: var(--wp--preset--color--accent); }

/* ---- COMPLIANZ GDPR ---- */
.cmplz-placeholder-element { border-radius: 0; }

/* ---- PRODUCT LIGHTBOX ---- */
.ae-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.2);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
  cursor: pointer;
}
.ae-lightbox.is-open { opacity: 1; visibility: visible; }

.ae-lightbox-frame {
  background: #fff;
  border: 1px solid #e8e4e0;
  border-radius: 8px;
  padding: 1.25rem;
  cursor: default;
  box-shadow: 0 4px 32px rgba(0,0,0,.12);
  max-width: calc(100vw - 4rem);
  max-height: calc(100vh - 4rem);
}

.ae-lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 6rem);
  object-fit: contain;
}

.ae-lightbox-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 36px;
  height: 36px;
  background: #fff;
  border: 1px solid #e0e0e0;
  color: #333;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}
.ae-lightbox-close:hover { background: #f0f0f0; }

[data-theme="dark"] .ae-lightbox-frame { background: #1E1E1A; border-color: #3A3A34; }
[data-theme="dark"] .ae-lightbox-close { background: #1E1E1A; border-color: #3A3A34; color: #ccc; }
[data-theme="dark"] .ae-lightbox-close:hover { background: #262622; }

/* ---- MOBILE BOTTOM BAR ---- */
.ae-mobile-bar {
  display: none;
}

@media (max-width: 781px) {
  .ae-mobile-bar {
    display: flex;
    position: fixed;
    inset-block-end: 0;
    inset-inline: 0;
    z-index: 1000;
    background: var(--wp--preset--color--surface);
    border-block-start: 1px solid var(--wp--preset--color--border);
    justify-content: space-around;
    align-items: center;
    padding-block: .375rem;
    padding-inline: env(safe-area-inset-left, .5rem) env(safe-area-inset-right, .5rem);
    padding-block-end: calc(.5rem + env(safe-area-inset-bottom, 0px));
  }

  .ae-mobile-bar__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .125rem;
    text-decoration: none;
    color: var(--wp--preset--color--secondary);
    font-size: .625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .25rem .5rem;
    transition: color .2s;
    position: relative;
  }

  .ae-mobile-bar__link:hover,
  .ae-mobile-bar__link.is-active {
    color: var(--wp--preset--color--primary);
  }

  .ae-mobile-bar__link svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
  }

  .ae-mobile-bar__badge {
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 0;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--surface);
    font-size: .5625rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  /* Push footer above the mobile bar */
  .site-footer {
    padding-block-end: calc(var(--wp--preset--spacing--4-xl) + 56px) !important;
  }
}

/* ---- SIDEBAR NAVIGATION ---- */
.ae-sidebar {
  padding-right: var(--wp--preset--spacing--sm);
}

/* Hide product count badges — they cause line-break mess */
.wc-block-product-categories-list-item-count {
  display: none;
}

/* Shop layout: sidebar left, content right — full width grid */
.ae-shop-layout,
.wp-block-group.ae-shop-layout {
  display: grid !important;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--wp--preset--spacing--2-xl);
  padding: 0 !important;
  max-width: calc(280px + var(--wp--preset--spacing--2-xl) + 1600px);
  width: 100%;
}

.ae-shop-sidebar {
  padding-top: var(--wp--preset--spacing--md) !important;
}

.ae-shop-content {
  min-width: 0;
}

.ae-shop-content,
.wp-block-group.ae-shop-content {
  display: block !important;
}

/* Responsive product columns — override WC grid-template-columns on the <ul>.
   Breakpoints account for ~344px header offset (280px sidebar + 64px gap). */
@media (max-width: 699px) {
  .ae-shop-content .wc-block-product-template__responsive {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (min-width: 700px) {
  .ae-shop-content .wc-block-product-template__responsive {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (min-width: 1050px) {
  .ae-shop-content .wc-block-product-template__responsive {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (min-width: 1350px) {
  .ae-shop-content .wc-block-product-template__responsive {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (min-width: 1650px) {
  .ae-shop-content .wc-block-product-template__responsive {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}

/* ---- Shop Filter Toolbar ---- */
.ae-filter-toolbar {
  border-radius: 0;
  border-bottom: 1px solid var(--wp--preset--color--border);
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--sm);
  color: var(--wp--preset--color--contrast);
}

/* Complianz cookie banner — hide when JS hasn't positioned it yet.
   Without JS, the banner renders as a full-page static block that
   breaks the layout. We only show it once Complianz sets position:fixed. */
.cmplz-cookiebanner:not([style*="position"]) {
  display: none !important;
}

/* WC drawer screen overlay — only show when explicitly opened */
.wc-block-components-drawer__screen-overlay:not(.is-visible):not([aria-hidden="false"]) {
  display: none !important;
}

/* ==============================================
   Product Filters block: inline overlay on desktop
   WC 10.x doesn't always load product-filters-style.css
   when the block is rendered inside a pattern.
   ============================================== */
@media (min-width: 601px) {
  .ae-filter-toolbar .wc-block-product-filters__open-overlay,
  .ae-filter-toolbar .wc-block-product-filters__overlay-header,
  .ae-filter-toolbar .wc-block-product-filters__overlay-footer {
    display: none !important;
  }

  .ae-filter-toolbar .wc-block-product-filters__overlay {
    background: inherit !important;
    color: inherit !important;
    inset: 0 !important;
    pointer-events: auto !important;
    position: relative !important;
    transition: none !important;
    z-index: auto !important;
  }

  .ae-filter-toolbar .wc-block-product-filters__overlay-wrapper {
    background: inherit !important;
    color: inherit !important;
    height: auto !important;
    width: auto !important;
  }

  .ae-filter-toolbar .wc-block-product-filters__overlay-dialog {
    background: inherit !important;
    color: inherit !important;
    position: relative !important;
    transform: none !important;
    max-height: none !important;
    gap: var(--wp--preset--spacing--md);
  }

  .ae-filter-toolbar .wc-block-product-filters__overlay-content {
    background: inherit !important;
    color: inherit !important;
    flex-grow: 1 !important;
    overflow: visible !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: var(--wp--preset--spacing--md);
    align-items: center;
  }
}

/* ==============================================
   Search block in toolbar
   ============================================== */
.ae-filter-toolbar .wp-block-woocommerce-product-search {
  min-width: 220px;
  max-width: 320px;
}

/* Visually hide the search label — the placeholder suffices */
.ae-filter-toolbar .wc-block-product-search__label {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  word-wrap: normal;
}

/* Search fields container — match header-search styling */
.ae-filter-toolbar .wc-block-product-search__fields {
  display: flex;
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--surface);
  transition: border-color .2s;
}

.ae-filter-toolbar .wc-block-product-search__fields:focus-within {
  border-color: var(--wp--preset--color--primary);
}

/* Search text input */
.ae-filter-toolbar .wc-block-product-search__field {
  border: none;
  background: transparent;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  font-family: var(--wp--preset--font-family--body);
  color: var(--wp--preset--color--contrast);
  outline: none;
  flex: 1;
  min-width: 0;
}

.ae-filter-toolbar .wc-block-product-search__field::placeholder {
  color: var(--wp--preset--color--secondary);
  opacity: 0.7;
}

/* Search submit button */
.ae-filter-toolbar .wc-block-product-search__button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--surface);
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  transition: background .2s;
  margin: 0;
  line-height: 1;
}

.ae-filter-toolbar .wc-block-product-search__button:hover {
  background: var(--wp--preset--color--contrast);
}

.ae-filter-toolbar .wc-block-product-search__button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ==============================================
   Price filter
   ============================================== */
.ae-filter-toolbar .wp-block-woocommerce-product-filter-price {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.ae-filter-toolbar .wc-block-product-filter-price-slider {
  width: 100%;
  min-width: 280px;
}

/* Single-row layout: slider + inputs side by side */
.ae-filter-toolbar .wc-block-product-filter-price-slider__content {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: center;
}

/* Range slider container */
.wc-block-product-filter-price-slider__range {
  background: transparent !important;
  --track-background: none !important;
  --range-color: transparent !important;
}

.ae-filter-toolbar .wc-block-product-filter-price-slider__range {
  flex: 1 1 0;
  position: relative;
  height: 32px;
  min-width: 140px;
  background: transparent !important;
  --track-background: none !important;
}

/* Green active filled track */
.ae-filter-toolbar .wc-block-product-filter-price-slider__range .range-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  left: var(--low);
  right: calc(100% - var(--high));
  background: var(--wp--preset--color--primary);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}

/* Price text inputs */
.ae-filter-toolbar .wc-block-product-filter-price-slider__left,
.ae-filter-toolbar .wc-block-product-filter-price-slider__right {
  flex: 0 0 auto;
}

.ae-filter-toolbar .wc-block-product-filter-price-slider__left input,
.ae-filter-toolbar .wc-block-product-filter-price-slider__right input {
  width: 4em;
  padding: 0.3rem 0.3rem;
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--surface);
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.75rem;
  color: var(--wp--preset--color--contrast);
  text-align: center;
  transition: border-color .2s;
}

.ae-filter-toolbar .wc-block-product-filter-price-slider__left input:focus,
.ae-filter-toolbar .wc-block-product-filter-price-slider__right input:focus {
  border-color: var(--wp--preset--color--primary);
  outline: none;
}

/* Range input — invisible, only thumbs visible.
   Height matches thumb (20px) so centering is automatic
   when input is centered in container via top/transform. */
.ae-filter-toolbar .wc-block-product-filter-price-slider__range input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 !important;
  padding: 0 !important;
  z-index: 2;
}

/* Kill WC's gradient track — global */
.wc-block-product-filter-price-slider__range input[type="range"],
.wc-block-product-filter-price-slider__range input[type="range"]:focus {
  --track-background: none;
  background: transparent !important;
  background-image: none !important;
}

.wc-block-product-filter-price-slider__range input[type="range"]::-webkit-slider-runnable-track {
  background: transparent !important;
}

.wc-block-product-filter-price-slider__range input[type="range"]::-moz-range-track {
  background: transparent !important;
}

.wc-block-product-filter-price-slider__range input[type="range"]::-ms-track {
  background: transparent !important;
  border-color: transparent !important;
  color: transparent !important;
}

.ae-filter-toolbar .wc-block-product-filter-price-slider__range input[type="range"].min {
  z-index: 3;
  pointer-events: none;
}

.ae-filter-toolbar .wc-block-product-filter-price-slider__range input[type="range"].max {
  z-index: 4;
  pointer-events: none;
}

/* WebKit thumb */
.ae-filter-toolbar .wc-block-product-filter-price-slider__range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--wp--preset--color--primary);
  cursor: pointer;
  pointer-events: auto;
  border: 2px solid var(--wp--preset--color--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: transform .15s;
}

.ae-filter-toolbar .wc-block-product-filter-price-slider__range input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Firefox thumb */
.ae-filter-toolbar .wc-block-product-filter-price-slider__range input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--wp--preset--color--primary);
  cursor: pointer;
  border: 2px solid var(--wp--preset--color--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.ae-filter-toolbar .wc-block-product-filter-price-slider__range input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.15);
}

.ae-filter-toolbar .wc-block-product-filter-price-slider__range input[type="range"]::-moz-range-track {
  background: transparent;
  border: none;
}

/* ==============================================
   Status filter chips
   ============================================== */
/* Status group label (the "Status" heading inside fieldset legend) */
.ae-filter-toolbar .wp-block-woocommerce-product-filter-chips fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* Restore screen-reader-text on legend — the chips speak for themselves */
.ae-filter-toolbar .wp-block-woocommerce-product-filter-chips legend {
  /* keep the default screen-reader-text hiding */
}

/* Chips container — horizontal pill row */
.ae-filter-toolbar .wc-block-product-filter-chips__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Individual chip button — green outline pill */
.ae-filter-toolbar .wc-block-product-filter-chips__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--wp--preset--color--primary);
  background: var(--wp--preset--color--surface);
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--wp--preset--color--primary);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
  user-select: none;
  line-height: 1.4;
}

.ae-filter-toolbar .wc-block-product-filter-chips__item:hover {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--surface);
}

/* Checked state (aria-checked="true") — filled green pill */
.ae-filter-toolbar .wc-block-product-filter-chips__item[aria-checked="true"] {
  background: var(--wp--preset--color--primary);
  border-color: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--surface);
  font-weight: 500;
}

.ae-filter-toolbar .wc-block-product-filter-chips__item[aria-checked="true"]:hover {
  background: var(--wp--preset--color--contrast);
  border-color: var(--wp--preset--color--contrast);
}

/* Label wrapper inside chip */
.ae-filter-toolbar .wc-block-product-filter-chips__label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Count badge inside chip */
.ae-filter-toolbar .wc-block-product-filter-chips__item .wc-block-product-filter-chips__count {
  font-size: 0.6875rem;
  opacity: 0.7;
}

.ae-filter-toolbar .wc-block-product-filter-chips__item[aria-checked="true"] .wc-block-product-filter-chips__count {
  opacity: 0.85;
}

/* ==============================================
   Active removable filter chips
   ============================================== */
.ae-filter-toolbar .wp-block-woocommerce-product-filter-active {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--sm);
}

.ae-filter-toolbar .wc-block-product-filter-removable-chips__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Individual removable chip — green filled pill */
.ae-filter-toolbar .wc-block-product-filter-removable-chips__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  background: var(--wp--preset--color--primary);
  border: 1px solid var(--wp--preset--color--primary);
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--wp--preset--color--surface);
  line-height: 1.4;
  white-space: nowrap;
}

/* Remove button (× icon) inside chip */
.ae-filter-toolbar .wc-block-product-filter-removable-chips__items .wc-block-product-filter-removable-chips__item .wc-block-product-filter-removable-chips__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: rgba(255,255,255,0.2) !important;
  border-radius: 50%;
  color: var(--wp--preset--color--surface);
  cursor: pointer;
  line-height: 1;
  transition: background .15s;
  flex-shrink: 0;
}

.ae-filter-toolbar .wc-block-product-filter-removable-chips__items .wc-block-product-filter-removable-chips__item .wc-block-product-filter-removable-chips__remove:hover {
  background: rgba(255,255,255,0.35) !important;
}

.ae-filter-toolbar .wc-block-product-filter-removable-chips__items .wc-block-product-filter-removable-chips__item .wc-block-product-filter-removable-chips__remove svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Clear all button */
.ae-filter-toolbar .wp-block-woocommerce-product-filter-clear-button button {
  padding: 0.25rem 0.6rem;
  border: none;
  background: none;
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.6875rem;
  font-weight: 500;
  text-decoration: underline;
  color: var(--wp--preset--color--secondary);
  cursor: pointer;
  transition: color .15s;
}

.ae-filter-toolbar .wp-block-woocommerce-product-filter-clear-button button:hover {
  color: var(--wp--preset--color--contrast);
}

/* Sale filter pill — styled to match the status chips */
.ae-filter-toolbar .ae-sale-chip .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--primary) !important;
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--wp--preset--color--primary);
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}

.ae-filter-toolbar .ae-sale-chip .wp-block-button__link:hover {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--surface);
}

/* Active sale filter state */
.ae-filter-toolbar .ae-sale-chip .wp-block-button__link.is-active {
  background: var(--wp--preset--color--primary);
  border-color: var(--wp--preset--color--primary) !important;
  color: var(--wp--preset--color--surface);
}

.ae-filter-toolbar .ae-sale-chip .wp-block-button__link.is-active:hover {
  background: var(--wp--preset--color--contrast);
  border-color: var(--wp--preset--color--contrast) !important;
}

/* ==============================================
   Mobile overlay (< 601px): full-screen dialog
   ============================================== */
@media (max-width: 600px) {
  .ae-filter-toolbar {
    flex-wrap: wrap;
  }

  /* Hide overlay by default on mobile */
  .ae-filter-toolbar .wc-block-product-filters__overlay {
    display: none;
  }

  /* Show overlay when opened */
  .ae-filter-toolbar .wp-block-woocommerce-product-filters.is-overlay-opened .wc-block-product-filters__overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(26, 26, 26, 0.3);
    backdrop-filter: blur(2px);
  }

  .ae-filter-toolbar .wp-block-woocommerce-product-filters.is-overlay-opened .wc-block-product-filters__overlay-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }

  .ae-filter-toolbar .wp-block-woocommerce-product-filters.is-overlay-opened .wc-block-product-filters__overlay-dialog {
    display: flex;
    flex-direction: column;
    background: var(--wp--preset--color--surface);
    border-radius: 12px 12px 0 0;
    max-height: 85vh;
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  }

  /* Show the open overlay button */
  .ae-filter-toolbar .wc-block-product-filters__open-overlay {
    display: inline-flex !important;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.875rem;
    border: 1px solid var(--wp--preset--color--border);
    background: var(--wp--preset--color--surface);
    font-family: var(--wp--preset--font-family--body);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--wp--preset--color--contrast);
    cursor: pointer;
    transition: border-color .15s, background .15s;
  }

  .ae-filter-toolbar .wc-block-product-filters__open-overlay:hover {
    border-color: var(--wp--preset--color--primary);
    background: var(--wp--preset--color--subtle);
  }

  .ae-filter-toolbar .wc-block-product-filters__open-overlay svg {
    width: 18px;
    height: 18px;
  }

  /* Overlay header — close + title row */
  .ae-filter-toolbar .wc-block-product-filters__overlay-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: var(--wp--preset--spacing--sm);
    border-bottom: 1px solid var(--wp--preset--color--border);
    flex-shrink: 0;
  }

  .ae-filter-toolbar .wc-block-product-filters__close-overlay {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--wp--preset--color--border);
    background: var(--wp--preset--color--surface);
    font-family: var(--wp--preset--font-family--body);
    font-size: 0.75rem;
    color: var(--wp--preset--color--contrast);
    cursor: pointer;
    transition: border-color .15s;
  }

  .ae-filter-toolbar .wc-block-product-filters__close-overlay:hover {
    border-color: var(--wp--preset--color--contrast);
  }

  /* Overlay content — scrollable filter area */
  .ae-filter-toolbar .wc-block-product-filters__overlay-content {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--wp--preset--spacing--md) !important;
    padding: var(--wp--preset--spacing--md) !important;
    overflow-y: auto !important;
    flex: 1;
  }

  /* Overlay footer — apply button area */
  .ae-filter-toolbar .wc-block-product-filters__overlay-footer {
    display: flex !important;
    justify-content: flex-end;
    gap: var(--wp--preset--spacing--sm);
    padding: var(--wp--preset--spacing--sm);
    border-top: 1px solid var(--wp--preset--color--border);
    flex-shrink: 0;
  }

  /* Style the apply button in the footer */
  .ae-filter-toolbar .wc-block-product-filters__overlay-footer button,
  .ae-filter-toolbar .wc-block-product-filters__overlay-footer .wc-block-product-filter-apply-button button {
    padding: 0.5rem 1.25rem;
    border: none;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--surface);
    font-family: var(--wp--preset--font-family--body);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background .15s;
  }

  .ae-filter-toolbar .wc-block-product-filters__overlay-footer button:hover,
  .ae-filter-toolbar .wc-block-product-filters__overlay-footer .wc-block-product-filter-apply-button button:hover {
    background: var(--wp--preset--color--contrast);
  }

  /* Prevent body scroll when overlay is open */
  body:has(.ae-filter-toolbar .wp-block-woocommerce-product-filters.is-overlay-opened) {
    overflow: hidden;
  }
}

.ae-sidebar .wp-block-navigation {
  flex-direction: column !important;
  gap: 0;
}

.ae-sidebar .wp-block-navigation-item {
  display: block;
}

.ae-sidebar .wp-block-navigation-item__content {
  display: block;
  padding-block: 0.375rem;
  font-size: var(--wp--preset--font-size--sm);
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
  transition: color .15s;
}

.ae-sidebar .wp-block-navigation-item__content:hover {
  color: var(--wp--preset--color--accent);
}

.ae-sidebar .wc-block-product-categories {
  font-size: 0.8125rem;
  line-height: 1.8;
}

.ae-sidebar .wc-block-product-categories-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ae-sidebar .wc-block-product-categories-list-item {
  margin-bottom: 0.125rem;
}

.ae-sidebar .wc-block-product-categories-list-item a {
  display: block;
  padding-block: 0.25rem;
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
  transition: color .15s;
}

.ae-sidebar .wc-block-product-categories-list-item a:hover {
  color: var(--wp--preset--color--accent);
}

.ae-sidebar .wc-block-product-categories-list-item .wc-block-product-categories-list {
  padding-left: 1rem;
  margin-top: 0;
}

.ae-sidebar .wc-block-product-categories-list-item .wc-block-product-categories-list-item a {
  font-size: 0.8125rem;
  color: var(--wp--preset--color--secondary);
}

.ae-sidebar .wc-block-product-categories-list-item .wc-block-product-categories-list-item a:hover {
  color: var(--wp--preset--color--accent);
}

/* ---- INFINITE SCROLL ---- */
/* Hide pagination visually — JS reads next-link from it, then loads more via IntersectionObserver */
.wp-block-query-pagination.ae-is-infinite {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Sentinel: invisible element at bottom of product list that triggers load when scrolled into view */
.ae-infinite-sentinel {
  width: 100%;
  height: 1px;
}

/* Loading indicator */
.ae-infinite-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wp--preset--spacing--sm);
  padding: var(--wp--preset--spacing--2-xl) 0;
  color: var(--wp--preset--color--secondary);
  font-size: 0.875rem;
}

.ae-infinite-loader__spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--wp--preset--color--subtle);
  border-top-color: var(--wp--preset--color--primary);
  border-radius: 50%;
  animation: ae-spin 0.7s linear infinite;
}

@keyframes ae-spin {
  to { transform: rotate(360deg); }
}

/* ---- HAMBURGER MENU TOGGLE ---- */
.ae-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-shrink: 0;
}

.ae-menu-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--wp--preset--color--contrast);
  border-radius: 1px;
  transition: transform .25s, opacity .25s;
}

.ae-menu-toggle__bar + .ae-menu-toggle__bar {
  margin-top: 5px;
}

/* ---- OFF-CANVAS SIDEBAR OVERLAY ---- */
.ae-sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}

.ae-sidebar-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.ae-sidebar-panel {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 9999;
  width: 300px;
  max-width: 85vw;
  background: var(--wp--preset--color--surface);
  box-shadow: 2px 0 24px rgba(0,0,0,.12);
  padding: var(--wp--preset--spacing--lg);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .3s ease;
}

.ae-sidebar-panel.is-open {
  transform: translateX(0);
}

.ae-sidebar-panel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--wp--preset--color--border);
  color: var(--wp--preset--color--contrast);
  font-size: 1.25rem;
  cursor: pointer;
  margin-bottom: var(--wp--preset--spacing--md);
  float: right;
  transition: background .15s;
}

.ae-sidebar-panel__close:hover {
  background: var(--wp--preset--color--subtle);
}

.ae-sidebar-panel .ae-sidebar {
  position: static;
  max-height: none;
  overflow-y: visible;
  padding-right: 0;
}

/* ---- MOBILE MENU CONTENTS ---- */
.ae-sidebar-panel__content {
  clear: both;
}

/* Override mobile hide rules — show everything inside the panel */
.ae-sidebar-panel__content .primary-navigation,
.ae-sidebar-panel__content .header-search,
.ae-sidebar-panel__content .ae-account-nav {
  display: flex !important;
}

/* Force stacked layout on all navigation containers inside the panel */
.ae-sidebar-panel__content .wp-block-navigation__container {
  flex-direction: column !important;
  width: 100%;
  gap: 0;
}

/* Mobile search */
.ae-mobile-search {
  margin-bottom: var(--wp--preset--spacing--md);
}
.ae-mobile-search .header-search {
  width: 100%;
}

/* Mobile nav: stacked links */
.ae-mobile-nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 0;
  margin-bottom: var(--wp--preset--spacing--md);
  border-bottom: 1px solid var(--wp--preset--color--border);
  padding-bottom: var(--wp--preset--spacing--md);
}

.ae-mobile-nav > .wp-block-navigation__container {
  flex-direction: column !important;
  width: 100%;
  gap: 0;
}

.ae-mobile-nav .wp-block-navigation-item {
  display: block;
}

.ae-mobile-nav .wp-block-navigation-item__content {
  display: block;
  padding-block: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
  border-bottom: 1px solid var(--wp--preset--color--subtle);
}

.ae-mobile-nav .wp-block-navigation-item__content:hover {
  color: var(--wp--preset--color--primary);
}

/* Mobile submenus: always visible, indented */
.ae-mobile-nav .wp-block-navigation__submenu-container {
  position: static;
  opacity: 1;
  visibility: visible;
  box-shadow: none;
  border: none;
  padding: 0 0 0 var(--wp--preset--spacing--md);
  min-width: auto;
  background: transparent;
}

.ae-mobile-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--wp--preset--color--secondary);
}

/* Mobile account links */
.ae-mobile-account {
  display: flex !important;
  gap: var(--wp--preset--spacing--sm);
  margin-bottom: var(--wp--preset--spacing--md);
  padding-bottom: var(--wp--preset--spacing--md);
  border-bottom: 1px solid var(--wp--preset--color--border);
}

.ae-mobile-account .wp-block-navigation-item__content {
  font-size: 0.8125rem;
  text-decoration: none;
  color: var(--wp--preset--color--secondary);
}

/* Mobile categories */
.ae-mobile-categories {
  margin-bottom: var(--wp--preset--spacing--md);
}

.ae-mobile-categories .wp-block-heading {
  margin-bottom: var(--wp--preset--spacing--sm);
}

.ae-mobile-categories .wc-block-product-categories {
  font-size: 0.8125rem;
}

/* ---- FOOTER ---- */
.site-footer .wp-block-site-title {
  white-space: nowrap;
}

.site-footer .wp-block-navigation {
  gap: 0.5rem;
}

.site-footer .wp-block-navigation-item__content {
  padding-block: 0;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 959px) {
  /* Stack shop layout, hide sidebar */
  .ae-shop-layout,
  .wp-block-group.ae-shop-layout {
    grid-template-columns: 1fr !important;
  }
  .ae-shop-sidebar {
    display: none;
  }
  .ae-menu-toggle {
    display: block;
  }
  /* Hide primary nav on tablet — opens in off-canvas sidebar */
  .primary-navigation {
    display: none !important;
  }
  /* Hide search and account nav on tablet */
  .ae-header-icons .header-search {
    display: none;
  }
  .ae-account-nav {
    display: none !important;
  }
  .ae-header-icons {
    gap: var(--wp--preset--spacing--2-xs);
  }
}

@media (max-width: 781px) {
  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column { flex-basis: 100% !important; }
  .site-header { overflow-x: hidden; }
  .site-header .wp-block-site-logo img { max-width: 120px !important; height: auto; }
  .site-header .wp-block-site-title { font-size: var(--wp--preset--font-size--md) !important; }
}

/* ---- ACCESSIBILITY ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---- PRINT ---- */
@media print {
  .site-header, .site-footer, .back-to-top, .sticky-add-to-cart, .ae-shop-notice { display: none !important; }
}
