/* ==========================================================================
   O Costelão — Casa de Carnes
   Design system + componentes (Vanilla CSS, mobile-first)
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Marca */
  --red-50: #fff1ef;
  --red-100: #ffdcd7;
  --red-500: #f2361f;
  --red-600: #e62412;
  --red-700: #c41b0b;
  --red-800: #99160b;
  --gold-300: #ffd86b;
  --gold-400: #fbc02d;
  --gold-500: #f0a800;
  --gold-900: #5a3b00;
  --green-500: #25d366;
  --green-600: #1ebe5a;
  --green-700: #128c4a;

  /* Neutros quentes */
  --ink-950: #140d0a;
  --ink-900: #1f1714;
  --ink-800: #2e2420;
  --ink-700: #463a35;
  --ink-500: #6f625c;
  --ink-400: #988b85;
  --ink-300: #c4b9b3;
  --line: #ece5e0;
  --line-strong: #ddd3cd;
  --bg: #faf7f4;
  --surface: #ffffff;
  --surface-2: #f5f0ec;

  /* Tipografia */
  --font-display: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Raio / sombra */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;
  --shadow-xs: 0 1px 2px rgba(31, 23, 20, .06);
  --shadow-sm: 0 2px 8px -2px rgba(31, 23, 20, .08), 0 1px 2px rgba(31, 23, 20, .04);
  --shadow-md: 0 12px 28px -12px rgba(31, 23, 20, .22), 0 2px 6px rgba(31, 23, 20, .05);
  --shadow-lg: 0 24px 60px -18px rgba(31, 23, 20, .35);
  --shadow-red: 0 10px 24px -10px rgba(230, 36, 18, .65);
  --shadow-green: 0 10px 24px -10px rgba(18, 140, 74, .6);

  /* Layout */
  --header-h: 64px;
  --catnav-h: 60px;
  --container: 1200px;
  --gutter: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  color-scheme: light;
}

@media (min-width: 768px) {
  :root {
    --header-h: 72px;
    --gutter: 24px;
  }
}

