/* Small additions for the CI4 port (flash messages, newsletter). Original design lives in style.css. */
.afb-flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 0.9rem; font-weight: 600; }
.afb-flash-error { background: #fdecec; color: #9b1c1c; border: 1px solid #f5c2c2; }
.afb-flash-success, .afb-flash-js { background: #edf8f0; color: #1d6b35; border: 1px solid #bfe3c9; }
.afb-flash-js.is-error { background: #fdecec; color: #9b1c1c; border-color: #f5c2c2; }
.footer-policy-links a:hover { text-decoration: underline; }

/* Mobile tap targets for the CMS-driven footer links added by the port (>= 44px, WCAG/Apple guideline) */
@media (max-width: 768px) {
  .site-footer .footer-links a,
  .site-footer .footer-contact-item a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .site-footer .footer-links li { margin-bottom: 0; }
  .site-footer .footer-policy-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 4px;
  }
  .site-footer .footer-brand a[aria-label] {
    width: 44px !important;
    height: 44px !important;
  }
}

/* ── Mobile fixes for inherited design issues (CI4 port, 2026-10) ───────────────────────────── */
/* Closed cart drawer: its box-shadow bled into the viewport as a grey strip on the right edge.
   Shadow only while open; visibility hidden when closed (delayed so the slide-out still animates). */
.cart-drawer {
  box-shadow: none;
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.35s, box-shadow 0.2s ease;
}
.cart-drawer.open,
.cart-drawer.active {
  box-shadow: -10px 0 40px rgba(32, 21, 24, 0.2);
  visibility: visible;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s, box-shadow 0.2s ease;
}
/* Closed mobile nav panel: no shadow peeking under the header */
.mobile-nav-panel { box-shadow: none; }
.mobile-nav-panel.open { box-shadow: var(--shadow-lg); }

@media (max-width: 767.98px) {
  /* Tap targets >= 44px */
  .cart-btn,
  .close-mobile-nav-btn,
  .close-drawer-btn,
  .cart-close-btn,
  .modal-close-btn,
  .mobile-nav-toggle {
    min-width: 44px !important;
    min-height: 44px !important;
  }
  .quick-view-btn,
  .product-media .quick-view-btn,
  .add-to-cart-btn,
  .product-card-footer .add-to-cart-btn,
  .product-card-actions .add-to-cart-btn,
  .btn,
  .filter-btn,
  .weight-pill,
  .weight-chip {
    min-height: 44px !important;
  }
  .close-mobile-nav-btn,
  .close-drawer-btn,
  .cart-close-btn,
  .modal-close-btn,
  .quick-view-btn,
  .weight-pill,
  .weight-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  #product-sort-select,
  .form-select,
  .form-input,
  .calc-select {
    min-height: 44px !important;
  }
  .calc-range { min-height: 44px; }

  /* Text never below 12px */
  .brand-title { font-size: max(12px, clamp(0.72rem, 2.9vw, 0.88rem)) !important; }
  .brand-subtitle,
  .badge,
  .product-badge,
  .qv-img-frame .product-badge,
  .cart-badge,
  .clean-chip,
  .clean-chip.highlight,
  .weight-pill-save,
  .review-verified-badge,
  .hero-proof-badge,
  .calc-discount-badge {
    font-size: max(12px, 0.75rem) !important;
  }

  /* Mobile nav panel fills the dynamic viewport */
  .mobile-nav-panel {
    min-height: 100dvh;
    overflow-y: auto;
  }
}

/* v4 scroll lock: no scroll-chaining from overlays to the page; locked page cannot overscroll */
html.afb-scroll-locked, html.afb-scroll-locked body { overscroll-behavior: none; }
.cart-drawer, .cart-items-container, .modal-overlay, .modal-box, #qv-modal-box, .mobile-nav-panel {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
