/* =========================================================
   TUCANO VERDE — Layout (header, nav, menus, drawers, age
   gate, footer)
   =========================================================
   Nota de manutenção (bug já visto antes, não reintroduzir):
   elemento que usa o atributo HTML `hidden` via JS SEMPRE usa
   `.classe:not([hidden]) { display: ... }` aqui — nunca
   `.classe { display: ... }` puro, porque isso vence o `hidden`
   na cascata. Drawers/menus/busca abaixo por isso NÃO usam
   `hidden`: usam a classe `.is-open` com opacity/transform, que
   não tem esse problema.
   Também: nunca `overflow-x: hidden` em html/body — quebra
   `position: sticky` do header em vários navegadores.
   ========================================================= */

.topbar {
  background: var(--color-ink);
  color: var(--color-neon);
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 9px var(--space-4);
}
.topbar strong { color: #fff; }

/* ---- Header ---- */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-3);
}
.header__logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark { width: 40px; height: 40px; color: var(--color-primary); }
.logo-mark svg { width: 100%; height: 100%; }
.header__logo-text { display: flex; flex-direction: column; line-height: 1.1; font-family: var(--font-display); }
.header__logo-text b { font-size: 1.05rem; color: var(--color-primary-dark); }
.header__logo-text span { font-size: 0.68rem; color: var(--color-text-muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

.header__search { flex: 1; display: none; max-width: 480px; }
@media (min-width: 992px) { .header__search { display: block; } }
.header__search-form {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 10px var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  text-align: left;
}
.header__search-placeholder { font-size: 0.9rem; }

.header__actions { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.header__action {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  color: var(--color-primary-dark);
}
.header__action:hover { background: var(--color-surface-alt); }
.header__action svg { width: 21px; height: 21px; }
.header__action-label { display: none; font-size: 0.65rem; font-weight: 600; }
@media (min-width: 1200px) { .header__action-label { display: block; } }
.header__count {
  position: absolute;
  top: 0;
  right: 2px;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.header__action[data-open-menu] { display: flex; }
@media (min-width: 992px) { .header__action[data-open-menu] { display: none !important; } }

/* ---- Nav (categorias) ---- */
.nav { background: var(--color-primary-dark); display: none; }
@media (min-width: 992px) { .nav { display: block; } }
.nav__list { display: flex; align-items: center; gap: var(--space-5); overflow-x: auto; }
.nav__link {
  display: inline-block;
  padding: 12px 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(255,255,255,0.82);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav__link:hover, .nav__link.is-active { color: #fff; border-color: var(--color-accent); }
.nav__link--sale { color: var(--color-neon); }

/* ---- Menu mobile ---- */
.mobile-menu { position: fixed; inset: 0; z-index: var(--z-drawer); visibility: hidden; }
.mobile-menu__backdrop {
  position: absolute; inset: 0;
  background: rgba(10,12,10,0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.mobile-menu__panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: min(320px, 86vw);
  background: var(--color-surface);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  box-shadow: var(--shadow-lg);
}
.mobile-menu.is-open { visibility: visible; }
.mobile-menu.is-open .mobile-menu__backdrop { opacity: 1; }
.mobile-menu.is-open .mobile-menu__panel { transform: none; }
.mobile-menu__head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4); border-bottom: 1px solid var(--color-border); }
.mobile-menu__list { flex: 1; overflow-y: auto; padding: var(--space-2) 0; }
.mobile-menu__link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px var(--space-4);
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}
.mobile-menu__link svg { width: 16px; height: 16px; color: var(--color-text-muted); }
.mobile-menu__link--sale { color: var(--color-danger); }
.mobile-menu__foot { padding: var(--space-4); border-top: 1px solid var(--color-border); }
.mobile-menu__foot p { margin-bottom: var(--space-2); font-size: 0.85rem; color: var(--color-text-muted); }

/* ---- Busca ---- */
.search-overlay {
  position: fixed; inset: 0; z-index: var(--z-drawer);
  background: rgba(10,12,10,0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh var(--space-4) var(--space-4);
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease;
}
.search-overlay.is-open { opacity: 1; visibility: visible; }
.search-overlay__panel {
  width: min(640px, 100%);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-lg);
  transform: translateY(-12px);
  transition: transform 0.2s ease;
}
.search-overlay.is-open .search-overlay__panel { transform: none; }
.search-overlay__form { display: flex; align-items: center; gap: var(--space-3); border-bottom: 2px solid var(--color-border); padding-bottom: var(--space-3); }
.search-overlay__form input { flex: 1; border: none; outline: none; font-size: 1.1rem; background: none; }
.search-overlay__hint { margin-top: var(--space-3); font-size: 0.8rem; color: var(--color-text-muted); }
.search-overlay__results { margin-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); max-height: 50vh; overflow-y: auto; }
.search-result {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-md);
}
.search-result:hover { background: var(--color-surface-alt); }
.search-result__thumb { width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--color-surface-alt); flex-shrink: 0; }
.search-result__thumb svg, .search-result__thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.search-result__name { font-weight: 600; font-size: 0.9rem; }
.search-result__price { font-size: 0.8rem; color: var(--color-text-muted); }
.search-empty { padding: var(--space-4); text-align: center; color: var(--color-text-muted); font-size: 0.9rem; }

/* ---- Carrinho (drawer) ---- */
.cart-drawer { position: fixed; inset: 0; z-index: var(--z-drawer); visibility: hidden; }
.cart-drawer__backdrop { position: absolute; inset: 0; background: rgba(10,12,10,0.55); opacity: 0; transition: opacity 0.25s ease; }
.cart-drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(400px, 92vw);
  background: var(--color-surface);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  box-shadow: var(--shadow-lg);
}
.cart-drawer.is-open { visibility: visible; }
.cart-drawer.is-open .cart-drawer__backdrop { opacity: 1; }
.cart-drawer.is-open .cart-drawer__panel { transform: none; }
.cart-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4); border-bottom: 1px solid var(--color-border); }
.cart-drawer__head h3 { display: flex; align-items: center; gap: var(--space-2); font-size: 1rem; }
.cart-drawer__items { flex: 1; overflow-y: auto; padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.cart-drawer__foot { padding: var(--space-4); border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: var(--space-2); }
.cart-drawer__subtotal { display: flex; justify-content: space-between; font-family: var(--font-display); font-weight: 700; margin-bottom: var(--space-2); }
.cart-drawer__note { font-size: 0.75rem; color: var(--color-text-muted); text-align: center; margin-top: var(--space-1); }
.cart-drawer__empty { text-align: center; color: var(--color-text-muted); padding: var(--space-7) var(--space-4); }

/* ---- Age gate ---- */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: var(--z-age-gate);
  background: var(--color-ink);
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
/* Ver nota do topo do arquivo — precisa do :not([hidden]) */
.age-gate:not([hidden]) { display: flex; }

.age-gate__card {
  width: min(440px, 100%);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.age-gate__mark { width: 56px; height: 56px; margin: 0 auto var(--space-4); color: var(--color-primary); }
.age-gate__mark svg { width: 100%; height: 100%; }
.age-gate__card h2 { margin-bottom: var(--space-3); }
.age-gate__card p { color: var(--color-text-muted); margin-bottom: var(--space-5); }
.age-gate__actions { display: flex; gap: var(--space-3); margin-bottom: var(--space-5); }
.age-gate__legal { font-size: 0.75rem; color: var(--color-text-muted); margin-bottom: 0; }
.age-gate__blocked svg, .age-gate__blocked [data-icon] { width: 40px; height: 40px; margin: 0 auto var(--space-3); color: var(--color-danger); }
.age-gate__blocked h2 { margin-bottom: var(--space-3); }
.age-gate__blocked p { color: var(--color-text-muted); }

/* ---- Breadcrumb ---- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--color-text-muted); padding-block: var(--space-4); flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb__sep { opacity: 0.5; }
.breadcrumb__current { color: var(--color-text); font-weight: 600; }

/* ---- Footer ---- */
.footer { background: var(--color-primary-dark); color: var(--color-text-on-dark); margin-top: var(--space-8); }
.footer__top { padding-block: var(--space-8); }
.footer__grid { display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer__grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer__brand-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.1rem; margin-bottom: var(--space-3); }
.footer__brand-logo .logo-mark { color: var(--color-accent); }
.footer__brand p { color: var(--color-text-on-dark-muted); font-size: 0.9rem; max-width: 34ch; margin-bottom: var(--space-4); }
.footer__social { display: flex; gap: var(--space-2); }
.footer__social a {
  width: 38px; height: 38px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
}
.footer__social a:hover { background: var(--color-accent); color: var(--color-ink); }
.footer__social svg { width: 18px; height: 18px; }
.footer__col h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-3); }
.footer__col ul { display: flex; flex-direction: column; gap: 10px; }
.footer__col a { color: var(--color-text-on-dark-muted); font-size: 0.9rem; }
.footer__col a:hover { color: var(--color-accent); }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-block: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-2);
  font-size: 0.78rem; color: var(--color-text-on-dark-muted);
}

.whatsapp-float {
  position: fixed; right: var(--space-4); bottom: var(--space-4);
  width: 56px; height: 56px; border-radius: var(--radius-full);
  background: #25d366; color: #0b3b1f;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 60;
}
.whatsapp-float svg { width: 26px; height: 26px; }

.back-to-top {
  position: fixed; right: var(--space-4); bottom: calc(var(--space-4) + 68px);
  width: 42px; height: 42px; border-radius: var(--radius-full);
  background: var(--color-ink); color: var(--color-neon);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 60;
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top svg { width: 18px; height: 18px; }