/* ---------- 2. Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.is-locked {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--gold-400);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection {
  background: var(--red-600);
  color: #fff;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--ink-900);
  color: #fff;
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform .2s var(--ease);
}

.skip-link:focus {
  transform: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left));
}

/* ---------- 3. Botões ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink-900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .7rem 1.25rem;
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), background-color .2s, color .2s, border-color .2s;
  user-select: none;
}

.btn:active {
  transform: scale(.97);
}

.btn--lg {
  min-height: 52px;
  padding: .85rem 1.5rem;
  font-size: 1.05rem;
}

.btn--block {
  width: 100%;
}

.btn--primary {
  --btn-bg: var(--red-600);
  --btn-fg: #fff;
  background: linear-gradient(180deg, var(--red-500), var(--red-600) 60%, var(--red-700));
  box-shadow: var(--shadow-red), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.btn--primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 14px 30px -10px rgba(230, 36, 18, .75), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.btn--whatsapp {
  --btn-fg: #fff;
  background: linear-gradient(180deg, #2fe07a, var(--green-500) 50%, var(--green-600));
  box-shadow: var(--shadow-green), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.btn--whatsapp:hover {
  filter: brightness(1.04);
}

.btn--whatsapp .fa-whatsapp {
  font-size: 1.3em;
}

.btn--glass {
  --btn-fg: #fff;
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn--glass:hover {
  background: rgba(255, 255, 255, .2);
}

.btn--ghost {
  --btn-fg: var(--ink-900);
  background: var(--surface);
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  border-color: var(--ink-300);
  background: var(--surface-2);
}

.btn--text {
  --btn-fg: var(--ink-500);
  background: transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .925rem;
  min-height: 40px;
}

.btn--text:hover {
  color: var(--ink-900);
}

.btn__sep {
  opacity: .6;
}

.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: .55;
  pointer-events: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-800);
  box-shadow: var(--shadow-xs);
  transition: background-color .2s, color .2s, transform .15s var(--ease), opacity .2s, border-color .2s;
}

.icon-btn:hover {
  border-color: var(--ink-300);
}

.icon-btn:active {
  transform: scale(.92);
}

.icon-btn:disabled {
  opacity: .35;
  cursor: default;
}

.icon-btn--light {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .22);
  color: #fff;
  box-shadow: none;
}

.icon-btn--light:hover {
  background: rgba(255, 255, 255, .24);
  border-color: rgba(255, 255, 255, .35);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .375rem .5rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-500);
}

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

.link-btn--danger:hover {
  color: var(--red-700);
  background: var(--red-50);
}

/* ---------- 4. Status da loja ---------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .375rem .75rem;
  border-radius: var(--r-full);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--ink-700);
}

.status-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-400);
  flex-shrink: 0;
}

.status-pill.is-open .status-pill__dot {
  background: var(--green-500);
  box-shadow: 0 0 0 0 rgba(37, 211, 102, .7);
  animation: pulse 2s infinite;
}

.status-pill.is-open {
  color: var(--green-700);
  background: #e8f9ef;
}

.status-pill.is-closed .status-pill__dot {
  background: var(--red-600);
}

.status-pill.is-closed {
  color: var(--red-800);
  background: var(--red-50);
}

.status-pill--hero {
  background: rgba(20, 13, 10, .45) !important;
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: .45rem .9rem;
  font-size: .82rem;
}

.status-pill--header {
  display: none;
}

@media (min-width: 720px) {
  .status-pill--header {
    display: inline-flex;
  }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .6); }
  70% { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ---------- 5. Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(236, 229, 224, .8);
  transition: box-shadow .25s;
}

.topbar.is-scrolled {
  box-shadow: 0 6px 20px -12px rgba(31, 23, 20, .25);
}

.topbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.brand__logo {
  height: 44px;
  width: auto;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.brand__text strong {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--red-600);
  letter-spacing: -.01em;
}

.brand__text small {
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-full);
  background: var(--ink-900);
  color: #fff;
  font-weight: 600;
  font-size: .925rem;
  transition: background-color .2s, transform .15s var(--ease);
}

.cart-btn:hover {
  background: var(--ink-800);
}

.cart-btn:active {
  transform: scale(.95);
}

.cart-btn .fa-bag-shopping {
  font-size: 1.05rem;
}

.cart-btn__label {
  display: none;
}

.cart-btn__badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-full);
  background: var(--gold-400);
  color: var(--gold-900);
  font-size: .75rem;
  font-weight: 800;
}

.cart-btn.is-bump {
  animation: bump .45s var(--ease-spring);
}

@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@media (min-width: 480px) {
  .cart-btn__label {
    display: inline;
  }
  .cart-btn {
    padding: 0 18px;
  }
}

@media (min-width: 768px) {
  .brand__logo {
    height: 52px;
  }
  .brand__text strong {
    font-size: 1.3rem;
  }
}

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: var(--ink-950);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
  transform: scale(1.04);
  animation: heroZoom 18s var(--ease) forwards;
}

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 0% 100%, rgba(230, 36, 18, .45), transparent 55%),
    linear-gradient(90deg, rgba(20, 13, 10, .92) 0%, rgba(20, 13, 10, .75) 45%, rgba(20, 13, 10, .35) 100%),
    linear-gradient(0deg, rgba(20, 13, 10, .7), transparent 40%);
}

@keyframes heroZoom {
  to { transform: scale(1); }
}

.hero__content {
  padding-top: clamp(40px, 9vw, 96px);
  padding-bottom: clamp(40px, 9vw, 104px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  animation: fadeUp .7s var(--ease) both;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 6.5vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: -.025em;
  max-width: 16ch;
  text-wrap: balance;
}

.hero__title span {
  color: var(--gold-400);
  background: linear-gradient(90deg, var(--gold-300), var(--gold-400) 50%, #ff9f1a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__lead {
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: rgba(255, 255, 255, .82);
  max-width: 46ch;
  text-wrap: pretty;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  width: 100%;
}

.hero__cta .btn {
  flex: 1 1 180px;
}

@media (min-width: 560px) {
  .hero__cta .btn {
    flex: 0 0 auto;
  }
}

.hero__features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 10px;
  font-size: .875rem;
  color: rgba(255, 255, 255, .85);
}

.hero__features li {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.hero__features i {
  color: var(--gold-400);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 7. Navegação de categorias ---------- */
.catnav {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  height: var(--catnav-h);
  background: rgba(250, 247, 244, .92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.catnav__inner {
  height: 100%;
  padding-inline: 0;
}

.catnav__track {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-inline: var(--gutter);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 28px), transparent);
}

