/* Amanteigados Lívia — storefront (catálogo + Meu Pedido)
   Referência: docs/ui-reference/catalogo-e-pedido-aprovado.jpg
   Mobile-first · clean · alta performance */

:root {
  --bordo: #800020;
  --bordo-escuro: #650019;
  --creme: #fff8f1;
  --creme-2: #fffdf9;
  --branco: #ffffff;
  --dourado: #d8a44d;
  --texto: #2d2020;
  --texto-2: #766b68;
  --whatsapp: #16a34a;
  --whatsapp-hover: #15803d;
  --linha: #eadfd4;
  --sombra: 0 4px 14px rgba(45, 32, 32, 0.07);
  --sombra-bar: 0 -4px 20px rgba(45, 32, 32, 0.12);
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;

  /* Borda de segurança esquerda — mesma em todas as seções/carrosséis */
  --edge-safe: 1.125rem;
  --pad-x: max(var(--edge-safe), clamp(1.125rem, 4.2vw, 1.5rem));
  --header-h: 3.15rem;
  --logo-h: 2.35rem;
  --card-min: 9rem;
  /* ~2 cards visíveis + peek no carrossel; largo o bastante p/ preço + qty */
  --card-w: clamp(9rem, 42vw, 10.25rem);
  --footer-h: 2.85rem;
  --tap: 2rem;
  --qty-size: 1.65rem;
  --chip-h: 1.85rem;
  /* safe-t + logo + padding vertical do header */
  --header-stack: calc(var(--safe-t) + var(--logo-h) + 1.1rem);
  --radius-card: 0.875rem;
  --radius-chip: 0.75rem;
  --radius-pill: 999px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --content-max: 26.25rem; /* ~420px — telefone */
  --fs-xs: clamp(0.6875rem, 0.65rem + 0.2vw, 0.75rem);
  --fs-sm: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --fs-base: clamp(0.8125rem, 0.76rem + 0.3vw, 0.9375rem);
  --fs-md: clamp(0.875rem, 0.82rem + 0.35vw, 1rem);
  --fs-lg: clamp(1rem, 0.92rem + 0.4vw, 1.125rem);
  --fs-xl: clamp(1.125rem, 1rem + 0.5vw, 1.35rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.app-storefront {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.4;
  color: var(--texto);
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(128, 0, 32, 0.06), transparent 55%),
    var(--creme);
  overflow-x: hidden; /* evita clip que quebra position:sticky do menu */
  -webkit-tap-highlight-color: transparent;
}

body.app-storefront a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  touch-action: manipulation;
}

/* Smartphone: sem zoom na página; campos editáveis >= 16px (evita zoom no foco iOS) */
@media (max-width: 1024px) {
  html.no-zoom-mobile,
  html {
    touch-action: pan-x pan-y;
    -ms-touch-action: pan-x pan-y;
  }

  input,
  select,
  textarea,
  [contenteditable="true"],
  [contenteditable=""],
  .field input,
  .field select,
  .field textarea {
    font-size: 16px !important;
    touch-action: manipulation;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
  padding-top: var(--header-stack);
  padding-bottom: calc(var(--footer-h) + var(--safe-b) + 0.5rem);
}

.app-shell.is-empty-cart {
  padding-bottom: calc(0.5rem + var(--safe-b));
}

/* ---- Header (fixo no scroll) ---- */
.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, var(--content-max));
  z-index: 40;
  background: linear-gradient(180deg, var(--bordo) 0%, var(--bordo-escuro) 100%);
  color: #fff;
  min-height: var(--header-h);
  height: auto;
  padding: calc(0.35rem + var(--safe-t)) var(--pad-x) 0.55rem;
  display: grid;
  grid-template-columns: var(--tap) 1fr auto;
  align-items: center;
  gap: 0.25rem;
  border-bottom-left-radius: 1.15rem;
  border-bottom-right-radius: 1.15rem;
  box-shadow: 0 6px 18px rgba(101, 0, 25, 0.26);
}

