/* ============================================================
   STYLE-MOBILE.CSS — Tocha Padaria home-v2  v2
   Purely additive. Desktop is never touched.
   All rules live inside max-width breakpoints or
   apply only to mobile-only elements.
   ============================================================ */

/* ──────────────────────────────────────────────
   HAMBURGER BUTTON
   ────────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 44px; height: 44px;
  cursor: pointer;
  align-items: center; justify-content: center; flex-direction: column;
  gap: 5px; padding: 0; flex-shrink: 0;
  transition: border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.nav-hamburger:hover { border-color: var(--border-hover); }
.ham-line {
  width: 18px; height: 1.5px;
  background: var(--text-muted);
  border-radius: 2px; display: block;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-hamburger.open .ham-line:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open .ham-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open .ham-line:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ──────────────────────────────────────────────
   COUNTDOWN-MOBILE (hidden on desktop)
   ────────────────────────────────────────────── */
#countdown-mobile {
  display: none;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ──────────────────────────────────────────────
   STEP ICON (hidden on desktop, shown on mobile)
   ────────────────────────────────────────────── */
.step-icon { display: none; }

/* ──────────────────────────────────────────────
   MOBILE NAV MENU
   ────────────────────────────────────────────── */
#mobile-nav {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200; pointer-events: none;
}
#mobile-nav.open { pointer-events: auto; }
#mobile-nav[aria-hidden="true"]  { visibility: hidden; }
#mobile-nav.open,
#mobile-nav[aria-hidden="false"] { visibility: visible; }

.mobile-nav-overlay {
  position: absolute; inset: 0;
  background: oklch(0% 0 0 / 0.72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.25s ease;
}
#mobile-nav.open .mobile-nav-overlay { opacity: 1; }

.mobile-nav-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(300px, 82vw);
  background: oklch(13% 0.02 48);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#mobile-nav.open .mobile-nav-panel { transform: translateX(0); }

.mobile-nav-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0;
}
.mobile-nav-logo { height: 44px; width: auto; display: block; filter: brightness(1.1); }
.mobile-nav-close {
  width: 44px; height: 44px; background: none;
  border: 1px solid var(--border); border-radius: 50%;
  color: var(--text-muted); font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all var(--t-fast); -webkit-tap-highlight-color: transparent;
}
.mobile-nav-close:active { border-color: var(--border-hover); color: var(--text); }

.mobile-nav-links {
  padding: 20px 16px; display: flex; flex-direction: column; gap: 2px; flex: 1;
}
.mobile-nav-link {
  display: flex; align-items: center; padding: 14px 16px;
  border-radius: var(--radius-sm); color: var(--text-muted);
  text-decoration: none; font-size: 15px; font-weight: 500; min-height: 52px;
  transition: background var(--t-fast), color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-link:active { background: var(--bg2); color: var(--amber); }

.mobile-nav-footer {
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-subtle); flex-shrink: 0;
}
.mobile-nav-cart-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 20px; background: var(--amber); color: oklch(12% 0.018 50);
  border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700;
  font-family: var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; width: 100%; min-height: 52px; transition: background var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-cart-btn:active { background: var(--amber-bright); }
.mobile-nav-badge {
  background: oklch(12% 0.018 50); color: var(--amber); border-radius: 50%;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; line-height: 1;
}
.mobile-nav-badge[data-count="0"] { display: none; }

/* ──────────────────────────────────────────────
   MOBILE STICKY CTA (hidden on desktop)
   ────────────────────────────────────────────── */
#mobile-sticky-cta { display: none; }