.catnav__track::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-700);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s, transform .15s var(--ease);
}

.chip i {
  color: var(--red-600);
  font-size: .85em;
  transition: color .2s;
}

.chip:hover {
  border-color: var(--ink-300);
  color: var(--ink-900);
}

.chip:active {
  transform: scale(.96);
}

.chip.is-active {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #fff;
  box-shadow: var(--shadow-red);
}

.chip.is-active i {
  color: var(--gold-300);
}

@media (min-width: 1240px) {
  .catnav__track {
    justify-content: center;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* ---------- 8. Busca ---------- */
.menu {
  flex: 1;
  padding-bottom: 56px;
  outline: none;
}

.search {
  position: relative;
  margin: 24px 0 8px;
  max-width: 560px;
}

.search__icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  pointer-events: none;
}

.search__input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 48px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-size: 1rem;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}

.search__input::-webkit-search-cancel-button {
  display: none;
}

.search__input::placeholder {
  color: var(--ink-400);
}

.search__input:focus {
  outline: none;
  border-color: var(--red-600);
  box-shadow: 0 0 0 4px rgba(230, 36, 18, .12);
}

.search__clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-500);
}

.search__clear:hover {
  background: var(--surface-2);
  color: var(--ink-900);
}

/* ---------- 9. Seções ---------- */
.section {
  padding-top: 32px;
  scroll-margin-top: calc(var(--header-h) + var(--catnav-h) + 8px);
}

.section + .section {
  margin-top: 8px;
}

.section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.35rem, 3.4vw, 1.75rem);
  letter-spacing: -.015em;
  line-height: 1.15;
}

.section__icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--red-50);
  color: var(--red-600);
  font-size: 1rem;
  flex-shrink: 0;
}

.section__icon--gold {
  background: #fff6db;
  color: var(--gold-500);
}

.section__subtitle {
  margin-top: 4px;
  margin-left: 50px;
  font-size: .9rem;
  color: var(--ink-500);
}

#search-results .section__subtitle {
  margin-left: 0;
}

/* ---------- 10. Grid & card de produto ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1140px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
}

.product {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
  animation: fadeUp .45s var(--ease) both;
}

.product.in-cart {
  border-color: rgba(230, 36, 18, .35);
  box-shadow: 0 0 0 1px rgba(230, 36, 18, .12), var(--shadow-sm);
}

.product__media {
  position: relative;
  flex-shrink: 0;
  width: 104px;
  height: 104px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
}

.product__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}

.product__media--contain {
  background: #fff;
  border: 1px solid var(--line);
}

.product__media--contain img {
  object-fit: contain;
  padding: 6px;
}

.img-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--ink-300);
  font-size: 1.75rem;
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 8px, #efe8e3 8px, #efe8e3 16px);
}

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--gold-400);
  color: var(--gold-900);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

.badge--dark {
  background: var(--ink-900);
  color: var(--gold-400);
}

.product__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.product__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--ink-900);
}

.product__desc {
  margin-top: 4px;
  font-size: .85rem;
  line-height: 1.4;
  color: var(--ink-500);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product__footer {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.product__action {
  margin-left: auto;
}

.price {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.price__old {
  font-size: .78rem;
  color: var(--ink-400);
  text-decoration: line-through;
}

.price__now {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--red-600);
  letter-spacing: -.01em;
  white-space: nowrap;
}

.price__unit {
  margin-left: 2px;
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 600;
  color: var(--ink-500);
}

/* Botão adicionar */
.add-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--r-full);
  background: var(--red-50);
  color: var(--red-700);
  font-weight: 700;
  font-size: .875rem;
  transition: background-color .2s, color .2s, transform .15s var(--ease), box-shadow .2s;
}

.add-btn:hover {
  background: var(--red-600);
  color: #fff;
  box-shadow: var(--shadow-red);
}

.add-btn:active {
  transform: scale(.94);
}

/* Stepper de quantidade */
.stepper {
  display: inline-flex;
  align-items: center;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--red-600);
  color: #fff;
  box-shadow: var(--shadow-red);
  animation: popIn .25s var(--ease-spring);
}

.stepper__btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: inherit;
  font-size: .85rem;
  transition: background-color .15s, transform .12s;
}

.stepper__btn:hover {
  background: rgba(255, 255, 255, .16);
}

.stepper__btn:active {
  transform: scale(.88);
}

