/**
 * NewAsNew — Mobile Optimization Layer
 *
 * SAFE additive CSS — only kicks in below 768px.
 * Does NOT modify desktop. Does NOT override layouts.
 * Only fixes specific mobile pain points:
 *   1. Header search uses full width
 *   2. Hero stats don't conflict with WhatsApp button
 *   3. Better tap targets (44x44px min)
 *   4. Smoother scrolling
 *   5. Better product card spacing on mobile
 *   6. Mobile sticky add-to-cart on product page
 *   7. Better cart/checkout spacing
 *   8. Fix WhatsApp button position
 */

/* ═══ MOBILE BASE — Below 768px ═══ */
@media (max-width: 768px) {

  /* Smooth tap experience */
  * {
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
  }

  /* Better header on mobile — full-width search */
  .site-header .sw {
    padding: 10px 14px !important;
  }
  .header-inner {
    gap: 6px !important;
  }
  /* Keep header-search constrained so cart+hamburger stay visible */
  .header-search {
    max-width: 140px !important;
    min-width: 80px !important;
    flex: 1 !important;
  }
  .header-search input {
    font-size: 14px !important;
  }
  .header-search input::placeholder {
    font-size: 13px !important;
  }
  /* Ensure hamburger always visible */
  .mob-menu-btn {
    display: flex !important;
    flex-shrink: 0 !important;
  }

  /* v13.4.6: clean mobile header — preserve brand readability, prevent
     overflow. Strategy:
       - Brand name stays full (most important visual element)
       - Search field gets reasonable width on regular mobile
       - On narrow mobile (<=420px) search becomes icon-only collapsible
       - Cart loses "Cart" text on narrow mobile, keeps emoji + badge
       - Hamburger never gets pushed off-screen
  */
  .header-actions {
    flex-shrink: 0 !important;
    gap: 6px !important;
  }
  .header-search {
    flex: 1 1 auto !important;
    max-width: 160px !important;
    min-width: 80px !important;
  }
  .logo-name {
    /* Keep brand name visible, no truncation */
    white-space: nowrap;
  }

  /* Touch-friendly buttons */
  .cart-btn,
  .account-btn,
  .btn,
  button:not([class*="quiz-"]):not(.swiper-button-next):not(.swiper-button-prev) {
    min-height: 42px !important;
  }

  /* Hero — better mobile spacing */
  .hero-content {
    padding: 28px 16px 80px !important;
  }
  .hero-stats,
  .stat-grid {
    margin-bottom: 24px !important;
  }

  /* Product card grid — 2 columns on mobile (better than 1) */
  .product-grid,
  .nan-product-grid,
  .pcard-grid,
  .woocommerce ul.products {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  /* Single column for very small screens */
  @media (max-width: 380px) {
    .product-grid,
    .nan-product-grid,
    .pcard-grid {
      grid-template-columns: 1fr !important;
    }
  }

  /* v13.4.6: narrow mobile (iPhone X 375, SE 320, mini 360, Android 360).
     Layout: [Logo] [.................flex spacer....] [Account] [CartIcon] [Hamburger]
     Search is HIDDEN — accessible via the hamburger menu instead. This is
     the standard pattern for narrow mobile and keeps all critical actions
     visible without overlap. */
  @media (max-width: 420px) {
    .header-search {
      display: none !important;
    }
    .header-row {
      padding: 0 12px !important;
      gap: 8px !important;
      height: 56px !important;
    }
    .logo-name {
      font-size: 17px !important;
    }
    .logo-box {
      width: 30px !important;
      height: 30px !important;
    }
    /* Account: avatar only, no name label */
    .account-name-lbl {
      display: none !important;
    }
    .account-btn {
      padding: 8px !important;
    }
    /* Cart: emoji + badge only, no "Cart" text */
    .cart-btn {
      padding: 8px 12px !important;
      font-size: 0 !important;       /* hide "Cart" text node */
      gap: 4px !important;
      line-height: 1 !important;
    }
    .cart-btn::before {
      content: '\1F6D2';              /* shopping cart emoji */
      font-size: 16px !important;
      color: #fff !important;
      display: inline-block;
      line-height: 1;
    }
    .cart-btn .cart-count {
      font-size: 11px !important;
      color: var(--ink) !important;
      min-width: 18px !important;
      height: 18px !important;
      padding: 0 5px !important;
    }
    /* Hamburger same size to balance */
    .mob-menu-btn {
      width: 36px !important;
      height: 36px !important;
    }
  }

  /* v13.4.6: search field inside the hamburger menu (replaces header
     search when it's hidden at <=420px) */
  .mob-nav-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--g100);
    border-bottom: 1px solid var(--g200);
  }
  .mob-nav-search input {
    flex: 1;
    background: var(--w);
    border: 1.5px solid var(--g200);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: var(--f);
    font-size: 14px;
    color: var(--ink);
    outline: none;
    -webkit-appearance: none;
  }
  .mob-nav-search input:focus {
    border-color: var(--blue);
  }
  .mob-nav-search button {
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }

  /* Product card — compact mobile */
  .pcard-body {
    padding: 12px !important;
  }
  .pcard-name a {
    font-size: 13px !important;
    line-height: 1.4 !important;
  }
  .pcard-brand {
    font-size: 10px !important;
  }

  /* Section spacing — less on mobile */
  .section {
    padding: 36px 0 !important;
  }
  .sec-title {
    font-size: 22px !important;
    line-height: 1.2 !important;
  }
  .sec-sub {
    font-size: 13px !important;
  }

  /* Single product page — mobile optimization */
  .woocommerce div.product div.images {
    margin-bottom: 16px !important;
  }
  .woocommerce div.product div.summary {
    padding: 0 !important;
  }
  .woocommerce div.product .product_title {
    font-size: 22px !important;
    line-height: 1.25 !important;
  }
  .woocommerce div.product p.price,
  .woocommerce div.product span.price {
    font-size: 22px !important;
  }

  /* Cart page mobile fixes */
  .woocommerce-cart .woocommerce-cart-form {
    overflow-x: auto;
  }
  .woocommerce table.shop_table_responsive tr td.product-thumbnail img {
    max-width: 60px !important;
  }

  /* Checkout mobile — vertical stack */
  .woocommerce-checkout .col2-set,
  .woocommerce-checkout #customer_details {
    display: block !important;
  }
  .woocommerce-checkout .col-1,
  .woocommerce-checkout .col-2 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 !important;
    margin-bottom: 18px !important;
  }
  .woocommerce form .form-row {
    margin-bottom: 12px !important;
  }
  .woocommerce form .form-row label {
    font-size: 13px !important;
    margin-bottom: 5px !important;
  }
  .woocommerce form .form-row input.input-text,
  .woocommerce form .form-row textarea,
  .woocommerce form .form-row select {
    font-size: 16px !important;  /* iOS won't auto-zoom on focus */
    padding: 12px 14px !important;
    min-height: 44px !important;
  }

  /* Trust badges — 2 cols on mobile, no overflow */
  .nan-trust-row {
    grid-template-columns: 1fr 1fr !important;
    padding: 12px !important;
    gap: 10px !important;
  }
  .nan-trust-item {
    font-size: 11px !important;
  }

  /* WhatsApp button — out of way */
  .nan-wa-float {
    width: 52px !important;
    height: 52px !important;
    bottom: 16px !important;
    right: 16px !important;
  }
  .nan-wa-float svg {
    width: 24px !important;
    height: 24px !important;
  }

  /* Cookie banner — not too tall on mobile */
  #nan-cookie-banner {
    padding: 14px 16px !important;
  }
  #nan-cookie-banner p {
    font-size: 12.5px !important;
    line-height: 1.45 !important;
  }
  #nan-cookie-banner button {
    flex: 1;
    padding: 10px 14px !important;
    font-size: 12.5px !important;
  }

  /* Single product — mobile sticky add to cart */
  .single-product .summary form.cart {
    position: relative;
    z-index: 1;
  }

  /* Better images on mobile */
  .woocommerce div.product div.images img {
    border-radius: 12px !important;
  }

  /* Quantity field — bigger tap target */
  .quantity .qty {
    min-width: 70px !important;
    height: 44px !important;
    font-size: 15px !important;
  }

  /* Tables — horizontal scroll if needed */
  table.shop_table {
    font-size: 13px !important;
  }
  .woocommerce-cart table.cart td.product-name a {
    font-size: 14px !important;
    font-weight: 600;
  }

  /* My Account — better mobile layout */
  .woocommerce-MyAccount-navigation,
  .woocommerce-MyAccount-content {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
  }
  .woocommerce-MyAccount-navigation {
    margin-bottom: 18px;
  }
  .woocommerce-MyAccount-navigation ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    text-align: center;
  }
  .woocommerce-MyAccount-navigation ul li.is-active a {
    background: #18181b;
    color: #fff;
    border-color: #18181b;
  }

  /* My Account orders table — card-like on mobile */
  .woocommerce-orders-table thead {
    display: none;
  }
  .woocommerce-orders-table tr {
    display: block;
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
  }
  .woocommerce-orders-table td {
    display: block;
    border: none !important;
    padding: 4px 0 !important;
    font-size: 13px;
  }
  .woocommerce-orders-table td::before {
    content: attr(data-title) ": ";
    font-weight: 700;
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
    margin-right: 4px;
  }

  /* Shipping & cancellation pages — better readability */
  .page-content h2 {
    font-size: 18px !important;
    margin-top: 24px !important;
  }
  .page-content p,
  .page-content li {
    font-size: 14px !important;
    line-height: 1.7 !important;
  }
}

