:root {
  --cream: #F3E7CD;
  --cream-2: #FBF5E8;
  --paper: #FFFDF8;
  --green: #69775E;
  --green-dark: #4F5B46;
  --terra: #BD6438;
  --terra-dark: #9E4F2A;
  --ink: #3A3A33;
  --muted: #7A7668;
  --line: #E6D9BC;
  --radius: 18px;
  --shadow: 0 6px 20px rgba(79, 91, 70, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: var(--terra); }
h1, h2, h3, .brand span { font-family: "Fredoka", "Nunito", sans-serif; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
main { max-width: 1160px; margin: 0 auto; padding: 0 16px 48px; outline: none; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ── Header ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px;
  background: rgba(243, 231, 205, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.menu-btn { display: grid; place-items: center; background: transparent; color: var(--green-dark); flex: none; }
.menu-btn:hover { background: var(--paper); }
.menu {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: min(320px, 86%);
  background: var(--cream-2); display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform .25s ease;
  box-shadow: 8px 0 30px rgba(0, 0, 0, .15);
}
.menu.open { transform: none; }
.menu-body { overflow-y: auto; padding: 8px 12px 24px; display: flex; flex-direction: column; gap: 2px; }
.menu-body > a, .menu-body > button {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  padding: 12px; border-radius: 12px; border: 0; background: none; cursor: pointer;
  text-decoration: none; text-align: left; color: var(--ink); font-weight: 700;
}
.menu-body > a:hover, .menu-body > button:hover { background: var(--cream); }
.menu-body > a[aria-current="true"] { background: var(--green); color: #fff; }
.menu-body > a[aria-current="true"] small { color: #fff; }
.menu-body small { color: var(--muted); font-weight: 600; }
.menu-label { margin: 14px 12px 4px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.menu-info { margin-top: 16px; padding: 12px; border-top: 1px solid var(--line); font-size: .92rem; color: var(--muted); }
.menu-info p { margin: 4px 0; }
.menu-info .btn { margin-top: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--terra); }
.brand img { border-radius: 12px; }
.brand span { font-size: 1.35rem; letter-spacing: .12em; }
.cart-btn {
  position: relative; display: flex; align-items: center; gap: 8px;
  background: var(--green); color: #fff; border: 0; border-radius: 999px;
  padding: 10px 16px; cursor: pointer; font-weight: 700;
}
.cart-btn:hover { background: var(--green-dark); }
.badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--terra); color: #fff; font-size: .8rem;
  display: inline-grid; place-items: center;
}
.shipbar {
  background: var(--green); color: #fff; text-align: center;
  padding: 8px 16px; font-size: .92rem; font-weight: 600;
}

/* ── Hero ── */
.hero {
  display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 32px;
  padding: 40px 0 24px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; margin: 0 0 12px; color: var(--green-dark); }
.hero h1 em { font-style: normal; color: var(--terra); }
.hero p { font-size: 1.1rem; margin: 0 0 20px; max-width: 46ch; }
.hero-img { justify-self: center; width: min(340px, 80%); border-radius: 32px; box-shadow: var(--shadow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 700; text-decoration: none; transition: background .15s, transform .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-dark); }
.btn-primary:disabled { background: #C9B79E; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--green-dark); border: 2px solid var(--green); }
.btn-ghost:hover { background: var(--cream-2); }
.btn-wa { background: #25D366; color: #fff; }
.btn-wa:hover { background: #1EBE5A; }
.btn-block { width: 100%; }

.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin: 8px 0 36px; padding: 0; list-style: none;
}
.steps li {
  background: var(--paper); border-radius: var(--radius); padding: 18px;
  border: 1px solid var(--line);
}
.steps b { display: block; font-family: "Fredoka", sans-serif; color: var(--terra); font-size: 1.1rem; margin-bottom: 4px; }

/* ── Catálogo ── */
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-title h2 { margin: 0; font-size: 1.8rem; color: var(--green-dark); }
.search {
  width: min(320px, 100%); padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
}
.search:focus, .field input:focus, .field select:focus, .field textarea:focus, .qty input:focus {
  outline: 2px solid var(--green); outline-offset: 1px;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 16px; scrollbar-width: none; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--green); background: transparent; color: var(--green-dark); font-weight: 600;
}
.chip[aria-pressed="true"] { background: var(--green); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; background: var(--paper);
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-img { position: relative; aspect-ratio: 1; background: var(--cream-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.02rem; line-height: 1.3; font-family: "Nunito", sans-serif; font-weight: 700; }
.card-desc {
  margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { margin-top: auto; display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.price { font-weight: 700; color: var(--terra); font-size: 1.15rem; }
.price-alt { color: var(--muted); font-size: .88rem; }
.tag {
  position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; background: var(--ink); color: #fff;
}
.tag-low { background: var(--terra); }
.card.soldout img { filter: grayscale(.8); opacity: .7; }
.add-mini {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--green); color: #fff; font-size: 1.4rem; line-height: 1;
}
.add-mini:hover { background: var(--green-dark); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* ── Categorías ── */
.catnav {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 16px; background: var(--cream-2); border-bottom: 1px solid var(--line);
}
.catnav a {
  flex: none; padding: 6px 14px; border-radius: 999px; text-decoration: none;
  color: var(--green-dark); font-weight: 700; font-size: .92rem;
}
.catnav a:hover { background: var(--cream); }
.catnav a[aria-current="true"] { background: var(--green); color: #fff; }
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 36px; }
.cat-tile {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: #fff; background: var(--green);
}
.cat-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.cat-tile:hover img { transform: scale(1.05); }
.cat-tile span {
  position: absolute; inset: auto 0 0 0; padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(58, 58, 51, .85));
}
.cat-tile b { display: block; font-family: "Fredoka", sans-serif; font-size: 1.15rem; }
.cat-tile small { opacity: .9; }
.cat-section { margin-bottom: 36px; }
.see-all { font-weight: 700; color: var(--terra); text-decoration: none; white-space: nowrap; }
.row {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 230px); gap: 16px;
  overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory;
}
.row > .card { scroll-snap-align: start; }
.cat-title { margin: 0; font-size: 1.9rem; color: var(--green-dark); }
.cat-title small { font-size: .95rem; color: var(--muted); font-family: "Nunito", sans-serif; font-weight: 600; }

/* ── Skeleton ── */
.skel { background: linear-gradient(90deg, var(--cream-2), #fff, var(--cream-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }

/* ── Producto ── */
.back { display: inline-block; margin: 20px 0 12px; color: var(--green-dark); font-weight: 700; text-decoration: none; }
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.gallery-main { aspect-ratio: 1; background: var(--paper); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 68px; height: 68px; padding: 0; border-radius: 12px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--paper); }
.thumbs button[aria-current="true"] { border-color: var(--terra); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product h1 { margin: 0 0 8px; font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--green-dark); line-height: 1.15; }
.product .price { font-size: 1.7rem; }
.desc { white-space: pre-line; margin: 16px 0; }
.stock-note { font-weight: 700; color: var(--green-dark); }
.stock-note.out { color: var(--terra-dark); }
.variants { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.variants button {
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 600;
  border: 1px solid var(--line); background: var(--paper);
}
.variants button[aria-pressed="true"] { border-color: var(--terra); background: var(--terra); color: #fff; }
.variants button:disabled { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.buy-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.qty button { width: 40px; height: 44px; border: 0; background: none; cursor: pointer; font-size: 1.2rem; }
.qty input { width: 44px; text-align: center; border: 0; background: none; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── Drawer ── */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(40, 40, 30, .4); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(420px, 100%);
  background: var(--cream-2); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
  box-shadow: -8px 0 30px rgba(0, 0, 0, .15);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; color: var(--green-dark); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--paper); cursor: pointer; font-size: 1.1rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 16px; }
.drawer-foot { padding: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; background: var(--paper); }
.line h4 { margin: 0 0 2px; font-size: .95rem; }
.line small { color: var(--muted); }
.line .qty button { width: 32px; height: 34px; font-size: 1rem; }
.line .qty input { width: 32px; }
.remove { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .85rem; text-decoration: underline; padding: 0; }
.totals { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 1.1rem; }
.totals small { display: block; text-align: right; color: var(--muted); font-weight: 600; font-size: .85rem; }

/* ── Checkout ── */
.checkout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: start; margin-top: 8px; }
.panel { background: var(--paper); border-radius: var(--radius); padding: 20px; border: 1px solid var(--line); }
.panel h2 { margin: 0 0 12px; color: var(--green-dark); font-size: 1.3rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 4px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: .92rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
}
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-row label {
  flex: 1; min-width: 140px; display: flex; gap: 8px; align-items: center; cursor: pointer;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 600;
}
.radio-row input { accent-color: var(--terra); }
.radio-row label:has(input:checked) { border-color: var(--terra); background: #FDF1EA; }
.error { color: #A33B1E; font-weight: 700; }
.success { text-align: center; max-width: 560px; margin: 40px auto; }
.success .big { font-size: 3rem; }
.ticket { display: inline-block; font-family: "Fredoka", sans-serif; font-size: 1.6rem; color: var(--terra); background: var(--paper); padding: 6px 18px; border-radius: 12px; border: 2px dashed var(--terra); margin: 8px 0 16px; }

/* ── Footer / toast ── */
.footer { text-align: center; padding: 32px 16px 40px; background: var(--cream-2); border-top: 1px solid var(--line); }
.footer img { margin: 0 auto 8px; border-radius: 16px; }
.footer p { margin: 4px 0; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px);
  background: var(--green-dark); color: #fff; padding: 12px 20px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font-weight: 700;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 24px; }
  .hero p { margin-inline: auto; }
  .hero-img { width: min(220px, 60%); grid-row: 1; }
  .steps { grid-template-columns: 1fr; }
  .product, .checkout { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .brand span { font-size: 1.05rem; }
  .brand img { width: 40px; height: 40px; }
  .cart-btn span:not(.badge) { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 10px; }
  .card-body h3 { font-size: .92rem; }
  .price { font-size: 1rem; }
  .add-mini { width: 34px; height: 34px; font-size: 1.2rem; }
  .row { grid-auto-columns: 46%; gap: 12px; }
  .cat-tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