.stepper__value {
  min-width: 54px;
  text-align: center;
  font-weight: 800;
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}

.stepper--sm {
  height: 34px;
  background: var(--surface-2);
  color: var(--ink-900);
  box-shadow: none;
  border: 1px solid var(--line);
  animation: none;
}

.stepper--sm .stepper__btn {
  width: 34px;
  height: 34px;
  color: var(--red-600);
}

.stepper--sm .stepper__btn:hover {
  background: var(--red-50);
}

.stepper--sm .stepper__value {
  min-width: 52px;
  font-size: .82rem;
}

@keyframes popIn {
  from { transform: scale(.85); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Card vertical (tablet/desktop) */
@media (min-width: 640px) {
  .grid .product {
    flex-direction: column;
    padding: 0;
    gap: 0;
    overflow: hidden;
  }

  .grid .product__media {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 0;
  }

  .grid .product__media--contain {
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .grid .product__media--contain img {
    padding: 14px;
  }

  .grid .product__body {
    padding: 14px 16px 16px;
  }

  .grid .product__desc {
    min-height: 2.8em;
  }
}

@media (hover: hover) {
  .product:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--line-strong);
  }

  .product:hover .product__media img {
    transform: scale(1.06);
  }
}

/* ---------- 11. Carrossel de ofertas ---------- */
.carousel {
  position: relative;
  margin-inline: calc(var(--gutter) * -1);
}

.carousel__track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding: 4px var(--gutter) 18px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  outline: none;
}

.carousel__track::-webkit-scrollbar {
  display: none;
}

.carousel__track:focus-visible {
  outline: 3px solid var(--gold-400);
  outline-offset: -3px;
}

.carousel__controls {
  display: none;
  gap: 8px;
}

@media (min-width: 768px) {
  .carousel__controls {
    display: flex;
  }
}

.promo-card {
  flex: 0 0 82%;
  max-width: 340px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

@media (min-width: 640px) {
  .promo-card {
    flex-basis: 46%;
  }
}

@media (min-width: 1024px) {
  .promo-card {
    flex-basis: calc((100% - 3 * 14px) / 4);
    max-width: none;
  }
}

.promo-card.in-cart {
  border-color: rgba(230, 36, 18, .35);
}

.promo-card .product__media {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 11;
  border-radius: 0;
}

.promo-card .product__media::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(0deg, rgba(20, 13, 10, .35), transparent);
  pointer-events: none;
}

.promo-card .badge {
  top: 12px;
  left: 12px;
  font-size: .72rem;
  padding: 4px 10px;
}

.promo-card .product__body {
  padding: 16px 18px 18px;
}

.promo-card .product__name {
  font-size: 1.15rem;
}

.promo-card .product__desc {
  min-height: 2.8em;
}

.promo-card .price__now {
  font-size: 1.45rem;
}

@media (hover: hover) {
  .promo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
  }

  .promo-card:hover .product__media img {
    transform: scale(1.06);
  }
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--line-strong);
  transition: width .3s var(--ease), background-color .3s;
}

.carousel__dot.is-active {
  width: 24px;
  background: var(--red-600);
}

@media (min-width: 1024px) {
  .carousel__dots {
    display: none;
  }
}

/* ---------- 12. Empty states ---------- */
.empty-state,
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 40px 16px;
}

.empty-state h3,
.cart-empty h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.empty-state p,
.cart-empty p {
  color: var(--ink-500);
  font-size: .925rem;
  max-width: 34ch;
  margin-bottom: 12px;
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--red-50);
  color: var(--red-600);
  font-size: 1.6rem;
}

/* ---------- 13. Rodapé ---------- */
.footer {
  background: var(--ink-950);
  color: rgba(255, 255, 255, .72);
  padding: 48px 0 calc(110px + env(safe-area-inset-bottom));
  font-size: .925rem;
}

.footer__inner {
  display: grid;
  gap: 32px;
}

@media (min-width: 768px) {
  .footer__inner {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .footer {
    padding-bottom: 32px;
  }
}

.footer__brand img {
  width: 96px;
  height: auto;
  border-radius: 12px;
  margin-bottom: 14px;
}

.footer__brand p {
  max-width: 32ch;
}

.footer__col h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: .02em;
}

.footer__col li {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: 4px 0;
}

.footer__col i {
  width: 18px;
  text-align: center;
  color: var(--gold-400);
}