.app-header__btn {
  width: var(--tap);
  height: var(--tap);
  border: 0;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  cursor: pointer;
}

.app-header__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.app-header__logo {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.app-header__logo img {
  height: var(--logo-h);
  width: var(--logo-h);
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  contain: paint;
}

.app-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  justify-self: end;
}

.app-header__cart {
  position: relative;
}

.order-track-btn {
  position: relative;
  width: auto;
  height: auto;
  min-height: var(--tap);
  padding: 0.2rem 0.4rem;
  margin-right: 0.15rem;
  border-radius: 0.65rem;
  text-decoration: none;
}

.order-track-btn__label {
  display: block;
  max-width: 5.1rem;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-align: center;
  text-wrap: balance;
}

.order-track-btn .order-track-badge {
  top: -0.05rem;
  right: -0.05rem;
}


.app-header__badge {
  position: absolute;
  top: 0.2rem;
  right: 0.1rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: var(--radius-pill);
  background: var(--dourado);
  color: var(--bordo-escuro);
  font-size: 0.6875rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.app-header__badge[hidden] {
  display: none !important;
}

.app-ico {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  flex-shrink: 0;
}

/* ---- Category chips ---- */
.cat-rail {
  position: sticky;
  top: var(--header-stack);
  z-index: 30;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0.55rem var(--pad-x) 0.45rem;
  /* mesma borda de segurança da esquerda em todas as seções */
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  background: linear-gradient(180deg, rgba(255, 248, 241, 0.98) 35%, rgba(255, 248, 241, 0.9));
  backdrop-filter: blur(8px);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-padding-left: var(--pad-x);
  box-shadow: 0 1px 0 rgba(128, 0, 32, 0.06);
}

.cat-rail::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex: 0 0 auto;
  min-height: var(--chip-h);
  height: var(--chip-h);
  padding: 0 0.7rem;
  border-radius: 0.65rem;
  border: 1.5px solid var(--bordo);
  background: #fff;
  color: var(--bordo);
  font: 700 var(--fs-xs) / 1 var(--sans);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  scroll-snap-align: start;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.cat-chip[aria-pressed="true"] {
  background: var(--bordo);
  color: #fff;
}

.cat-chip:focus-visible {
  outline: 2px solid var(--bordo);
  outline-offset: 2px;
}

.cat-chip__ico {
  width: 0.85rem;
  height: 0.85rem;
  opacity: 0.9;
}

/* ---- Sections / carousels ---- */
.app-main {
  flex: 1;
  padding: 0.15rem 0 0.35rem;
  min-width: 0;
}

.catalog-state {
  margin: 1rem var(--pad-x);
  padding: 1rem 0.9rem;
  background: #fff;
  border-radius: var(--radius-card);
  text-align: center;
  color: var(--texto-2);
  box-shadow: var(--sombra);
}

.catalog-state h2 {
  font-size: var(--fs-md);
  color: var(--texto);
  margin: 0 0 0.5rem;
}

.catalog-state p {
  margin: 0;
  font-size: var(--fs-sm);
}

.section-block {
  margin: 0.45rem 0 0.85rem;
  content-visibility: auto;
  contain-intrinsic-size: 260px;
}

/* Título + carrossel: mesma margem esquerda (borda de segurança) em todas as seções */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 var(--pad-x) 0.4rem;
  padding-left: var(--pad-x);
  box-sizing: border-box;
}

.section-head h2 {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--bordo);
  letter-spacing: -0.01em;
}

.section-head a,
.section-head button.linkish {
  border: 0;
  background: none;
  color: var(--bordo);
  font: 700 var(--fs-xs) / 1 var(--sans);
  cursor: pointer;
  padding: 0.25rem 0;
  white-space: nowrap;
}

.product-rail {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  /* padding-left idêntico ao section-head / cat-rail */
  padding: 0.2rem var(--pad-x) 0.55rem;
  padding-left: var(--pad-x);
  scroll-padding-left: var(--pad-x);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  box-sizing: border-box;
}