/* ═══ EXTRA SMALL — Below 380px ═══ */
@media (max-width: 380px) {
  .logo-name {
    font-size: 16px !important;
  }
  .logo-box {
    width: 30px !important;
    height: 30px !important;
  }
  .cart-btn {
    padding: 7px 9px !important;
  }
  .cart-btn-text {
    display: none;
  }
  .hero-h {
    font-size: 24px !important;
  }
}

/* ═══ TOUCH-DEVICE OPTIMIZATIONS ═══ */
@media (hover: none) and (pointer: coarse) {
  /* No hover-dependent reveals on touch devices */
  .pcard-quick {
    opacity: 1 !important;
    transform: none !important;
  }
  /* Disable hover transforms that don't make sense on touch */
  .pcard:hover {
    transform: none !important;
  }
}

/* ═══ ACCESSIBILITY — Respect reduced motion ═══ */
@media (prefers-reduced-motion: reduce) {
  .logo-box {
    animation: none !important;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ═══ ADDITIONAL UX FIXES ═══ */

/* Login modal - proper z-index above header */
#nan-login-modal {
  z-index: 99999 !important;
}

/* WhatsApp + Back to top - don't overlap each other */
.nan-wa-float {
  bottom: 72px !important;
}
#nan-btt {
  bottom: 20px !important;
  right: 20px !important;
}