.footer__col a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .25);
}

.footer__col a:hover {
  border-color: var(--gold-400);
}

.footer__copy {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .8rem;
  color: rgba(255, 255, 255, .45);
}

/* ---------- 14. Barra flutuante do carrinho ---------- */
.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  padding: 12px max(var(--gutter), env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
  transform: translateY(120%);
  transition: transform .4s var(--ease);
}

.cart-bar.is-visible {
  transform: none;
}

.cart-bar__btn {
  pointer-events: auto;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 10px 0 10px;
  border-radius: var(--r-lg);
  background: var(--ink-900);
  color: #fff;
  box-shadow: var(--shadow-lg);
  transition: transform .15s var(--ease);
}

.cart-bar__btn:active {
  transform: scale(.98);
}

.cart-bar__count {
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--red-600);
  font-weight: 800;
  font-size: .95rem;
}

.cart-bar__label {
  flex: 1;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.cart-bar__total {
  padding: 0 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--gold-400);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 1024px) {
  .cart-bar {
    display: none;
  }
}

/* ---------- 15. Overlay + Drawer ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 13, 10, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .3s var(--ease);
}

.overlay.is-visible {
  opacity: 1;
}

.drawer {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  visibility: hidden;
  outline: none;
  transition: transform .38s var(--ease), visibility 0s linear .38s;

  /* Mobile: bottom sheet */
  left: 0;
  right: 0;
  bottom: 0;
  height: 92vh;
  height: 92dvh;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  transform: translateY(100%);
  overflow: hidden;
}

.drawer.is-open {
  visibility: visible;
  transform: none;
  transition: transform .38s var(--ease), visibility 0s;
}

@media (min-width: 640px) {
  .drawer {
    top: 0;
    left: auto;
    right: 0;
    bottom: 0;
    width: 440px;
    height: 100%;
    border-radius: var(--r-xl) 0 0 var(--r-xl);
    transform: translateX(100%);
  }
}

.drawer__header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 18px;
  background: linear-gradient(135deg, var(--red-600), var(--red-800));
  color: #fff;
  flex-shrink: 0;
}

.drawer__header::before {
  /* puxador do bottom sheet */
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .45);
  transform: translateX(-50%);
}

@media (min-width: 640px) {
  .drawer__header::before {
    display: none;
  }
}

.drawer__header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-300), var(--gold-500));
}

.drawer__heading h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -.01em;
  outline: none;
}

.steps {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  font-size: .75rem;
  font-weight: 600;
}

.steps__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .7);
  transition: background-color .25s, color .25s;
}

.steps__item span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  font-size: .7rem;
  font-weight: 800;
}

.steps__item.is-active {
  background: #fff;
  color: var(--red-700);
}

.steps__item.is-active span {
  background: var(--red-600);
  color: #fff;
}

.steps__item.is-done span {
  background: var(--gold-400);
  color: var(--gold-900);
}

.drawer__view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  animation: viewIn .3s var(--ease);
}

@keyframes viewIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}

.drawer__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 20px;
  -webkit-overflow-scrolling: touch;
}

.drawer__footer {
  flex-shrink: 0;
  padding: 16px 20px calc(14px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -16px rgba(31, 23, 20, .25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Lista do carrinho */
.cart-list__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-500);
}

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

.line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  animation: fadeUp .3s var(--ease) both;
  transition: opacity .25s, transform .25s var(--ease);
}

.line.is-leaving {
  opacity: 0;
  transform: translateX(24px);
}

.line__img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}

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

.line__img--contain img {
  object-fit: contain;
  background: #fff;
  padding: 4px;
}

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

.line__name {
  font-weight: 700;
  font-size: .925rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line__unit {
  font-size: .78rem;
  color: var(--ink-500);
}

.line__end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  align-self: stretch;
}

.line__total {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--ink-900);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.line__remove {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--ink-400);
  transition: color .2s, background-color .2s;
}

.line__remove:hover {
  color: var(--red-700);
  background: var(--red-50);
}

/* Resumo */
.summary {
  margin: 0 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: .925rem;
}

.summary__row dt {
  color: var(--ink-700);
}

.summary__row dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.summary__row--muted dt,
.summary__row--muted dd {
  color: var(--ink-500);
  font-weight: 500;
  font-size: .85rem;
}