.product-rail::-webkit-scrollbar {
  display: none;
}

.product-card {
  flex: 0 0 var(--card-w);
  width: var(--card-w);
  min-width: var(--card-w);
  background: var(--branco);
  border-radius: var(--radius-card);
  box-shadow: var(--sombra);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  scroll-snap-align: start;
  position: relative;
  overflow: visible;
  isolation: isolate;
}

.product-card__media {
  aspect-ratio: 1;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #f3ebe3;
  flex-shrink: 0;
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card__name {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.25;
  color: var(--texto);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.product-card__meta {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--texto-2);
}

.product-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: auto;
  min-width: 0;
}

.product-card__price {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--bordo);
  letter-spacing: -0.01em;
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Botões do card: compactos p/ caber no carrossel sem cortar */
.product-card .qty-add,
.product-card .qty-ctrl button {
  width: var(--qty-size);
  height: var(--qty-size);
  min-width: var(--qty-size);
  min-height: var(--qty-size);
  max-width: none;
  max-height: none;
  font-size: 0.9rem;
}

.qty-add,
.qty-ctrl button {
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  border: 0;
  background: var(--bordo);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.qty-add:focus-visible,
.qty-ctrl button:focus-visible {
  outline: 2px solid var(--bordo-escuro);
  outline-offset: 2px;
}

.qty-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  background: #f7efe8;
  border-radius: var(--radius-pill);
  padding: 0.1rem;
  flex-shrink: 0;
  max-width: 100%;
}

.product-card .qty-ctrl span {
  min-width: 0.95rem;
  font-size: var(--fs-xs);
}

.qty-ctrl span {
  min-width: 1.15rem;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 800;
}

.qty-ctrl button.is-minus {
  background: #fff;
  color: var(--bordo);
  border: 1px solid var(--linha);
}

/* ---- Fixed order bar ---- */
.order-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(100%, var(--content-max));
  z-index: 50;
  background: var(--bordo-escuro);
  color: #fff;
  min-height: var(--footer-h);
  padding: 0.4rem var(--pad-x) calc(0.4rem + var(--safe-b));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  box-shadow: var(--sombra-bar);
  border-top-left-radius: 0.85rem;
  border-top-right-radius: 0.85rem;
}

.order-bar[hidden] {
  display: none !important;
}

.order-bar__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.order-bar__count {
  font-size: var(--fs-xs);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.95;
}

.order-bar__total {
  font-size: var(--fs-md);
  font-weight: 800;
}

.order-bar__cta {
  flex-shrink: 0;
  min-height: 2.1rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--whatsapp);
  color: #fff;
  font: 700 var(--fs-sm) / 1 var(--sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.order-bar__cta:hover {
  background: var(--whatsapp-hover);
}

/* ---- Meu Pedido ---- */
.pedido-page .app-main {
  padding: 0.9rem var(--pad-x) 1.75rem;
}

.pedido-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.35rem 0 1.15rem;
  color: var(--bordo);
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pedido-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.pedido-item {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  background: #fff;
  border-radius: 0.875rem;
  padding: 0.85rem;
  box-shadow: var(--sombra);
}

.pedido-item__media {
  width: 4rem;
  height: 4rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #f3ebe3;
}

.pedido-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pedido-item__name {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
}

.pedido-item__meta {
  margin: 0.3rem 0 0;
  font-size: var(--fs-xs);
  color: var(--texto-2);
}

.pedido-item__price {
  margin: 0.4rem 0 0;
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--bordo);
}

.pedido-item__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.pedido-item__remove {
  border: 0;
  background: transparent;
  color: var(--bordo);
  width: var(--tap);
  height: var(--tap);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pedido-summary {
  margin-top: 1.15rem;
  background: #fff;
  border-radius: 0.875rem;
  padding: 0.95rem 1rem 1.05rem;
  box-shadow: var(--sombra);
}

.pedido-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: var(--fs-xs);
  color: var(--texto-2);
  margin-bottom: 0.55rem;
}