@media (max-width: 768px) {
  .nan-wa-float {
    bottom: 68px !important;
    right: 14px !important;
  }
  #nan-btt {
    bottom: 16px !important;
    right: 14px !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 14px !important;
  }
}

/* Cookie banner - don't cover buttons on mobile */
@media (max-width: 600px) {
  #nan-cookie-banner > div {
    flex-direction: column !important;
    gap: 12px !important;
  }
  #nan-cookie-banner > div > div:last-child {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
  }
  #nan-cookie-accept,
  #nan-cookie-reject {
    flex: 1 !important;
    text-align: center !important;
  }
}

/* My Account - active menu item */
.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--dashboard.is-active a {
  background: #18181b !important;
  color: #fff !important;
  border-color: #18181b !important;
}

/* Mobile nav touch targets */
.mob-nav-btn {
  min-height: 44px !important;
  padding: 12px 16px !important;
}

/* Search results count */
.woocommerce-result-count {
  font-size: 13px !important;
  color: #6b7280 !important;
  margin-bottom: 16px !important;
}

/* Place Order button - better mobile */
@media (max-width: 768px) {
  #place_order,
  .woocommerce #respond input#submit,
  .woocommerce a.button,
  .woocommerce button.button {
    width: 100% !important;
    padding: 15px 24px !important;
    font-size: 15px !important;
  }
}

/* Cart empty - center content */
.woocommerce-cart .cart-empty {
  text-align: center !important;
  padding: 48px 24px !important;
  font-size: 15px !important;
}
.woocommerce-cart p.return-to-shop {
  text-align: center !important;
}
.woocommerce-cart p.return-to-shop a {
  background: #18181b !important;
  color: #fff !important;
  padding: 12px 28px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
}

/* Checkout - better mobile payment options */
@media (max-width: 768px) {
  .woocommerce-checkout #payment {
    border-radius: 12px !important;
    overflow: hidden !important;
  }
  .woocommerce-checkout #payment ul.payment_methods li {
    padding: 14px 16px !important;
  }
  .woocommerce-checkout #payment ul.payment_methods li label {
    font-size: 14px !important;
    font-weight: 600 !important;
  }
}

/* Pcard quick button - ensure visible on mobile */
@media (max-width: 768px) {
  .pcard-quick {
    opacity: 1 !important;
    transform: none !important;
    font-size: 11px !important;
    padding: 8px 10px !important;
  }
}

/* Better footer on mobile */
@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .footer-site-logo {
    margin-bottom: 8px !important;
  }
}

/* ═══ CHECKOUT: Ship to different address always visible ═══ */
#ship-to-different-address,
.woocommerce-shipping-fields,
p.ship-to-different-address-checkbox {
  display: block !important;
}

