/**
 * 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;
  }
}