.pedido-summary__total {
  margin-top: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #fff4e4, #f8e7c8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--fs-md);
  box-shadow: inset 0 0 0 1px rgba(128, 0, 32, 0.08);
}

.pedido-summary__total strong:first-child {
  font-size: var(--fs-sm);
  color: var(--bordo-escuro);
}

.pedido-summary__total strong:last-child {
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.75rem);
  color: var(--bordo);
  letter-spacing: -0.02em;
  font-weight: 800;
}

.pedido-form {
  margin-top: 1.15rem;
}

.pedido-form h3 {
  margin: 0 0 0.7rem;
  font-size: var(--fs-sm);
  color: var(--bordo);
  font-weight: 800;
}

.field {
  display: block;
  margin-bottom: 0.7rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 2.35rem;
  border: 1.5px solid var(--linha);
  border-radius: 0.65rem;
  padding: 0 0.75rem 0 2.35rem;
  font: 500 16px / 1.2 var(--sans);
  color: var(--texto);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23800020' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='9' cy='6' r='3'/%3E%3Cpath d='M3 15c1.5-3 11.5-3 13 0'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
  background-size: 1rem;
}

.field input[type="tel"],
.field-input--phone {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%2316a34a' viewBox='0 0 24 24'%3E%3Cpath d='M20.5 11.5a8.5 8.5 0 0 1-12.7 7.4L3.5 20l1.2-4.1A8.5 8.5 0 1 1 20.5 11.5Z'/%3E%3C/svg%3E");
}

.field-input--name {
  text-transform: uppercase;
}

.field select,
.field .field-input--plain {
  padding-left: 0.75rem;
  background-image: none;
}

.wa-submit {
  width: 100%;
  min-height: 2.55rem;
  margin-top: 0.5rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--whatsapp);
  color: #fff;
  font: 800 var(--fs-sm) / 1 var(--sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
}

.wa-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.wa-submit:hover:not(:disabled) {
  background: var(--whatsapp-hover);
}

.checkout-msg {
  margin: 0.65rem 0 0;
  font-size: var(--fs-sm);
  color: var(--texto-2);
}

.checkout-msg[data-tone="error"] {
  color: #a83e3e;
}

.checkout-msg[data-tone="ok"] {
  color: var(--whatsapp);
}

.empty-pedido {
  text-align: center;
  padding: 2.5rem 1rem;
  background: #fff;
  border-radius: 0.875rem;
  box-shadow: var(--sombra);
}

.empty-pedido__cta.cat-chip,
.empty-pedido a.cat-chip {
  display: inline-flex;
  margin-top: 0.9rem;
  text-decoration: none;
}

body.menu-open {
  overflow: hidden;
}