/* ═══ MOBILE ACCOUNT BUTTON: Clear icon, not text ═══ */
@media (max-width: 600px) {
  /* Show only avatar on mobile, hide text */
  .account-btn .account-name-lbl { display: none !important; }
  .account-btn {
    padding: 6px 8px !important;
    min-width: 36px !important;
    justify-content: center !important;
  }
  /* Hint that account button is tappable */
  .account-btn::after {
    content: '';
    display: block;
    position: absolute;
    inset: -4px;
  }
}

/* ═══ MOBILE NAV: More visible Sign Out link ═══ */
.mob-nav-link[href*="logout"] {
  color: #dc2626 !important;
  font-weight: 700 !important;
  border-top: 1px solid #fee2e2 !important;
  margin-top: 8px !important;
  padding-top: 14px !important;
}

/* ═══════════════════════════════════════════════════════════════════
   v13.4.15 — COMPREHENSIVE MOBILE UX IMPROVEMENTS
   Covers: product cards, checkout, my account, cart, navigation,
   touch targets, back navigation, modals, FABs, typography
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. BACK NAVIGATION — add visible back button on inner pages ── */
@media (max-width: 768px) {
  .nan-back-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    padding: 8px 0;
    margin-bottom: 12px;
  }
  .nan-back-btn::before {
    content: '←';
    font-size: 16px;
  }
}

/* ── 2. TOUCH TARGETS — minimum 44px for all tappable elements ── */
@media (max-width: 768px) {
  .woocommerce-button,
  .woocommerce-Button,
  .button,
  input[type="submit"],
  input[type="button"],
  .checkout-button,
  .single_add_to_cart_button,
  .add_to_cart_button {
    min-height: 44px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  /* Quantity buttons */
  .quantity .plus,
  .quantity .minus {
    width: 44px !important;
    height: 44px !important;
    font-size: 20px !important;
  }

  /* Checkboxes and radios */
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    cursor: pointer;
  }
}

/* ── 3. PRODUCT PAGE — full-width add to cart, better images ── */
@media (max-width: 768px) {
  /* Add to cart always full width */
  .single_add_to_cart_button {
    width: 100% !important;
    font-size: 16px !important;
    padding: 16px !important;
    border-radius: 12px !important;
  }

  /* Product variation selects full width */
  .variations select,
  .variations .nan-swatches {
    width: 100% !important;
  }

  /* Variation label + select layout */
  .variations td.label {
    padding-bottom: 4px !important;
  }

  /* Product tabs full width */
  .ptab-btns {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .ptab-btns::-webkit-scrollbar { display: none; }

  /* Zoom icon bigger touch target */
  .prod-zoom-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 20px !important;
  }
}

/* ── 4. CART PAGE — mobile-friendly layout ── */
@media (max-width: 768px) {
  /* Cart table stacks on mobile */
  .woocommerce-cart-form table,
  .woocommerce-cart-form thead {
    display: none !important;
  }

  .woocommerce-cart-form .cart_item {
    display: flex !important;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0 !important;
    border-bottom: 1px solid #f3f4f6 !important;
  }

  /* Cart item image */
  .woocommerce-cart-form .cart_item .product-thumbnail {
    width: 80px !important;
    flex-shrink: 0;
  }
  .woocommerce-cart-form .cart_item .product-thumbnail img {
    width: 80px !important;
    height: 80px !important;
    object-fit: cover;
    border-radius: 8px;
  }

  /* Cart totals full width */
  .cart-collaterals,
  .woocommerce-cart .cart-collaterals,
  .cart_totals {
    width: 100% !important;
    float: none !important;
  }

  /* Coupon field layout */
  .woocommerce-form-coupon-toggle {
    margin-bottom: 8px !important;
  }

  /* Update cart button */
  .actions .button {
    margin-top: 12px !important;
  }
}

/* ── 5. CHECKOUT — mobile-optimised fields ── */
@media (max-width: 768px) {
  /* Checkout fields full width */
  .woocommerce-billing-fields .form-row,
  .woocommerce-shipping-fields .form-row {
    width: 100% !important;
    float: none !important;
    clear: both !important;
  }

  /* Payment methods better tap target */
  .wc_payment_method label {
    padding: 14px 16px !important;
    border-radius: 10px !important;
    border: 1.5px solid #e4e4e7 !important;
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px !important;
    cursor: pointer;
  }

  /* OTP input — bigger on mobile */
  #nan-otp-input,
  #nan-otp,
  input[name="otp"],
  .nan-otp-input {
    font-size: 22px !important;
    letter-spacing: 8px !important;
    text-align: center !important;
    padding: 16px !important;
  }

  /* Place order button */
  #place_order {
    font-size: 16px !important;
    padding: 18px !important;
    width: 100% !important;
  }
}

