/* =====================================================================
   BAKERS ROUTE — MOBILE APP EXPERIENCE
   Applies on screens ≤ 767 px
   ===================================================================== */

/* Default-hide mobile-only elements (shown via media query below) */
.mobile-bottom-nav  { display: none; }
.mobile-ticker      { display: none; }
.mobile-more-overlay { display: none; }
.mobile-more-sheet  { display: none; }
.mob-cart-btn       { display: none; }

/* =====================================================================
   CORE MOBILE STYLES
   ===================================================================== */
@media (max-width: 767px) {

  /* ── Variables ── */
  :root {
    --bnav-h:   62px;
    --safe-b:   env(safe-area-inset-bottom, 0px);
    --header-h: 76px;
  }

  /* ── Base ── */
  html { -webkit-text-size-adjust: 100%; }
  body {
    padding-bottom: calc(var(--bnav-h) + var(--safe-b));
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
  }
  * { -webkit-overflow-scrolling: touch; }

  /* ── Hide desktop topbar ── */
  .topbar { display: none !important; }

  /* ─────────────────────────────────────────────
     SCROLLING PROMO TICKER
  ───────────────────────────────────────────── */
  .mobile-ticker {
    display: none !important;
  }
  .mobile-ticker-track {
    display: flex;
    gap: 52px;
    white-space: nowrap;
    animation: mTickerScroll 24s linear infinite;
    padding-left: 20px;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.92);
    font-weight: 500;
    align-items: center;
    height: 100%;
  }
  .mobile-ticker-track span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
  }
  .mobile-ticker-track i { color: var(--gold-light); font-size: 0.65rem; }
  @keyframes mTickerScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
  }

  /* ─────────────────────────────────────────────
     HEADER — COMPACT, CENTERED LOGO
  ───────────────────────────────────────────── */
  .header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000;
  }
  .header-inner {
    height: var(--header-h) !important;
    padding: 0 10px !important;
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
  }

  /* Logo: centered in header only */
  .header-inner .logo {
    position: absolute !important;
    left: 50% !important; top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    z-index: 1;
  }
  .logo-img { height: 68px !important; }
  .logo-fallback .logo-main { font-size: 1rem !important; }
  .logo-fallback .logo-sub  { font-size: 0.52rem !important; }
  .logo-fallback .logo-icon { width: 36px !important; height: 36px !important; font-size: 1rem !important; }

  /* Old nav hamburger no longer needed — the ☰ categories menu button covers it */
  .hamburger { display: none !important; }

  /* Header right side: just the account/login icon */
  .header-actions {
    gap: 4px !important;
    position: relative;
    z-index: 2;
    display: flex !important;
    align-items: center !important;
  }
  .icon-btn { width: 42px !important; height: 42px !important; font-size: 1.1rem !important; }

  /* Hide search & regular cart on mobile — mob-cart-btn is used instead; only login/account stays on the right */
  .icon-btn[aria-label="Search"]  { display: none !important; }
  .icon-btn[aria-label="Cart"]    { display: none !important; }

  .hdr-reward-wrap       { display: none !important; }
  .header-social-divider { display: none !important; }
  .hdr-order-btn         { display: none !important; }

  /* Cart icon injected into header */
  .mob-cart-btn {
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
    color: var(--text);
    transition: background 0.2s;
    position: relative;
    text-decoration: none;
    flex-shrink: 0;
  }
  .mob-cart-btn:hover { background: var(--cream); color: var(--teal); }
  .mob-cart-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: var(--gold);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    width: 15px; height: 15px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  .mob-cart-badge.show { display: flex; }

  /* ─────────────────────────────────────────────
     HERO — FULL-SCREEN APP FEEL
  ───────────────────────────────────────────── */
  .hero {
    height: calc(100svh - var(--header-h)) !important;
    min-height: 420px !important;
  }
  .hero-content {
    padding: 0 22px !important;
    text-align: center !important;
    max-width: 100% !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }
  .hero-tag      { font-size: 0.68rem !important; letter-spacing: 2px !important; }
  .hero-content h1 { font-size: 2rem !important; line-height: 1.18 !important; }
  .hero-desc     { font-size: 0.88rem !important; line-height: 1.6 !important; margin-bottom: 22px !important; }
  .hero-btns     { justify-content: center !important; gap: 10px !important; }
  .hero-btns .btn { padding: 12px 22px !important; font-size: 0.85rem !important; }
  .hero-prev     { left: 10px !important; width: 34px !important; height: 34px !important; font-size: 0.75rem !important; }
  .hero-next     { right: 10px !important; width: 34px !important; height: 34px !important; font-size: 0.75rem !important; }
  .hero-dots     { bottom: 16px !important; }
  .dot           { width: 6px !important; height: 6px !important; }
  .dot.active    { width: 18px !important; }

  /* ─────────────────────────────────────────────
     PROMO STRIP — HORIZONTAL SCROLL
  ───────────────────────────────────────────── */
  .promo-strip {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    gap: 0 !important;
  }
  .promo-strip::-webkit-scrollbar { display: none; }
  .promo-card {
    scroll-snap-align: start;
    flex: 0 0 68vw !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 12px 16px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.07) !important;
  }
  .promo-card > i { font-size: 1.2rem !important; }
  .promo-card strong { font-size: 0.78rem !important; }
  .promo-card span   { font-size: 0.7rem !important; }

  /* ─────────────────────────────────────────────
     SECTIONS
  ───────────────────────────────────────────── */
  .section         { padding: 40px 0 !important; }
  .section-header  { margin-bottom: 18px !important; }
  .section-header h2 { font-size: 1.45rem !important; }
  .section-sub     { font-size: 0.85rem !important; }
  .container       { padding: 0 14px !important; }

  /* ─────────────────────────────────────────────
     CATEGORY GRID — HORIZONTAL SNAP SCROLL
  ───────────────────────────────────────────── */
  .category-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    gap: 10px !important;
    padding: 4px 14px 14px !important;
    margin: 0 -14px !important;
    scrollbar-width: none;
    grid-template-columns: unset !important;
    grid-template-rows: unset !important;
  }
  .category-grid::-webkit-scrollbar { display: none; }
  .cat-card {
    scroll-snap-align: start;
    flex: 0 0 62vw !important;
    height: 175px !important;
    border-radius: 18px !important;
    grid-column: unset !important;
    grid-row: unset !important;
  }
  .cat-card.cat-large {
    flex: 0 0 72vw !important;
    height: 195px !important;
  }
  .cat-overlay h3              { font-size: 0.95rem !important; }
  .cat-overlay p               { font-size: 0.72rem !important; }
  .cat-card.cat-large .cat-overlay h3 { font-size: 1.25rem !important; }
  .cat-card.cat-large .cat-overlay p  { font-size: 0.82rem !important; }

  /* ─────────────────────────────────────────────
     PRODUCT GRID
  ───────────────────────────────────────────── */
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .product-card    { border-radius: 14px !important; }
  .product-info    { padding: 10px !important; }
  .product-info h3 { font-size: 0.76rem !important; line-height: 1.3 !important; }
  .product-price   { font-size: 0.88rem !important; }
  .product-price-old { font-size: 0.72rem !important; }
  .product-badge   { font-size: 0.56rem !important; padding: 2px 7px !important; top: 8px !important; left: 8px !important; }
  .product-rating  { margin-bottom: 6px !important; }
  .product-rating .stars { font-size: 0.65rem !important; }
  .product-rating span   { font-size: 0.65rem !important; }
  .whatsapp-order-btn    { width: 32px !important; height: 32px !important; font-size: 0.95rem !important; }
  .ig-order-btn          { width: 32px !important; height: 32px !important; font-size: 0.9rem !important; }
  .x-order-btn           { width: 32px !important; height: 32px !important; font-size: 0.9rem !important; }
  .product-footer        { gap: 6px !important; }
  .product-variant-select { font-size: 0.72rem !important; padding: 5px 8px !important; }

  /* ─────────────────────────────────────────────
     WHY SECTION — HORIZONTAL SNAP SCROLL
  ───────────────────────────────────────────── */
  .why-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    gap: 12px !important;
    padding: 4px 14px 14px !important;
    margin: 0 -14px !important;
    scrollbar-width: none;
    grid-template-columns: unset !important;
  }
  .why-grid::-webkit-scrollbar { display: none; }
  .why-card {
    scroll-snap-align: start;
    flex: 0 0 68vw !important;
    padding: 22px 18px !important;
    border-radius: 18px !important;
  }
  .why-icon  { width: 52px !important; height: 52px !important; font-size: 1.2rem !important; margin-bottom: 14px !important; }
  .why-card h3 { font-size: 0.88rem !important; }
  .why-card p  { font-size: 0.8rem !important; }

  /* ─────────────────────────────────────────────
     OCCASION GRID — HORIZONTAL SNAP SCROLL
  ───────────────────────────────────────────── */
  .occasion-grid {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    gap: 8px !important;
    padding: 4px 14px 14px !important;
    margin: 0 -14px !important;
    scrollbar-width: none;
    justify-content: flex-start !important;
  }
  .occasion-grid::-webkit-scrollbar { display: none; }
  .occ-card {
    scroll-snap-align: start;
    flex: 0 0 auto !important;
    min-width: 78px;
    padding: 14px 10px !important;
    border-radius: 16px !important;
    font-size: 0.72rem !important;
  }
  .occ-card i { font-size: 1.4rem !important; }

  /* ─────────────────────────────────────────────
     CUSTOM BANNER
  ───────────────────────────────────────────── */
  .custom-banner         { padding: 44px 20px !important; }
  .custom-banner h2      { font-size: 1.55rem !important; }
  .custom-banner p       { font-size: 0.88rem !important; margin-bottom: 20px !important; }

  /* ─────────────────────────────────────────────
     TESTIMONIALS
  ───────────────────────────────────────────── */
  .testimonial-card {
    flex: 0 0 80vw !important;
    padding: 16px !important;
    gap: 12px !important;
  }
  .tc-left     { width: 76px !important; }
  .tc-avatar   { width: 76px !important; height: 76px !important; }
  .tc-stars-left i { font-size: 0.8rem !important; }
  .testimonial-card p { font-size: 0.8rem !important; margin-bottom: 8px !important; }
  .tc-name  { font-size: 0.8rem !important; }
  .tc-role  { font-size: 0.7rem !important; }
  .testimonial-controls button { width: 38px !important; height: 38px !important; }

  /* ─────────────────────────────────────────────
     GALLERY
  ───────────────────────────────────────────── */
  .gallery-grid { gap: 6px !important; }
  .gallery-item { flex: 0 0 calc((100% - 2 * 6px) / 2) !important; }

  /* ─────────────────────────────────────────────
     INSTAGRAM REELS
  ───────────────────────────────────────────── */
  .insta-reels-grid { grid-template-columns: 1fr !important; }

  /* ─────────────────────────────────────────────
     NEWSLETTER
  ───────────────────────────────────────────── */
  .newsletter-section  { padding: 36px 16px !important; }
  .newsletter-inner    { flex-direction: column !important; text-align: center !important; gap: 18px !important; }
  .newsletter-text h2  { font-size: 1.35rem !important; }
  .newsletter-text p   { font-size: 0.85rem !important; }
  .newsletter-form     { flex-direction: column !important; gap: 10px !important; }
  .newsletter-form input { min-width: 0 !important; width: 100% !important; }
  .newsletter-form .btn-primary { width: 100% !important; justify-content: center !important; }

  /* ─────────────────────────────────────────────
     FOOTER
  ───────────────────────────────────────────── */
  .footer          { padding-top: 32px !important; }
  .footer-grid     { grid-template-columns: 1fr !important; gap: 22px !important; }
  .footer-brand .logo-img { height: 80px !important; }
  .footer-about    { font-size: 0.82rem !important; max-width: 100% !important; }
  .footer-col h4   { font-size: 0.66rem !important; margin-bottom: 12px !important; }
  .footer-col ul li a { font-size: 0.82rem !important; }
  .footer-bottom   { flex-direction: column !important; text-align: center !important; gap: 10px !important; padding: 16px 0 !important; }
  .payment-icons   { justify-content: center !important; }
  .footer-map-wrap { height: 110px !important; }
  .fssai-badge     { padding: 8px 14px !important; gap: 10px !important; }
  .fssai-logo-img  { height: 30px !important; }

  /* ─────────────────────────────────────────────
     FLOATING BUTTONS — ABOVE BOTTOM NAV
  ───────────────────────────────────────────── */
  .whatsapp-float {
    bottom: calc(var(--bnav-h) + var(--safe-b) + 14px) !important;
    right: 16px !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 1.45rem !important;
  }
  .social-float-stack {
    bottom: calc(var(--bnav-h) + var(--safe-b) + 14px) !important;
    right: 16px !important;
    gap: 10px !important;
  }
  .toast {
    bottom: calc(var(--bnav-h) + var(--safe-b) + 10px) !important;
    right: 12px !important;
    left: 12px !important;
    font-size: 0.8rem !important;
    padding: 12px 16px !important;
  }

  /* ─────────────────────────────────────────────
     PRODUCTS PAGE
  ───────────────────────────────────────────── */
  .page-hero { padding: 32px 16px !important; }
  .page-hero h1 { font-size: 1.65rem !important; }
  .page-hero p  { font-size: 0.85rem !important; }
  .breadcrumb   { font-size: 0.75rem !important; }
  .products-layout {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 20px 0 !important;
  }
  .sidebar { display: none; }
  .sidebar.open { display: block; }
  .products-toolbar { padding: 10px 12px !important; }
  .products-toolbar select { font-size: 0.8rem !important; padding: 6px 10px !important; }
  .results-count { font-size: 0.78rem !important; }

  /* Category pills: horizontal scroll */
  .category-pills {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scrollbar-width: none;
    padding-bottom: 4px;
    gap: 6px !important;
  }
  .category-pills::-webkit-scrollbar { display: none; }
  .pill { flex-shrink: 0 !important; padding: 7px 14px !important; font-size: 0.78rem !important; }

  /* ─────────────────────────────────────────────
     CART PAGE
  ───────────────────────────────────────────── */
  .cart-layout {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 20px 0 !important;
  }
  .order-summary    { position: static !important; }
  .cart-item-img    { width: 76px !important; height: 76px !important; }
  .cart-item-details h3 { font-size: 0.85rem !important; }

  /* ─────────────────────────────────────────────
     MOBILE NAV DRAWER IMPROVEMENTS
  ───────────────────────────────────────────── */
  .nav.mobile-open {
    width: 82vw !important;
    max-width: 310px !important;
    padding: 16px !important;
    border-radius: 0 20px 20px 0;
  }
  .nav-list          { margin-top: 68px !important; }
  .nav-item > a      { font-size: 0.92rem !important; padding: 13px 8px !important; }
  .dropdown-col a    { font-size: 0.82rem !important; }
  .dropdown-col h4   { font-size: 0.62rem !important; }

  /* ─────────────────────────────────────────────
     TOUCH FEEDBACK
  ───────────────────────────────────────────── */
  .btn:active          { transform: scale(0.95) !important; transition: transform 0.1s !important; }
  .occ-card:active     { transform: scale(0.93) !important; transition: transform 0.1s !important; }
  .cat-card:active     { transform: scale(0.97) !important; transition: transform 0.1s !important; }
  .product-card:active { transform: scale(0.97) !important; transition: transform 0.1s !important; }
  .why-card:active     { transform: scale(0.97) !important; transition: transform 0.1s !important; }

  /* Remove hover animations on touch (keeps layout stable) */
  @media (hover: none) {
    .product-card:hover  { transform: none !important; box-shadow: 0 2px 12px rgba(22,168,192,0.08) !important; }
    .why-card:hover      { transform: none !important; border-bottom-color: transparent !important; }
    .btn-primary:hover   { transform: none !important; box-shadow: none !important; }
    .btn-gold:hover      { transform: none !important; }
    .occ-card:hover      {
      background: var(--cream) !important; color: var(--text) !important;
      border-color: var(--border) !important; transform: none !important; box-shadow: none !important;
    }
    .occ-card:hover i    { color: var(--teal) !important; }
    .cat-card:hover .cat-img { transform: none !important; }
    .gallery-item:hover .gallery-overlay { opacity: 0 !important; }
  }

  /* ─────────────────────────────────────────────
     BOTTOM NAVIGATION BAR
  ───────────────────────────────────────────── */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(var(--bnav-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: #fff;
    border-top: 1.5px solid var(--border);
    z-index: 1001;
    box-shadow: 0 -4px 24px rgba(22,168,192,0.12);
    align-items: stretch;
  }
  .mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #8cb4bb;
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: color 0.18s;
    position: relative;
    padding: 6px 0 4px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
  }
  .mbn-item i { font-size: 1.2rem; transition: transform 0.2s, color 0.18s; display: block; }
  .mbn-item span { display: block; line-height: 1; }

  .mbn-item.active { color: var(--teal); }
  .mbn-item.active i { transform: translateY(-1px); }
  .mbn-item.active::after {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 28px; height: 3px;
    background: var(--teal);
    border-radius: 0 0 4px 4px;
  }
  .mbn-item:active { opacity: 0.55; }

  /* Cart badge on bottom nav */
  .mbn-badge {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(4px);
    background: var(--gold);
    color: #fff;
    font-size: 0.5rem;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    padding: 0 3px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1.5px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  }
  .mbn-badge.show { display: flex !important; }

  /* ─────────────────────────────────────────────
     MORE BOTTOM SHEET
  ───────────────────────────────────────────── */
  .mobile-more-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1002;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
  .mobile-more-overlay.open { display: block; }

  .mobile-more-sheet {
    display: block;
    position: fixed;
    left: 0; right: 0;
    bottom: calc(var(--bnav-h) + var(--safe-b));
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 0 18px 24px;
    z-index: 1003;
    box-shadow: 0 -8px 48px rgba(0,0,0,0.18);
    /* Push fully off-screen: own height + bottom nav height */
    transform: translateY(calc(100% + var(--bnav-h) + var(--safe-b)));
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 75vh;
    overflow-y: auto;
  }
  .mobile-more-sheet.open { transform: translateY(0); }

  .mms-handle {
    width: 40px; height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 14px auto 18px;
  }
  .mms-section-label {
    font-size: 0.62rem; font-weight: 700; letter-spacing: 1.6px;
    text-transform: uppercase; color: var(--gold);
    margin-bottom: 12px;
  }
  .mms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 18px;
  }
  .mms-item {
    display: flex; flex-direction: column;
    align-items: center; gap: 5px;
    padding: 13px 6px 10px;
    border-radius: 14px;
    background: var(--cream);
    color: var(--text);
    font-size: 0.6rem; font-weight: 700;
    text-align: center; text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    border: none; cursor: pointer; font-family: inherit;
    text-transform: uppercase; letter-spacing: 0.3px;
    -webkit-tap-highlight-color: transparent;
  }
  .mms-item i { font-size: 1.2rem; color: var(--teal); display: block; margin-bottom: 2px; }
  .mms-item:active { background: var(--cream-dark); transform: scale(0.92); }

  .mms-divider {
    height: 1px; background: var(--border);
    margin: 12px 0 16px;
  }

} /* end @media 767px */

/* ─────────────────────────────────────────────
   VERY SMALL SCREENS
───────────────────────────────────────────── */
@media (max-width: 360px) {
  .mms-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .product-grid { grid-template-columns: 1fr !important; }
  .cat-card { flex: 0 0 78vw !important; }
  .hero-content h1 { font-size: 1.7rem !important; }
}
