/* ═══════════════════════════════════════════════════════════════════
   Layout global: anúncio, header, busca, menus, carrinho, rodapé
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────────── Barra de anúncio ─────────────── */
.announce {
  position: relative;
  z-index: 41;
  height: 36px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 88%, #000), var(--brand), color-mix(in srgb, var(--brand) 88%, #000));
  color: var(--on-brand);
  font-size: 13px;
  font-weight: 500;
}

.announce__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.announce__track {
  position: relative;
  flex: 1;
  height: 100%;
}

.announce__msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
}

.announce__msg.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

a.announce__msg:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.announce__close {
  position: absolute;
  right: calc(var(--gutter) - 8px);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  opacity: 0.8;
}

.announce__close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.14);
}

/* ─────────────── Header ─────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.25s;
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--header-h);
  transition: height 0.25s var(--ease);
}

.header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.header.is-scrolled .header__inner {
  height: calc(var(--header-h) - 12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand__mark {
  filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--brand) 45%, transparent));
  transition: transform 0.3s var(--ease);
}

.brand:hover .brand__mark {
  transform: rotate(-6deg) scale(1.04);
}

.brand__img {
  height: 40px;
  width: auto;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand__kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.brand__name {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header__menu {
  margin-left: -8px;
}

.nav {
  display: none;
  align-items: center;
  gap: 2px;
  margin-left: 20px;
}

.nav__item {
  position: relative;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14.5px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.nav__link:hover,
.nav__item--mega:hover > .nav__link,
.nav__item--mega.is-open > .nav__link {
  color: var(--text);
  background: var(--surface-2);
}

.nav__link.is-active {
  color: var(--text);
}

.nav__link.is-active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

.nav__link {
  position: relative;
}

.nav__chev {
  transition: transform 0.2s var(--ease);
}

.nav__item--mega:hover .nav__chev,
.nav__item--mega.is-open .nav__chev {
  transform: rotate(180deg);
}

/* Mega menu */
.mega {
  position: absolute;
  top: calc(100% + 10px);
  left: -12px;
  width: min(720px, calc(100vw - 64px));
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
}

.mega::before {
  /* ponte invisível para o hover não "cair" */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 14px;
}

.nav__item--mega:hover .mega,
.nav__item--mega:focus-within .mega,
.nav__item--mega.is-open .mega {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.mega__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mega__card {
  --c: var(--brand);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.mega__card:hover,
.mega__card:focus-visible {
  background: var(--surface-2);
  border-color: var(--border);
}

.mega__art {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--c);
  background:
    radial-gradient(80% 80% at 80% 100%, color-mix(in srgb, var(--c) 40%, transparent), transparent 70%),
    color-mix(in srgb, var(--c) 10%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
}

.mega__art span {
  max-width: 46px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mega__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mega__name {
  font-weight: 600;
  font-size: 14px;
}

.mega__meta {
  font-size: 12.5px;
  color: var(--text-muted);
}

.mega__card.is-soon .mega__art,
.mega__card.is-soon .mega__name {
  opacity: 0.6;
}

.mega__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 12px 10px 2px;
  border-top: 1px solid var(--border);
}

/* Busca */
.search {
  position: relative;
}

.header__search {
  display: none;
  flex: 1 1 280px;
  max-width: 340px;
  margin-left: auto;
}

.search__form {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.search__form:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  background: var(--surface);
}

.search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.search__input::placeholder {
  color: var(--text-subtle);
}

.ac {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  min-width: 340px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  animation: pop-in 0.15s var(--ease);
}

.header__search .ac {
  left: auto;
  width: 400px;
}

.ac__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-md);
  transition: background 0.12s;
}

.ac__item:hover,
.ac__item.is-active,
.ac__all.is-active {
  background: var(--surface-2);
}

.ac__thumb {
  width: 36px;
  flex-shrink: 0;
  border-radius: 5px;
  overflow: hidden;
}

.ac__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.ac__name {
  font-size: 14px;
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ac__price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ac__all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  padding: 11px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  color: var(--brand-hover);
  font-weight: 600;
  font-size: 14px;
}

.ac__all:hover {
  background: var(--surface-2);
}

.ac__empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  margin-right: -8px;
}

.cart-count {
  position: absolute;
  top: 3px;
  right: 1px;
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1300;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--bg);
}

.cart-count.is-bump {
  animation: bump 0.45s var(--ease);
}

@media (min-width: 1024px) {
  .nav {
    display: flex;
  }

  .header__menu {
    display: none;
  }
}

/* busca aberta no header só quando há espaço; antes disso, ícone + gaveta */
@media (min-width: 1200px) {
  .header__search {
    display: block;
  }

  .header__search-btn {
    display: none;
  }

  .header__actions {
    margin-left: 8px;
  }
}