/* ── 6. MY ACCOUNT — better mobile layout ── */
@media (max-width: 768px) {
  /* Full-width account layout */
  .nan-ac-layout {
    flex-direction: column !important;
    gap: 0 !important;
  }

  .nan-ac-sidebar {
    position: static !important;
    width: 100% !important;
    margin-bottom: 16px !important;
  }

  .nan-ac-content {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* My Orders table horizontal scroll */
  .woocommerce-orders-table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    font-size: 13px !important;
  }

  /* Order action buttons stack */
  .woocommerce-orders-table__cell-order-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  /* Track order + view + cancel buttons */
  .woocommerce-orders-table .woocommerce-button {
    padding: 7px 12px !important;
    font-size: 12px !important;
    white-space: nowrap;
  }

  /* Account header stats row */
  .nan-ac-header {
    border-radius: 12px !important;
    padding: 20px 16px !important;
  }

  /* Thank you page */
  .nan-thankyou-wrap {
    padding: 0 12px !important;
  }
}

/* ── 7. WHATSAPP + CART FAB — avoid overlapping content ── */
@media (max-width: 768px) {
  /* WhatsApp FAB above cart — original layout */
  #whatsapp-fab,
  .nan-wa-fab,
  .nan-wa-float,
  .wa-wrap {
    bottom: 86px !important;
    right: 18px !important;
  }

  /* Cart FAB at bottom corner */
  .nan-cart-fab {
    bottom: 20px !important;
    right: 20px !important;
  }

  /* Add space at bottom of pages so FABs don't cover last content */
  body {
    padding-bottom: 80px !important;
  }
  .site-footer {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
}

/* ── 8. MODALS — proper mobile sizing ── */
@media (max-width: 600px) {
  /* Track Order modal */
  #nan-track-modal > div,
  .nan-modal-inner {
    padding: 20px 16px !important;
    border-radius: 12px !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Zoom modal nav arrows */
  .nan-zoom-nav {
    width: 40px !important;
    height: 40px !important;
    font-size: 22px !important;
  }
}

/* ── 9. TYPOGRAPHY — readable on small screens ── */
@media (max-width: 480px) {
  /* Product title on listing */
  .pcard-name a {
    font-size: 13px !important;
    -webkit-line-clamp: 2 !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  /* Section headings */
  .sec-title {
    font-size: 22px !important;
  }

  /* Hero headline */
  .hero-h {
    font-size: 28px !important;
    line-height: 1.2 !important;
  }

  /* Breadcrumbs hide on tiny screens */
  .woocommerce-breadcrumb {
    display: none !important;
  }
}

/* ── 10. FORMS — prevent iOS zoom on focus (must be 16px) ── */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ── 11. TABLET (768–1024px) layout improvements ── */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Product grid — 3 columns on tablet */
  .product-grid,
  .pcard-grid,
  .nan-product-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px !important;
  }

  /* Homepage hero */
  .hero-content {
    padding: 48px 32px !important;
  }

  /* Header padding */
  .header-row {
    padding: 0 20px !important;
  }

  /* Single product layout */
  .prod-layout {
    gap: 24px !important;
  }
}

/* ── 12. SAFE AREA (iPhone X notch support) ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    body { padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
    .nan-wa-fab,
    .nan-wa-float,
    .wa-wrap,
    #whatsapp-fab { bottom: calc(86px + env(safe-area-inset-bottom)) !important; }
    .nan-cart-fab { bottom: calc(20px + env(safe-area-inset-bottom)) !important; }
  }
}

/* ═══════════════════════════════════════════════════════════════════
   v13.4.16 — HORIZONTAL SCROLL for key sections on mobile
   Prevents pages from getting too long — sections scroll sideways
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Brand strip — horizontal scroll instead of wrap */
  .brand-strip-inner,
  .nan-brand-strip .brand-strip-inner {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }
  .brand-strip-inner::-webkit-scrollbar { display: none; }

  /* Why-us / feature grid — 2 columns, no horizontal overflow */
  .why-grid,
  .nan-why-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* Stats strip — horizontal scroll */
  .stats-row,
  .nan-stats {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px !important;
  }
  .stats-row::-webkit-scrollbar { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   v13.4.32 — Discount badge clipped on mobile product cards
   The .save-tag was getting cut at the right edge on narrow screens.
   Fix: smaller padding + font on mobile, ensure no overflow.
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .pcard .save-tag {
    font-size: 10px !important;
    padding: 2px 6px !important;
    letter-spacing: 0;
    white-space: nowrap;
  }
  .pcard-actions {
    flex-shrink: 0;
    min-width: 0;
  }
  .pcard-footer {
    gap: 6px;
  }
  .pcard-body {
    padding: 10px 12px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   v13.4.33 — STRONGER fix: discount badge still clipped on mobile.
   Real cause: .price-wrap (with EMI badge) takes too much horizontal
   space, pushing .pcard-actions outside the card boundary.
   Fix: enforce widths so price-wrap shrinks and actions stay visible.
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  /* Make footer flexible — price shrinks, actions hold their space */
  .pcard-footer {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
  }
  .price-wrap {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 56px) !important; /* reserve 56px for actions column */
    overflow: hidden !important;
  }
  .pcard-actions {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 48px !important;
    max-width: 50px !important;
    align-items: flex-end !important;
  }
  /* Price line — keep readable but don't let it expand wildly */
  .price-now {
    font-size: 16px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .price-retail {
    font-size: 10px !important;
    white-space: nowrap;
  }
  /* EMI badge can wrap if needed */
  .pcard-emi {
    font-size: 9.5px !important;
    padding: 2px 5px !important;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Save tag — compact, fits in the 50px actions column */
  .pcard .save-tag {
    font-size: 9.5px !important;
    padding: 2px 5px !important;
    line-height: 1.3 !important;
  }
  /* Add to cart "+" button — keep visible */
  .pcard .add-btn,
  .pcard-actions .add-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    font-size: 18px !important;
    flex-shrink: 0 !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   v13.4.88 — MOBILE SELLABILITY POLISH (mobile-only, additive)
   Web/desktop layout unchanged. Scoped to ≤768px / ≤600px.
   1) Top tagline bar → single line (was wrapping to two)
   2) Master Category landing → products surface faster
   ════════════════════════════════════════════════════════════════ */

/* 1) Top tagline bar → self-running marquee on mobile (was wrapping to two lines).
      Two identical groups sit side-by-side; translating the track by -50% (exactly
      one group width) loops seamlessly. Desktop is untouched (dup hidden, no animation). */
@media (max-width: 768px) {
  .ann-bar {
    overflow: hidden;
    justify-content: flex-start;
    padding-top: 7px;
    padding-bottom: 7px;
  }
  .ann-marquee {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    width: max-content;
    max-width: none;
    animation: nan-ann-scroll 16s linear infinite;
    will-change: transform;
  }
  .ann-group {
    flex-wrap: nowrap;
    padding-right: 24px;        /* even spacing across the loop seam */
  }
  .ann-group-dup { display: flex; }   /* show duplicate so the loop is seamless */
  .ann-bar > b, .ann-group > b,
  .ann-group > .ann-sep,
  .ann-group > .ann-pill { flex: 0 0 auto; white-space: nowrap; }

  @keyframes nan-ann-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }
  /* pause while the user is touching the bar, so they can read it */
  .ann-bar:active .ann-marquee { animation-play-state: paused; }
}

/* Accessibility: if the user prefers reduced motion, stop the auto-scroll
   and fall back to a quiet, swipeable single line instead. */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .ann-marquee {
    animation: none;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .ann-marquee::-webkit-scrollbar { display: none; }
  .ann-group-dup { display: none; }
  .ann-group { padding-right: 0; }
}

/* 2) Master Category landing → less scroll before products on mobile.
      Scoped under .nan-mc-landing so it out-specifies the plugin's
      inline styles regardless of stylesheet load order. */
@media (max-width: 600px) {
  .nan-mc-landing { padding: 14px 0 40px; }

  .nan-mc-landing .nan-mc-lhero { padding: 14px 0 10px; }
  .nan-mc-landing .nan-mc-lhero-title { font-size: 26px; letter-spacing: -.5px; margin-bottom: 6px; }
  .nan-mc-landing .nan-mc-lhero-blurb {
    font-size: 13px; line-height: 1.45; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .nan-mc-landing .nan-mc-lhero-meta { font-size: 12px; }

  /* v13.4.93: cards now sit BELOW the products (reordered, see bottom of file),
     so there's room to show the FULL Unboxed/Grade-A explanation — clean stacked
     cards, no clamp, no accordion. */
  .nan-mc-landing .nan-mc-aware { grid-template-columns: 1fr; gap: 10px; margin: 18px 0 6px; }
  .nan-mc-landing .nan-mc-aware-card { padding: 16px; border-radius: 14px; }
  .nan-mc-landing .nan-mc-aware-badge { font-size: 10px; padding: 3px 9px; margin-bottom: 8px; }
  .nan-mc-landing .nan-mc-aware-title { font-size: 16px; line-height: 1.2; margin-bottom: 6px; }
  .nan-mc-landing .nan-mc-aware-desc { display: block; font-size: 13px; line-height: 1.5; margin: 0 0 8px; }
  .nan-mc-landing .nan-mc-aware-save { font-size: 12.5px; }

  /* filter tabs: tighter + tactile */
  .nan-mc-landing .nan-mc-tabs { margin: 0 0 14px; padding: 5px; }
  .nan-mc-landing .nan-mc-tab { padding: 9px 8px; font-size: 12.5px; transition: transform .12s ease; }
  .nan-mc-landing .nan-mc-tab:active { transform: scale(.97); }

  .nan-mc-landing .nan-mc-grid { gap: 12px; }
}

/* ════════════════════════════════════════════════════════════════
   v13.4.93 — PRODUCTS-FIRST on the master-category landing (web + mobile)
   Pure visual reorder: the page sections are stacked in one .sw container;
   making it a flex column lets us move the Unboxed/Grade-A explainer BELOW
   the product grid via `order`, with NO change to the Master Category plugin.
   So customers see products immediately, then the explainer underneath.
   Applies at all widths. Fully reversible (delete this block).
   ════════════════════════════════════════════════════════════════ */
.nan-mc-landing > .sw {
  display: flex;
  flex-direction: column;
}
.nan-mc-landing > .sw > .nan-mc-lhero    { order: 1; }
.nan-mc-landing > .sw > .nan-mc-tabs     { order: 2; }
.nan-mc-landing > .sw > .nan-mc-grid-wrap{ order: 3; }
.nan-mc-landing > .sw > .nan-tier-sec    { order: 4; }   /* rich homepage explainer (injected by theme JS) */
.nan-mc-landing > .sw > .nan-mc-aware     { display: none; } /* replaced by the rich block above */
.nan-mc-landing > .sw > .nan-mc-trust    { order: 5; }


/* ===== v13.4.94: homepage tier-comparison styles (for the master-category landing) ===== */
/* ═══ v13.4.30 — Premium tier cards (Unboxed vs Grade A) ═══ */
.nan-tier-sec {
  padding: 72px 0;
  background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 100%);
}
.nan-tier-header { text-align: center; margin-bottom: 44px; }
.nan-tier-eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #6366f1;
  background: #eef2ff;
  padding: 6px 14px;
  border-radius: 99px;
  margin-bottom: 16px;
}
.nan-tier-title {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.8px;
  margin: 0 0 10px;
  line-height: 1.15;
}
.nan-tier-sub {
  font-size: 16px;
  color: #64748b;
  margin: 0;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* Grid of cards */
.nan-tier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  max-width: 920px;
  margin: 0 auto;
}