.summary__row--total dt {
  font-weight: 700;
  color: var(--ink-900);
}

.summary__row--total dd {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--red-600);
}

.weight-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: #fff8e6;
  color: #7a5200;
  font-size: .78rem;
  line-height: 1.4;
}

.weight-note i {
  margin-top: 2px;
}

/* ---------- 16. Formulário ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form__group {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.form__legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: .875rem;
  font-weight: 700;
  color: var(--ink-800);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form__legend i {
  color: var(--red-600);
}

.form__card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form__card .form__legend {
  margin-bottom: 0;
}

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

.field--sm {
  flex: 0 0 34%;
}

.field-row {
  display: flex;
  gap: 10px;
}

.field__label {
  font-size: .825rem;
  font-weight: 600;
  color: var(--ink-700);
}

.req {
  color: var(--red-600);
}

.opt {
  font-weight: 500;
  color: var(--ink-400);
}

.field__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 1rem; /* evita zoom no iOS */
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}

.field__input::placeholder {
  color: var(--ink-400);
}

.field__input:hover {
  border-color: var(--ink-300);
}

.field__input:focus {
  outline: none;
  border-color: var(--red-600);
  box-shadow: 0 0 0 4px rgba(230, 36, 18, .12);
}

.field__input[aria-invalid='true'] {
  border-color: var(--red-600);
  background: var(--red-50);
}

.field__textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.4;
}

.field__error {
  font-size: .78rem;
  font-weight: 600;
  color: var(--red-700);
}

.field__error:empty {
  display: none;
}

.field__affix {
  position: relative;
}

.field__affix span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--ink-500);
  pointer-events: none;
}

.field__affix .field__input {
  padding-left: 42px;
}

/* Segmented control */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.segmented__opt input,
.pay-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented__opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--ink-500);
  cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s;
}

.segmented__opt input:checked + span {
  background: var(--surface);
  color: var(--red-700);
  box-shadow: var(--shadow-sm);
}

.segmented__opt input:focus-visible + span,
.pay-opt input:focus-visible + span {
  outline: 3px solid var(--gold-400);
  outline-offset: 1px;
}

/* Pagamento */
.pay-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 400px) {
  .pay-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.pay-opt span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 68px;
  padding: 8px 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s, box-shadow .2s;
}

.pay-opt span i {
  font-size: 1.2rem;
  color: var(--ink-400);
  transition: color .2s;
}

.pay-opt span:hover {
  border-color: var(--ink-300);
}

.pay-opt input:checked + span {
  border-color: var(--red-600);
  background: var(--red-50);
  color: var(--red-700);
  box-shadow: 0 0 0 1px var(--red-600);
}

.pay-opt input:checked + span i {
  color: var(--red-600);
}

/* Avisos */
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: var(--r-md);
  font-size: .85rem;
  line-height: 1.4;
}

.notice--warn {
  background: #fff8e6;
  border: 1px solid #ffe3a3;
  color: #6b4700;
}

.notice i {
  margin-top: 2px;
}

/* Sucesso */
.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding-block: 32px;
}

.success__icon {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--green-500);
  color: #fff;
  font-size: 2.2rem;
  box-shadow: 0 0 0 10px rgba(37, 211, 102, .15), 0 0 0 20px rgba(37, 211, 102, .07);
  animation: popIn .5s var(--ease-spring);
}

.success h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
}

.success p {
  color: var(--ink-500);
  max-width: 34ch;
  margin-bottom: 12px;
}

.success .btn {
  white-space: normal;
}

/* ---------- 17. Toasts ---------- */
.toasts {
  position: fixed;
  left: 50%;
  top: calc(var(--header-h) + 12px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 10px 10px 14px;
  border-radius: var(--r-md);
  background: var(--ink-900);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
  animation: toastIn .35s var(--ease-spring);
}

.toast.is-leaving {
  animation: toastOut .25s var(--ease) forwards;
}

.toast__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green-500);
  font-size: .8rem;
}

.toast__icon--info {
  background: var(--ink-700);
}

.toast__msg {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.toast__msg strong {
  font-weight: 700;
}

.toast__action {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--gold-400);
  font-weight: 700;
  font-size: .85rem;
}

.toast__action:hover {
  background: rgba(255, 255, 255, .1);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(.96); }
  to { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px) scale(.96); }
}

/* ---------- 18. Acessibilidade: movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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