/* ---- Menu lateral (drawer) ---- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(45, 32, 32, 0.45);
  z-index: 60;
}

.sheet-backdrop[hidden],
.sheet-panel[hidden],
.catalog-state[hidden],
.order-bar[hidden],
.app-header__badge[hidden],
.field[hidden],
.empty-pedido[hidden],
#cartLayout[hidden],
#cartUnavailableState[hidden],
#cartEmptyState[hidden],
#catalogLoading[hidden],
#catalogUnavailable[hidden],
#catalogSections[hidden],
#addressField[hidden] {
  display: none !important;
}

.sheet-panel--drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(18.5rem, 86vw);
  max-height: none;
  height: 100dvh;
  overflow: auto;
  background: linear-gradient(180deg, #fffdf9 0%, #fff 48%);
  border-radius: 0 1.1rem 1.1rem 0;
  padding: calc(0.85rem + var(--safe-t)) 0.85rem calc(0.85rem + var(--safe-b));
  z-index: 61;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 8px 0 28px rgba(45, 32, 32, 0.18);
  transform: translateX(-105%);
  transition: transform 0.2s ease;
}

.sheet-panel--drawer.is-open {
  transform: translateX(0);
}

.sheet-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.15rem 0.25rem 0.65rem;
  border-bottom: 1px solid var(--linha);
}

.sheet-panel__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.sheet-panel__brand img {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.sheet-panel__brand strong {
  font-size: var(--fs-sm);
  color: var(--bordo);
  line-height: 1.2;
}

.sheet-panel__close {
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--bordo);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sheet-panel__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.sheet-panel__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--texto);
}

.sheet-panel__link .app-ico {
  color: var(--bordo);
}

.sheet-panel__link.is-active,
.sheet-panel__link:hover {
  background: rgba(128, 0, 32, 0.08);
  color: var(--bordo);
}

.sheet-panel__badge {
  margin-left: auto;
  position: static;
  top: auto;
  right: auto;
}

.sheet-panel__foot {
  border-top: 1px solid var(--linha);
  padding-top: 0.5rem;
}

.sheet-panel__link--muted {
  color: var(--texto-2);
  font-weight: 600;
  font-size: var(--fs-xs);
}

.track-intro {
  margin: -0.35rem 0 1rem;
  color: var(--texto-2);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.track-lookup {
  margin-top: 0.25rem;
}

.track-history {
  margin: 1rem 0 0.85rem;
}

.track-history__title {
  margin: 0 0 0.65rem;
  font-size: var(--fs-sm);
  color: var(--bordo);
  font-weight: 800;
}

.track-history__list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.track-history__group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.track-history__day {
  margin: 0;
  padding: 0.15rem 0.1rem 0.35rem;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--bordo);
  border-bottom: 1px solid rgba(128, 0, 32, 0.14);
}

.track-history__day-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.track-history__item {
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--linha);
  background: #fff;
  border-radius: 0.75rem;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  font: inherit;
}

.track-history__item.is-active {
  border-color: var(--bordo);
  box-shadow: 0 0 0 1px rgba(128, 0, 32, 0.15);
}

.track-history__pedido {
  font-weight: 800;
  color: var(--bordo);
  font-size: var(--fs-sm);
}

.track-history__meta {
  color: var(--texto-2);
  font-size: var(--fs-xs);
}

.track-lookup__btn {
  background: var(--bordo);
}

.track-lookup__btn:hover:not(:disabled) {
  background: var(--bordo-escuro);
}

.track-card {
  margin-top: 0.85rem;
  background: #fff;
  border-radius: 0.875rem;
  padding: 0.9rem;
  box-shadow: var(--sombra);
}

.track-card__status {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(128, 0, 32, 0.1);
  color: var(--bordo);
  font-size: var(--fs-xs);
  font-weight: 800;
  margin-bottom: 0.65rem;
}

.track-card__status[data-status="CONFIRMADA"] {
  background: rgba(22, 163, 74, 0.12);
  color: var(--whatsapp);
}

.track-card__status[data-status="CANCELADA"] {
  background: rgba(168, 62, 62, 0.12);
  color: #a83e3e;
}

.track-card__number {
  margin: 0 0 0.35rem;
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--bordo);
}

.track-card__client {
  margin: 0 0 0.65rem;
  color: var(--texto-2);
  font-size: var(--fs-sm);
}

.track-card__items {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: var(--fs-sm);
}

.track-card__total {
  margin-top: 0;
}

.track-card__hint {
  margin: 0.75rem 0 0;
  color: var(--texto-2);
  font-size: var(--fs-xs);
}

.track-card__clear {
  margin-top: 0.75rem;
}

/* =========================================================
   Breakpoints — celulares estreitos → tablet → desktop
   ========================================================= */

/* iPhone SE / 320–359 — mantém borda de segurança e card utilizável */
@media (max-width: 359px) {
  :root {
    --edge-safe: 1rem;
    --pad-x: 1rem;
    --card-w: 8.75rem;
    --qty-size: 1.55rem;
  }

  .order-bar__cta {
    padding: 0 0.65rem;
    min-height: 1.95rem;
    font-size: 0.75rem;
  }
}