/* Card base */
.nan-tier-card {
  position: relative;
  background: #fff;
  border: 1.5px solid #e4e4e7;
  border-radius: 18px;
  padding: 32px 30px 30px;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  overflow: hidden;
}

/* Subtle inner glow per card */
.nan-tier-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 18px 18px 0 0;
}
.nan-tier-ub::before {
  background: linear-gradient(90deg, #22c55e 0%, #10b981 100%);
}
.nan-tier-ga::before {
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
}

.nan-tier-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, .12);
}
.nan-tier-ub:hover { border-color: #86efac; }
.nan-tier-ga:hover { border-color: #93c5fd; }

/* Ribbon (top-right corner) */
.nan-tier-ribbon {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 99px;
  box-shadow: 0 4px 12px rgba(34, 197, 94, .3);
}
.nan-tier-ribbon-ga {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, .3);
}
.nan-tier-ribbon-icon {
  font-size: 12px;
  line-height: 1;
}

/* Card header */
.nan-tier-card-head {
  margin-bottom: 22px;
  padding-right: 100px; /* leave room for ribbon */
}
.nan-tier-tag-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}
.nan-tier-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255,255,255,1), 0 0 0 5px currentColor;
}
.nan-tier-dot-ub { color: #22c55e; background: #22c55e; }
.nan-tier-dot-ga { color: #3b82f6; background: #3b82f6; }

.nan-tier-name {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  margin: 0;
}
.nan-tier-pitch {
  font-size: 14px;
  color: #64748b;
  line-height: 1.55;
  margin: 0;
}

/* Save block — the visual hero */
.nan-tier-save {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 18px 0;
  margin-bottom: 22px;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}
.nan-tier-save-label {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.nan-tier-save-pct {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1;
  background: linear-gradient(135deg, currentColor 0%, currentColor 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.nan-tier-ub .nan-tier-save-pct {
  background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.nan-tier-ga .nan-tier-save-pct {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.nan-tier-save-suffix {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-left: 2px;
}

/* Feature list */
.nan-tier-features {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  flex: 1;
}
.nan-tier-features li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  align-items: flex-start;
}
.nan-tier-features li + li {
  border-top: 1px solid #f8fafc;
}
.nan-tier-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  margin-top: 1px;
}
.nan-tier-ub .nan-tier-check {
  background: #22c55e;
  box-shadow: 0 2px 6px rgba(34, 197, 94, .25);
}
.nan-tier-ga .nan-tier-check {
  background: #3b82f6;
  box-shadow: 0 2px 6px rgba(59, 130, 246, .25);
}
.nan-tier-features li div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nan-tier-features li strong {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
}
.nan-tier-features li span {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.4;
}

/* CTA button */
.nan-tier-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
  width: 100%;
  box-sizing: border-box;
}
.nan-tier-cta-ub {
  background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
  box-shadow: 0 4px 14px rgba(34, 197, 94, .3);
}
.nan-tier-cta-ub:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(34, 197, 94, .4);
  color: #fff;
}
.nan-tier-cta-ga {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  box-shadow: 0 4px 14px rgba(59, 130, 246, .3);
}
.nan-tier-cta-ga:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, .4);
  color: #fff;
}
.nan-tier-cta-arrow {
  font-size: 17px;
  transition: transform .2s;
}
.nan-tier-cta:hover .nan-tier-cta-arrow {
  transform: translateX(4px);
}

/* Footnote */
.nan-tier-footnote {
  text-align: center;
  margin: 32px 0 0;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}
.nan-tier-footnote span {
  margin-right: 4px;
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
  .nan-tier-sec { padding: 48px 0; }
  .nan-tier-header { margin-bottom: 32px; }
  .nan-tier-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 460px;
  }
  .nan-tier-card { padding: 28px 22px 24px; }
  .nan-tier-ribbon {
    top: 16px;
    right: 16px;
    font-size: 10px;
    padding: 5px 10px;
  }
  .nan-tier-card-head { padding-right: 110px; margin-bottom: 18px; }
  .nan-tier-name { font-size: 21px; }
  .nan-tier-pitch { font-size: 13.5px; }
  .nan-tier-save { padding: 16px 0; margin-bottom: 18px; }
  .nan-tier-save-pct { font-size: 30px; }
  .nan-tier-features { margin-bottom: 22px; }
  .nan-tier-features li strong { font-size: 13.5px; }
  .nan-tier-features li span { font-size: 12px; }
  .nan-tier-cta { padding: 13px 18px; font-size: 14.5px; }
  .nan-tier-footnote { font-size: 12px; padding: 0 12px; line-height: 1.55; }
}

