/* ============================================================
   MOBILE CSS — The House of Brownies & Blondies
   Loaded on all pages after style.css.
   Every rule is scoped inside @media (max-width: 860px) so
   the desktop layout in style.css is completely untouched.
   ============================================================ */

@media (max-width: 860px) {

  /* ─────────────────────────────────────────────────────────
     GLOBAL
  ───────────────────────────────────────────────────────── */

  :root {
    --section-py: clamp(52px, 11vw, 76px);
    --section-px: 20px;
    --nav-h: 60px; /* mobile nav-inner is 60px, not 81px */
  }

  /* Reserve space at the bottom for the fixed nav bar */
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ─────────────────────────────────────────────────────────
     DESKTOP NAV — hide entirely on mobile
  ───────────────────────────────────────────────────────── */

  .nav-links,
  .nav-order-btn,
  .nav-employee-btn,
  .hamburger {
    display: none !important;
  }

  #mainNav {
    background: rgba(253, 248, 240, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
  }

  .nav-inner {
    padding: 0 20px;
    justify-content: center;
    min-height: 60px;
    height: 60px;
  }

  /* ─────────────────────────────────────────────────────────
     MOBILE BOTTOM NAVIGATION BAR — Revamped
  ───────────────────────────────────────────────────────── */

  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(68px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(251, 247, 238, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1.5px solid rgba(201, 116, 65, 0.2);
    box-shadow: 0 -4px 24px rgba(45, 30, 20, 0.1);
    z-index: 900;
    align-items: stretch;
  }

  /* Main content tabs share space equally */
  .mobile-nav-tab {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: #b0998a;
    font-family: var(--font-body);
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 4px 6px;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }

  .mobile-nav-tab span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1;
  }

  /* Icon */
  .mobile-nav-tab svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke-width: 1.7;
    transition: transform 0.28s cubic-bezier(.34, 1.56, .64, 1), color 0.2s ease;
  }

  /* Top active indicator bar — animates in from center */
  .mobile-nav-tab::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 28px;
    height: 3px;
    background: var(--clay);
    border-radius: 0 0 4px 4px;
    transition: transform 0.28s cubic-bezier(.34, 1.56, .64, 1);
    transform-origin: center;
  }

  /* Active state */
  .mobile-nav-tab.is-active {
    color: var(--clay);
  }

  .mobile-nav-tab.is-active::before {
    transform: translateX(-50%) scaleX(1);
  }

  .mobile-nav-tab.is-active svg {
    transform: translateY(-2px) scale(1.1);
  }

  /* Remove old bottom pip */
  .mobile-nav-tab::after,
  .mobile-nav-tab.is-active::after {
    display: none !important;
  }

  /* Press feedback */
  .mobile-nav-tab:active svg {
    transform: scale(0.88) !important;
    transition-duration: 0.1s;
  }

  /* Login tab — visually separated from content tabs */
  .mobile-nav-tab[href*="internal_tools"] {
    flex: 0 0 58px;
    border-left: 1px solid rgba(201, 116, 65, 0.15);
    font-size: 8px;
    color: #c4a898;
  }

  /* Login tab should not show the active indicator */
  .mobile-nav-tab[href*="internal_tools"]::before {
    display: none;
  }

  /* ─────────────────────────────────────────────────────────
     MOBILE STICKY ORDER CTA
  ───────────────────────────────────────────────────────── */

  .mobile-sticky-cta {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    z-index: 880;
    background: var(--clay);
    color: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    padding: 13px 28px;
    border-radius: 100px;
    box-shadow: 0 4px 22px rgba(201, 116, 65, 0.45),
                0 1px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s ease;
  }

  .mobile-sticky-cta.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  .mobile-sticky-cta:active {
    transform: translateX(-50%) scale(0.96) !important;
  }

  /* ─────────────────────────────────────────────────────────
     HERO
  ───────────────────────────────────────────────────────── */

  .hero {
    min-height: 0 !important;
    overflow: visible;
  }

  .hero-grid {
    display: flex !important;
    flex-direction: column;
    min-height: 0;
  }

  /* Image on top */
  .hero-image {
    order: 1;
    position: relative !important;
    inset: auto !important;
    aspect-ratio: 4 / 3;
    background: var(--cream-deep);
    min-height: 0;
    width: 100%;
  }

  .hero-slide {
    object-fit: cover;
    object-position: right center; /* trims ~30% from the left edge */
    width: 100%;
    height: 100%;
  }

  .hero-image::after { display: none; }
  .hero-stamp { display: none !important; }

  /* Collapse the grid so no empty space remains after hiding hero-content */
  .hero-grid {
    grid-template-rows: auto !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* Hide hero text content on mobile — image only */
  .hero .hero-content,
  .hero-grid .hero-content {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }

  /* ─────────────────────────────────────────────────────────
     TRUST STRIP — 2×2 grid
  ───────────────────────────────────────────────────────── */

  .trust-strip {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0 !important;
    padding: 0 !important;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
  }

  /* Remove divider spans from grid flow entirely */
  .trust-strip .trust-divider {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    visibility: hidden !important;
  }

  /* Use nth-of-type (counts only <div>s, ignores <span> dividers) */
  .trust-item {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center;
    gap: 8px !important;
    padding: 20px 14px !important;
    text-align: center;
    font-size: 11.5px !important;
    white-space: normal !important;
    border-right: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
  }

  /* Right column — no right border */
  .trust-item:nth-of-type(even) { border-right: none; }

  /* Bottom row — no bottom border */
  .trust-item:nth-of-type(n+3) { border-bottom: none; }

  .trust-icon-circle {
    width: 44px;
    height: 44px;
  }

  .trust-label {
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.3;
  }

  /* ─────────────────────────────────────────────────────────
     PRODUCTS — horizontal snap-scroll carousel
  ───────────────────────────────────────────────────────── */

  .products-section {
    padding: var(--section-py) 0 !important;
  }

  .section-head {
    padding: 0 20px 4px;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px;
    margin-bottom: 20px;
  }

  .products-wrap { overflow: hidden; }

  .products-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px !important;
    padding: 4px 20px 20px !important;
    margin: 0 !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .products-grid::-webkit-scrollbar { display: none; }

  .products-grid > .product-card {
    flex: 0 0 76vw !important;
    max-width: 300px;
    scroll-snap-align: start;
    border-radius: 18px;
  }

  /* Give the last card a right-margin so it scrolls fully into view */
  .products-grid > .product-card:last-child { margin-right: 20px; }

  /* Hide desktop prev/next arrows */
  .products-arrows { display: none !important; }
  .products-nav { display: none !important; }

  /* Scroll-hint — fade on the right edge to hint at more content */
  .products-wrap::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, var(--cream));
    pointer-events: none;
  }

  .products-wrap { position: relative; }

  /* ─────────────────────────────────────────────────────────
     OUR STORY
  ───────────────────────────────────────────────────────── */

  .story-section {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    padding: var(--section-py) 20px !important;
  }

  .story-images {
    order: -1;
    position: static !important;
    aspect-ratio: auto !important; /* override the desktop 4/5 ratio */
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .story-img-accent {
    display: none !important;
    position: absolute !important;
    visibility: hidden !important;
  }

  .story-img-main {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;      /* override desktop height: 100% */
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 20px;
    margin: 0 !important;
  }

  .story-content { text-align: left; }
  .story-lead { font-size: 15.5px; line-height: 1.75; }

  .story-sig {
    font-size: 14.5px;
    margin-top: 24px;
  }

  /* ─────────────────────────────────────────────────────────
     HOW WE BAKE
  ───────────────────────────────────────────────────────── */

  .process-section {
    padding: calc(var(--section-py) + 36px) 20px var(--section-py) !important;
  }

  .process-wave { height: 36px; }

  .process-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .process-step {
    padding: 22px 20px;
    border-radius: 16px;
  }

  .process-step:not(:last-child)::after { display: none; }

  /* ─────────────────────────────────────────────────────────
     TESTIMONIALS
  ───────────────────────────────────────────────────────── */

  .testimonials-section {
    padding: var(--section-py) 20px !important;
  }

  .testi-header { margin-bottom: 28px; }

  /* Google Reviews bar — let it wrap naturally on small screens */
  .testi-gbar {
    padding: 14px 18px !important;
    gap: 8px 12px !important;
    margin-bottom: 24px !important;
  }

  .testi-gbar-spacer { display: none; }   /* button wraps below on mobile */
  .testi-review-btn  { width: 100%; justify-content: center; }
  .testi-rating-num  { font-size: 20px; }

  /* Carousel — 1 card per view; % width from style.css handles sizing */
  .testi-card { padding: 20px 16px !important; min-width: 0 !important; max-width: none !important; }
  .testi-carousel-outer { gap: 8px !important; }
  .testi-scroller { overflow-y: hidden !important; }
  .testi-text { font-size: 14.5px; line-height: 1.7; }

  /* ─────────────────────────────────────────────────────────
     PROMO SECTION
  ───────────────────────────────────────────────────────── */

  .promo-inner {
    grid-template-columns: 1fr !important;
  }

  .promo-image { aspect-ratio: 16 / 9; }

  .promo-content {
    padding: 28px 22px !important;
    border-radius: 0 0 20px 20px;
  }

  /* ─────────────────────────────────────────────────────────
     CONTACT / NEWSLETTER
  ───────────────────────────────────────────────────────── */

  .newsletter-section {
    padding: var(--section-py) 16px !important;
  }

  .newsletter-inner {
    grid-template-columns: 1fr !important;
    padding: 32px 22px !important;
    border-radius: 22px;
    gap: 28px !important;
  }

  #contact-heading {
    font-size: clamp(20px, 6.5vw, 30px) !important;
    white-space: normal !important;
    line-height: 1.25;
  }

  .newsletter-inner > div > p {
    font-size: 14px !important;
    margin-top: 14px !important;
  }

  .contact-details { margin-top: 20px; gap: 10px; }
  .contact-item { font-size: 13px; gap: 12px; }

  .newsletter-form {
    flex-direction: column !important;
    padding: 10px !important;
    border-radius: 14px;
    gap: 8px;
    align-items: stretch !important;
  }

  .newsletter-input { padding: 13px 16px; font-size: 15px; }
  .newsletter-form .btn-primary { padding: 13px 20px; text-align: center; }
  .newsletter-note { text-align: left !important; }

  /* ─────────────────────────────────────────────────────────
     FOOTER
  ───────────────────────────────────────────────────────── */

  footer {
    padding: 80px 20px 28px !important;
  }

  .footer-wave { height: 40px; }

  .footer-top {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    padding-bottom: 28px !important;
  }

  .footer-brand { max-width: 100%; }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-legal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 18px;
  }

  /* ─────────────────────────────────────────────────────────
     WHATSAPP BUTTON — nudge left on mobile so it doesn't
     overlap the bottom nav. Tooltip hidden on mobile.
  ───────────────────────────────────────────────────────── */

  .whatsapp-float {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 80px) !important;
    right: 16px;
    width: 50px;
    height: 50px;
  }

  .whatsapp-float::before { display: none; }

  /* ─────────────────────────────────────────────────────────
     PRESS MARQUEE
  ───────────────────────────────────────────────────────── */

  .press-marquee {
    padding: 14px 0;
    font-size: 12px;
  }

}

/* ─────────────────────────────────────────────────────────
   Landscape phone — prevent content overflow when rotated
───────────────────────────────────────────────────────── */
@media (max-width: 860px) and (orientation: landscape) and (max-height: 500px) {
  .hero { min-height: 0 !important; }
  .hero-grid { min-height: 0; }
  .hero-image { aspect-ratio: 16 / 9; }
  .hero-content { padding: 24px 20px 36px; }
}
