/* TH Store V9.2 — acabamento mobile-first. Carregado depois das folhas anteriores.
   Não altera regras de negócio, pedidos, autenticação ou configurações do Supabase. */
:root { --th-mobile-rail:34px; --th-mobile-nav:68px; }
html { -webkit-text-size-adjust:100%; scroll-padding-top:90px; }
button, a, input, select, textarea { -webkit-tap-highlight-color:transparent; }

/* Mobile é o design de referência; o desktop mantém o layout V9.1. */
@media (max-width:767px) {
  *, *::before, *::after { box-sizing:border-box; }
  html, body { max-width:100%; overflow-x:clip; }
  body { padding-bottom:calc(var(--th-mobile-nav) + env(safe-area-inset-bottom, 0px)); }
  .app-shell { width:100%; max-width:100%; overflow-x:clip; }

  /* Barra de posicionamento da marca e cabeçalho com só três zonas: menu / logo / sacola */
  .top-rail { position:relative; display:flex; height:var(--th-mobile-rail); min-height:var(--th-mobile-rail); padding:0 12px; align-items:center; justify-content:center; background:#101011; }
  .top-rail__inner { min-height:0; padding:0; width:100%; justify-content:center; }
  .top-rail strong { font-size:10px; letter-spacing:.16em; font-weight:700; white-space:nowrap; max-width:none; text-align:center; }
  .top-rail__eyebrow, .top-rail__mid, .top-rail__cta { display:none!important; }
  .header, .header.scrolled { position:absolute; top:var(--th-mobile-rail); right:0; left:0; margin:0; width:100%; height:68px; padding:0 16px; display:grid; grid-template-columns:48px minmax(0,1fr) 48px; align-items:center; gap:0; background:transparent; color:#fff; border:0; border-radius:0; box-shadow:none; backdrop-filter:none; z-index:45; }
  .header.scrolled { position:fixed; top:8px; left:10px; right:10px; width:calc(100% - 20px); height:60px; padding:0 10px; border-radius:14px; border:1px solid rgba(255,255,255,.16); background:rgba(16,16,17,.95); backdrop-filter:blur(18px); box-shadow:0 8px 28px #0004; }
  .header #menuOpen { grid-column:1; grid-row:1; justify-self:start; }
  .header .brand { grid-column:2; grid-row:1; justify-self:center; min-width:0; width:max-content; max-width:100%; margin:0; }
  .header .brand-mark { font-size:28px; }
  .header .brand-sub { font-size:6px; }
  .header .header-actions { grid-column:3; grid-row:1; justify-self:end; gap:0; margin:0; }
  .header .v9-account-trigger, .header .search-icon { display:none!important; }
  .header .icon-btn { flex:0 0 auto; width:42px; height:42px; border:1px solid rgba(255,255,255,.7); }
  .header #menuOpen { display:flex; flex-direction:column; align-items:center; justify-content:center; }
  .header .count-badge { width:18px; height:18px; font-size:10px; }

  /* Uma única mensagem editorial curta, legível sem atravessar toda a fotografia */
  .hero { height:calc(100svh - var(--th-mobile-rail) - var(--th-mobile-nav)); min-height:510px; max-height:760px; width:100%; margin:0; overflow:hidden; isolation:isolate; }
  .hero-video, .hero-media-shape { inset:0; width:100%; height:100%; object-fit:cover; object-position:50% 39%; transform:none; }
  .hero-overlay { z-index:1; background:linear-gradient(180deg,rgba(0,0,0,.49) 0%,rgba(0,0,0,.01) 27%,rgba(0,0,0,.16) 44%,rgba(0,0,0,.78) 75%,rgba(0,0,0,.96) 100%); }
  .hero-content { position:absolute; z-index:3; left:20px; right:20px; width:auto; max-width:none; bottom:29px; padding:0; }
  .hero-badge { display:none; }
  .hero .kicker { font-size:9px; letter-spacing:.18em; color:#e9c86f; margin:0 0 12px; }
  .hero h1 { font-size:clamp(34px, 9.3vw, 49px); letter-spacing:-.055em; line-height:.99; max-width:520px; margin:0 0 14px; text-wrap:balance; }
  .hero h1 .th-desktop-title { display:none; }
  .hero h1 .th-mobile-title { display:block; }
  .hero h1 em { color:#e7c062; }
  .hero-copy { font-size:12px; font-weight:400; line-height:1.55; max-width:290px; margin:0; color:rgba(255,255,255,.88); }
  .hero-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:19px; }
  .hero-actions .btn { width:100%; min-width:0; min-height:46px; padding:10px 8px; border-radius:5px; font-size:9px; line-height:1.3; letter-spacing:.04em; white-space:normal; }
  .hero-strip, .hero-scroll, .hero-side-label { display:none!important; }

  /* Somente 5 atalhos no rodapé. A sacola permanece no topo. */
  .mobile-nav { position:fixed; display:grid; grid-template-columns:repeat(5, minmax(0,1fr)); grid-template-rows:var(--th-mobile-nav); left:0; right:0; bottom:0; width:100%; height:calc(var(--th-mobile-nav) + env(safe-area-inset-bottom, 0px)); padding:0 5px env(safe-area-inset-bottom, 0px); gap:0; overflow:hidden; background:#0e0e10; border-top:1px solid #2a2a2b; box-shadow:0 -6px 22px #0003; z-index:110; }
  .mobile-nav #mobileCart { display:none!important; }
  .mobile-nav > button { display:flex; flex-direction:column; justify-content:center; align-items:center; min-width:0; min-height:0; width:100%; padding:5px 0 3px; gap:5px; border:none; flex:auto; color:#aaa; }
  .mobile-nav svg { display:block; width:23px; height:23px; stroke-width:1.7; }
  .mobile-nav small { font-size:10px; line-height:1.15; font-weight:500; white-space:nowrap; letter-spacing:0; }
  .mobile-nav button.active { color:#f2c862; }
  .whatsapp-float { z-index:65; width:45px; height:45px; bottom:calc(var(--th-mobile-nav) + 17px + env(safe-area-inset-bottom, 0px)); right:14px; box-shadow:0 6px 24px #0004; }
  .whatsapp-float svg { width:23px; height:23px; }
  .v9-sticky-cta { bottom:calc(var(--th-mobile-nav) + 18px + env(safe-area-inset-bottom, 0px)); }
  .drawer { bottom:calc(var(--th-mobile-nav) + env(safe-area-inset-bottom, 0px)); }
  .v9-panel-scroll { padding-bottom:calc(80px + env(safe-area-inset-bottom,0px)); }

  /* Seções reais: tipografia enxuta, produtos com boa área de toque e filtros sem cortes */
  .section, .product-section, .brand-section { padding:46px 16px; }
  .section-head h2 { font-size:clamp(29px,8vw,39px); line-height:1.04; letter-spacing:-.045em; }
  .section-intro { font-size:12px; line-height:1.6; max-width:330px; }
  .category-grid { margin-right:-16px; padding-right:16px; scroll-padding-left:16px; }
  .category-card { min-width:76vw; height:360px; min-height:0; }
  .category-card h3 { font-size:25px; }
  .product-section .section-head { padding:0; }
  .section-tabs { max-width:100%; min-width:0; }
  .v9-filterbar { grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; min-width:0; padding:12px; gap:10px; }
  .v9-filterbar label { min-width:0; font-size:9px; letter-spacing:.07em; }
  .v9-filterbar label:first-child { grid-column:1/-1; }
  .v9-filterbar input, .v9-filterbar select { max-width:100%; height:44px; font-size:13px; }
  .v9-filter-actions { grid-column:1/-1; }
  .v9-filter-actions button { min-height:42px; }
  .product-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; }
  .product-card { min-width:0; }
  .product-info { padding:10px 2px; }
  .product-name { font-size:12px; line-height:1.35; }
  .price { font-size:14px; }
  .quick-btn { min-height:37px; font-size:9px; }
  .v9-lifestyle-section .visual { min-height:250px; }
  .v9-lifestyle-section .text { padding:30px 20px 36px; }
  .v9-lifestyle-section .text h2 { font-size:clamp(32px,9vw,45px); line-height:1; }
  .v9-editorial-line { padding:13px 10px; text-align:center; }
  .visit-section { margin-inline:12px; }
  .visit-photo { min-height:290px; }
  .visit-content { padding:30px 20px 35px; }
  .visit-content h2 { font-size:clamp(42px,12vw,59px); }
  .footer { padding-bottom:20px; }
  .modal { padding:0; }
  .modal-card { max-height:calc(100svh - var(--th-mobile-nav) - 14px); border-radius:13px 13px 0 0; }
  .modal-visual .modal-image { height:min(40svh,340px); }
  .modal-visual .modal-image img, .modal-visual .modal-image video { height:100%; max-height:100%; }
}
/* Telefones estreitos: títulos e CTA não podem estourar. */
@media (max-width:359px) {
  .header, .header.scrolled { padding-inline:11px; }
  .hero-content { left:15px; right:15px; bottom:20px; }
  .hero h1 { font-size:clamp(30px,9.2vw,34px); }
  .hero-copy { font-size:11px; }
  .hero-actions { gap:7px; }
  .hero-actions .btn { font-size:8px; padding:8px 5px; }
  .mobile-nav small { font-size:9px; }
  .section, .product-section { padding-inline:12px; }
}
/* Landscape / telas de pouca altura: não forçar hero maior que a tela disponível */
@media (max-width:767px) and (max-height:650px) {
  .hero { min-height:0; height:max(460px, calc(100svh - var(--th-mobile-rail) - var(--th-mobile-nav))); }
  .hero-content { bottom:20px; }
  .hero .kicker { margin-bottom:8px; }
  .hero h1 { margin-bottom:8px; font-size:clamp(30px,8.7vw,40px); }
  .hero-copy { font-size:11px; }
  .hero-actions { margin-top:12px; }
}
/* A tipografia longa é mantida apenas na experiência desktop. */
@media (min-width:768px) {
  .hero h1 .th-mobile-title { display:none; }
  .hero h1 .th-desktop-title { display:inline; }
}
@media (prefers-reduced-motion:reduce) {
  .hero-video { animation:none; }
}

/* TH STORE V9.3 — correção dos cabeçalhos mobile.
   A folha V6 antiga mantinha align-items:flex-end nos .section-head:
   como os filhos têm largura de conteúdo, alguns títulos começavam
   no meio da viewport. O layout agora usa 100% da largura disponível. */
@media (max-width:767px) {
  .section-head {
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-start;
    width:100%;
    max-width:100%;
    gap:13px;
    text-align:center;
  }
  .section-head > div {
    display:block;
    width:100%;
    min-width:0;
    max-width:100%;
    margin:0;
    text-align:center;
  }
  .section-head .eyebrow {
    display:block;
    width:100%;
    text-align:center;
  }
  .section-head h2 {
    display:block;
    width:100%;
    min-width:0;
    max-width:100%;
    margin:8px auto 0;
    padding:0;
    font-size:clamp(26px,7.5vw,37px);
    line-height:1.1;
    letter-spacing:-.045em;
    text-align:center;
    white-space:normal;
    overflow-wrap:break-word;
    text-wrap:balance;
  }
  .section-head .section-intro {
    max-width:36ch;
    margin-inline:auto;
    text-align:center;
  }
  .section-head .text-link {
    align-self:center;
    width:max-content;
    max-width:100%;
    margin-inline:auto;
    text-align:center;
    white-space:normal;
  }
  /* A área de reels não possui padding à direita devido ao carrossel.
     Compensamos somente no cabeçalho para preservar a centralização. */
  .reels-section .section-head {
    padding-left:0;
    padding-right:16px;
  }
  .instagram-section .section-head { padding-inline:0; }
}