/* ─── Very small phones ─── */
@media (max-width: 380px) {
  .nan-tier-card-head { padding-right: 0; padding-top: 36px; }
  .nan-tier-ribbon { top: 14px; right: 14px; }
}

/* ════════════════════════════════════════════════════════════════
   v13.4.94 — Rich Unboxed-vs-Grade-A explainer on the master-category
   landing page. Same component as the homepage (.nan-tier-*), injected
   below the products by theme JS. Plugin untouched.
   Landing override: render as a contained rounded panel (it sits inside
   the page's .sw, so it isn't full-bleed like the homepage hero section). */
.nan-mc-landing .nan-tier-sec {
  padding: 36px 26px 30px;
  margin: 30px 0 6px;
  border-radius: 22px;
  border: 1px solid #ececef;
}
.nan-mc-landing .nan-tier-header { margin-bottom: 30px; }
@media (max-width: 768px) {
  .nan-mc-landing .nan-tier-sec { padding: 26px 16px 22px; margin: 22px 0 4px; border-radius: 18px; }
  .nan-mc-landing .nan-tier-header { margin-bottom: 22px; }
}

/* ============================================================
   Mobile hamburger — slide-in drawer redesign (v13.6.4)
   Pairs with the iOS-safe scroll lock in main.js.
   ============================================================ */
@media (max-width: 900px) {
  .site-header{
    -webkit-backdrop-filter:none !important;
    backdrop-filter:none !important;
    background:#fff !important;
  }
  #mob-nav{
    display:block !important;
    position:fixed !important;
    top:0; left:0; bottom:0;
    height:100vh; height:100dvh;
    width:86%; max-width:340px;
    margin:0; padding:8px 0 48px;
    background:#fff;
    z-index:1000;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    transform:translateX(-100%);
    transition:transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow:6px 0 32px rgba(0,0,0,.16);
    border:0;
  }
  #mob-nav.is-open{ transform:translateX(0); }
  #mob-nav .mob-nav-link,
  #mob-nav .mob-nav-btn{ padding:15px 22px; font-size:15px; }
  #mob-nav .mob-sub a{ padding:12px 22px 12px 40px; font-size:13.5px; }
  #mob-nav .mob-sub-label{ padding:12px 22px 6px 40px; }
  #mob-nav .mob-nav-search{ padding:6px 16px 10px; }
}