/* ──────────────────────────────────────────────
   900px — hamburger visible
   ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-hamburger { display: flex; }
  #navbar { padding: 0 16px; }
}

/* ──────────────────────────────────────────────
   768px — full mobile layer
   ────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* ── Announcement bar ──────────────────────── */
  #announcement-bar { padding: 0 16px; }
  .announcement-inner { flex-wrap: nowrap; justify-content: center; gap: 0; }
  /* Hide everything except the mobile combined counter */
  .announcement-inner > *:not(#countdown-mobile) { display: none !important; }
  #countdown-mobile { display: inline !important; }

  /* ── Navbar ──────────────────────────────── */
  #navbar { height: 56px; }

  /* ── Hero ────────────────────────────────── */
  #hero {
    min-height: 88vh;
    padding-top: 16px;
    padding-bottom: 64px;
    align-items: flex-end;
  }
  .hero-content { padding-right: 16px; }
  .hero-tag { font-size: 10px; margin-bottom: 14px; padding: 5px 12px; }
  .hero-h1 {
    font-size: clamp(36px, 9.5vw, 52px);
    margin-bottom: 14px; line-height: 1.05;
  }
  .hero-desc {
    font-size: 15px; line-height: 1.6;
    margin-bottom: 28px; max-width: 100%;
  }
  .hero-actions { flex-direction: column; gap: 10px; }
  .btn-primary,
  .btn-outline {
    width: 100%; justify-content: center;
    padding: 15px 24px; min-height: 52px; font-size: 14px;
  }
  .scroll-indicator { display: none; }

  /* ── Mobile sticky CTA bar ───────────────── */
  #mobile-sticky-cta {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 95;
    background: oklch(12% 0.018 50 / 0.96);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 10px; align-items: center;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
  }
  #mobile-sticky-cta.visible { transform: translateY(0); pointer-events: auto; }
  .sticky-cta-menu {
    flex: 1; display: flex; align-items: center; justify-content: center;
    background: var(--amber); color: oklch(12% 0.018 50);
    text-decoration: none; font-size: 13px; font-weight: 700;
    font-family: var(--font-sans); letter-spacing: 0.07em; text-transform: uppercase;
    padding: 13px 20px; border-radius: var(--radius-sm); min-height: 48px;
    -webkit-tap-highlight-color: transparent; transition: background var(--t-fast);
  }
  .sticky-cta-menu:active { background: var(--amber-bright); }
  .sticky-cta-cart {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 16px; background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); font-size: 14px;
    font-weight: 700; font-family: var(--font-sans); cursor: pointer;
    min-height: 48px; min-width: 68px; flex-shrink: 0;
    -webkit-tap-highlight-color: transparent; transition: all var(--t-fast);
  }
  .sticky-cta-cart:active { background: var(--bg3); }

  /* ═══════════════════════════════════════════
     HOW IT WORKS — 2-column grid, altura uniforme
     ═══════════════════════════════════════════ */
  #como-funciona { padding: 48px 0 40px; scroll-margin-top: 48px; }
  .how-header { margin-bottom: 24px; }
  .how-h2 { font-size: 28px; margin-bottom: 10px; }
  .how-desc { font-size: 13px; line-height: 1.55; }

  /* Steps: 2 colunas com altura uniforme */
  .steps-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    align-items: stretch !important;
    overflow: visible !important;
    scroll-snap-type: unset !important;
    -webkit-overflow-scrolling: unset !important;
    gap: 10px;
    padding: 0;
    margin-bottom: 20px;
  }
  .step-wrap {
    flex: unset !important;
    max-width: unset !important;
    scroll-snap-align: unset !important;
    height: 100%;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .step-card {
    height: 100%;
    padding: 16px 14px;
  }
  .step-num { width: 38px; height: 38px; font-size: 14px; }
  .step-label-text { font-size: 10px; }
  .step-icon { display: block; font-size: 28px; line-height: 1; margin: 10px 0 4px; }
  .step-title { font-size: 15px; margin-top: 6px; margin-bottom: 0; }
  .step-desc {
    font-size: 12px; margin-top: 6px; max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .step-meta { padding-top: 10px; font-size: 10px; margin-top: auto; }

  /* Info cards (retirada + politica) — compact */
  .info-grid { gap: 10px; }
  .info-card { padding: 16px 14px; }
  .retirada-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px;
  }
  .info-item-title { font-size: 12px; margin-bottom: 3px; }
  .info-item-desc { font-size: 11px; line-height: 1.5; max-width: 100%; }
  .politica-title { font-size: 13px; margin-bottom: 6px; }
  .politica-desc { font-size: 11px; line-height: 1.5; }
  .info-label { font-size: 10px; margin-bottom: 10px; }

  /* ═══════════════════════════════════════════
     MENU SECTION
     ═══════════════════════════════════════════ */
  #menu { padding: 48px 0 56px; scroll-margin-top: 48px; }
  .menu-header {
    margin-bottom: 20px;
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
    position: relative;
    z-index: 20;
  }
  .menu-h2 { font-size: clamp(18px, 5vw, 26px); }
  .menu-search-wrap { width: 40%; min-width: unset; flex-shrink: 0; }
  .menu-search { font-size: 16px !important; } /* prevents iOS auto-zoom on tap */

  /* Category: dropdown substitui nav lateral no mobile */
  .cat-dropdown-wrap {
    display: block !important;
    position: relative;
    margin-bottom: 16px;
    z-index: 10;
  }
  .cat-dropdown-heading {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    margin-bottom: 6px;
  }
  .cat-dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: oklch(16% 0.02 48);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    min-height: 40px;
    text-align: left;
    transition: border-color var(--t-fast);
    -webkit-tap-highlight-color: transparent;
  }
  .cat-dropdown-wrap.open .cat-dropdown-btn { border-color: var(--amber); }
  .cat-dropdown-arrow {
    color: var(--text-dim);
    font-size: 11px;
    flex-shrink: 0;
    margin-left: 8px;
    transition: transform 0.2s ease;
  }
  .cat-dropdown-wrap.open .cat-dropdown-arrow { transform: rotate(180deg); }
  .cat-dropdown-list {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0; right: 0;
    background: oklch(16% 0.02 48);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 20px oklch(0% 0 0 / 0.4);
    overflow: hidden;
  }
  .cat-dropdown-wrap.open .cat-dropdown-list { display: block; }
  .cat-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid oklch(18% 0.02 48);
    color: var(--text-muted);
    font-size: 13px;
    font-family: var(--font-sans);
    cursor: pointer;
    min-height: 40px;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
  }
  .cat-dropdown-item:last-child { border-bottom: none; }
  .cat-dropdown-item:active { background: oklch(20% 0.025 48); }
  .cat-dropdown-item.active {
    color: var(--amber);
    background: oklch(72% 0.12 60 / 0.07);
  }
  .cat-dropdown-icon { font-size: 16px; line-height: 1; }
  .cat-dropdown-name { flex: 1; }
  .cat-dropdown-count { font-size: 11px; color: var(--text-dim); }
  .cat-dropdown-item.active .cat-dropdown-count { color: oklch(72% 0.12 60 / 0.6); }

  /* Products: 2-column grid */
  .menu-layout { gap: 0; }
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  /* Compact product cards */
  .card-body { padding: 8px 9px 10px; gap: 5px; }
  .card-name { font-size: 13px; line-height: 1.2; }
  .card-price { font-size: 13px; }
  .card-desc {
    font-size: 11px; line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .card-actions { gap: 5px; margin-top: 2px; }
  .products-header { margin-bottom: 16px; padding-bottom: 14px; }
  .products-cat-name { font-size: 22px; }
  .products-cat-icon { font-size: 22px; }
  .products-cat-desc { font-size: 13px; }

  /* Touch targets — layout vertical garante "Adicionar" visível em qualquer tela */
  .card-actions { flex-direction: column; gap: 4px; margin-top: 4px; }
  .qty-ctrl { width: 100%; justify-content: center; }
  .qty-btn { min-height: 40px; font-size: 17px; }
  .add-btn { min-height: 44px; font-size: 11px; letter-spacing: 0.04em; padding: 0 8px; }
  .ci-btn { width: 40px; height: 40px; }
  .cart-btn { min-height: 44px; padding: 10px 14px; }

  /* ═══════════════════════════════════════════
     INSTAGRAM
     ═══════════════════════════════════════════ */
  .instagram-section { padding: 48px 0; }
  .instagram-header { margin-bottom: 20px; }
  .instagram-h2 { font-size: clamp(24px, 6vw, 36px); }
  .instagram-grid { gap: 8px; margin-bottom: 28px; }
  .btn-ig { padding: 12px 24px; font-size: 12px; }

  /* ═══════════════════════════════════════════
     FOODSERVICE
     ═══════════════════════════════════════════ */
  #foodservice { padding: 48px 0; scroll-margin-top: 48px; }
  .fs-img-grid { max-width: 100%; aspect-ratio: auto; }
  .fs-h2 { font-size: 28px; letter-spacing: 0; }
  .fs-desc { font-size: 13px; margin-bottom: 20px; line-height: 1.65; }
  .btn-fs { min-width: unset; width: 100%; padding: 15px 24px; min-height: 52px; }
  .fs-label { margin-bottom: 10px; }

  /* ═══════════════════════════════════════════
     FOOTER
     ═══════════════════════════════════════════ */
  footer { padding: 40px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .footer-grid { gap: 24px; margin-bottom: 32px; }
  .footer-tagline { font-size: 13px; max-width: 100%; }
  .footer-copy { font-size: 11px; }

  /* ═══════════════════════════════════════════
     CART DRAWER — bottom sheet on mobile
     ═══════════════════════════════════════════ */
  #cart-drawer {
    align-items: flex-end; /* sheet anchors to bottom */
  }
  .drawer-panel {
    width: 100%;
    height: 100vh;
    height: 100dvh; /* dynamic viewport — survives mobile browser chrome resize */
    max-height: none;
    border-radius: 0;
    border-left: none;
    border-top: none;
    box-shadow: 0 -8px 48px oklch(0% 0 0 / 0.5);
    transform: translateY(100%);
    display: flex;
    flex-direction: column;
  }
  .drawer-panel::before { display: none; } /* no drag handle on full-height sheet */
  #cart-drawer.open .drawer-panel { transform: translateY(0); }

  /* Resumo strip compacto */
  .drawer-summary { padding: 6px 16px 8px; font-size: 11px; gap: 6px; }

  /* Fixed header / tabs — scrollable body — fixed footer */
  .drawer-header { flex-shrink: 0; padding: 14px 16px 0; }
  .drawer-tabs   { flex-shrink: 0; padding: 0 16px; margin-top: 8px; }
  .drawer-footer { flex-shrink: 0; }
  .drawer-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 12px 16px;
  }
  .drawer-title { font-size: 18px; }
  .drawer-close { width: 36px; height: 36px; font-size: 18px; }

  /* Compact cart items */
  .cart-item { padding: 8px 0; gap: 10px; }
  .cart-item-img { width: 44px; height: 44px; border-radius: 6px; }
  .cart-item-img-placeholder { width: 44px; height: 44px; font-size: 18px; }
  .cart-item-name { font-size: 13px; }
  .cart-item-price { font-size: 12px; }
  .ci-btn { width: 36px; height: 36px; }
  .cart-fornada-info { margin-top: 12px; padding: 10px 12px; }
  .cart-fornada-info p { font-size: 12px; }

  /* Drawer footer compact + safe area */
  .drawer-footer {
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .cart-total-label { font-size: 13px; }
  .cart-total-value { font-size: 18px; }
  .btn-goto-checkout { padding: 14px; font-size: 14px; }
  .btn-clear-cart { padding: 8px; font-size: 12px; }

  /* ── Early capture modal — safe area ── */
  .modal-sheet {
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  }

  /* ── WhatsApp: above sticky CTA bar ── */
  #whatsapp-btn {
    width: 52px; height: 52px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    left: 16px;
  }

  /* ── Historia section ── */
  .historia-upper { padding: 56px 0 40px; }
  .historia-h2 { font-size: 30px; }
  .historia-desc { font-size: 14px; }
}

/* ──────────────────────────────────────────────
   480px — extra-small screens
   ────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Hero */
  .hero-h1 { font-size: clamp(32px, 9vw, 44px); }

  /* How it works: 2-col mantido em telas pequenas */
  .step-wrap { flex: unset; max-width: unset; }

  /* Keep 2-col product grid even on small screens */
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .card-body { padding: 7px 8px 9px; }
  .card-name { font-size: 12px; }
  .card-price { font-size: 12px; }

  /* Historia */
  .historia-milestones { grid-template-columns: 1fr; }

  /* Reduz leve oversizing típico do Android Chrome em telas pequenas */
  body { font-size: 15px; }
}