@media (max-width: 1023px) {
  .header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .header__menu {
    justify-self: start;
  }

  .header .brand {
    justify-self: center;
  }

  .header__actions {
    justify-self: end;
  }
}

@media (max-width: 340px) {
  .brand__kicker {
    display: none;
  }

  .brand__name {
    margin-top: 0;
    font-size: 17px;
  }
}

/* ─────────────── Menu mobile ─────────────── */
.mnav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mnav__title {
  margin: 14px 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.mnav__title:first-child {
  margin-top: 0;
}

.mnav__cat,
.mnav__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: background 0.15s;
}

.mnav__cat span:not(.pbadge):not(.tag) {
  flex: 1;
}

.mnav__cat:hover,
.mnav__link:hover,
.mnav__link.is-active {
  background: var(--surface-2);
}

.mnav__cat.is-soon > span:not(.tag) {
  opacity: 0.6;
}

.mnav__cat > svg:last-child {
  color: var(--text-subtle);
}

/* ─────────────── Busca mobile ─────────────── */
.search-sheet {
  padding: 12px var(--gutter) 20px;
  gap: 12px;
}

.search--sheet {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search--sheet .search__form {
  flex: 1;
  height: 48px;
}

.ac--sheet {
  position: static;
  min-width: 0;
  max-height: none;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  animation: none;
}

.search-sheet__hint .mnav__title {
  margin-top: 6px;
}

.ac--sheet:not([hidden]) + .search-sheet__hint {
  display: none;
}

/* ─────────────── Carrinho (gaveta + página) ─────────────── */
.cart-drawer__content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.cart-drawer__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.cart-drawer__empty {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 20px;
}

.cart-drawer__foot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.cart-drawer__links {
  display: flex;
  justify-content: space-between;
}

.combo-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  margin-bottom: 8px;
  border-radius: var(--radius);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
}

.combo-progress__text {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
}

.combo-progress__text svg {
  margin-top: 1px;
  color: var(--brand-hover);
}

.combo-progress__ok {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--success);
}

.combo-progress__steps {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}

.combo-progress__steps .is-on {
  color: var(--text);
  font-weight: 600;
}

.combo-progress.is-max {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
}

.combo-progress.is-max .combo-progress__text svg {
  color: var(--success);
}

.combo-progress.is-max .progress__bar {
  background: var(--success);
}

.cart-lines {
  display: flex;
  flex-direction: column;
}

.cart-line {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  animation: fade-in 0.2s;
}

.cart-line:last-child {
  border-bottom: 0;
}

.cart-line__thumb {
  border-radius: var(--radius-sm);
  overflow: hidden;
  align-self: start;
}

.cart-line__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cart-line__name {
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.3;
}

.cart-line__name:hover {
  color: var(--brand-hover);
}

.cart-line__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.cart-line__meta s {
  color: var(--text-subtle);
}

.cart-line__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.cart-line__remove {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-subtle);
  transition: color 0.15s;
}

.cart-line__remove:hover {
  color: var(--danger);
}

.cart-line__total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cart-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.cart-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.cart-summary .is-discount {
  color: var(--success);
}

.cart-summary .is-total {
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.coupon summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
}

.coupon__form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─────────────── Rodapé ─────────────── */
.footer {
  margin-top: var(--section-y);
  padding: 56px 0 28px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}

@media (min-width: 640px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 48px;
  }
}

.footer__about p {
  max-width: 340px;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.footer__social {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  margin-left: -10px;
}

.footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.footer__col a,
.footer__col span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer__col a {
  transition: color 0.15s;
}

.footer__col a:hover {
  color: var(--text);
}

.footer__title {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

a.footer__wa {
  color: var(--success);
  font-weight: 600;
  font-size: 15px;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.pay-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pay {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.footer__legal {
  font-size: 13px;
  color: var(--text-subtle);
}

/* ─────────────── Botão flutuante do WhatsApp ─────────────── */
.wa-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success);
  color: var(--on-success);
  box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--success) 60%, transparent), 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s var(--ease), bottom 0.3s var(--ease), background 0.15s;
}

.wa-fab:hover {
  transform: scale(1.06);
  background: var(--success-hover);
}

.wa-fab__tip {
  position: absolute;
  right: calc(100% + 12px);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(6px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.wa-fab:hover .wa-fab__tip,
.wa-fab:focus-visible .wa-fab__tip {
  opacity: 1;
  transform: none;
}

@media (min-width: 768px) {
  .wa-fab {
    right: 24px;
    bottom: 24px;
  }
}

/* sobe quando a barra fixa de compra (produto / carrinho) aparece no celular */
body.has-buybar .wa-fab {
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

body.has-buybar .toast-viewport {
  bottom: calc(160px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 1024px) {
  body.has-buybar .wa-fab {
    bottom: 24px;
  }

  body.has-buybar .toast-viewport {
    bottom: 24px;
  }
}