/* 360–389 (Android comuns) */
@media (min-width: 360px) {
  :root {
    --card-w: clamp(9.25rem, 44vw, 10rem);
  }
}

/* 390–429 (iPhone 12/13/14) */
@media (min-width: 390px) {
  :root {
    --card-w: clamp(9.5rem, 42vw, 10.5rem);
    --content-max: 27.5rem;
  }
}

/* 430–767 (Pro Max / phablet) — carrossel ativo */
@media (min-width: 430px) {
  :root {
    --edge-safe: 1.25rem;
    --pad-x: max(var(--edge-safe), 1.25rem);
    --card-w: 10.25rem;
    --content-max: 30rem;
    --qty-size: 1.75rem;
  }
}

/* Tablet — carrossel mantido; chrome compacto */
@media (min-width: 600px) {
  :root {
    --content-max: 42rem;
    --card-w: 10.75rem;
    --edge-safe: 1.35rem;
    --pad-x: max(var(--edge-safe), 1.35rem);
    --header-h: 3.35rem;
    --logo-h: 2.5rem;
    --qty-size: 1.85rem;
    --footer-h: 3.1rem;
  }

  .product-rail {
    gap: 0.85rem;
  }

  .product-card__name {
    font-size: var(--fs-base);
  }

  .product-card__price {
    font-size: var(--fs-md);
  }

  .cat-rail {
    gap: 0.6rem;
  }

  .pedido-item {
    grid-template-columns: 4.5rem minmax(0, 1fr) auto;
    padding: 0.85rem;
  }

  .pedido-item__media {
    width: 4.5rem;
    height: 4.5rem;
  }
}

/* Tablet landscape / small laptop */
@media (min-width: 768px) {
  :root {
    --content-max: 48rem;
    --card-min: 9rem;
  }

  .pedido-page .app-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  #cartLayout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
    gap: 1rem 1.25rem;
    align-items: start;
  }

  #cartLayout .pedido-list {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  #cartLayout .pedido-summary {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
    position: sticky;
    top: calc(var(--header-h) + 0.75rem);
  }

  #cartLayout .pedido-form {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0;
  }
}

/* Desktop — carrossel permanece ativo */
@media (min-width: 1024px) {
  :root {
    --content-max: 64rem;
    --card-w: 11.25rem;
    --card-min: 10rem;
    --header-h: 3.5rem;
    --logo-h: 2.65rem;
    --edge-safe: 1.5rem;
    --pad-x: max(var(--edge-safe), 1.5rem);
    --qty-size: 1.95rem;
    --footer-h: 3.15rem;
  }

  body.app-storefront {
    background:
      radial-gradient(70% 40% at 50% 0%, rgba(128, 0, 32, 0.07), transparent 60%),
      linear-gradient(180deg, #fff5ec 0%, var(--creme) 28%, var(--creme-2) 100%);
  }

  .app-shell {
    box-shadow: 0 0 0 1px rgba(128, 0, 32, 0.04);
    background: rgba(255, 253, 249, 0.55);
  }

  .app-header {
    border-radius: 0 0 2rem 2rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .product-rail {
    gap: 1rem;
  }

  .product-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(45, 32, 32, 0.1);
  }

  .section-head h2 {
    font-size: 1.25rem;
  }

  .order-bar,
  .sheet-panel {
    max-width: var(--content-max);
  }
}

/* Wide desktop */
@media (min-width: 1280px) {
  :root {
    --content-max: 72rem;
    --card-min: 11rem;
  }
}

/* Landscape phones — keep compact vertical chrome */
@media (max-height: 430px) and (orientation: landscape) {
  :root {
    --header-h: 2.85rem;
    --logo-h: 2.1rem;
    --footer-h: 2.75rem;
    --header-stack: calc(var(--safe-t) + 3.2rem);
  }

  .app-header {
    padding-bottom: 0.4rem;
    border-bottom-left-radius: 0.85rem;
    border-bottom-right-radius: 0.85rem;
  }

  .section-block {
    margin-bottom: 0.45rem;
  }
}
