/*
  Structure shared by every store. Each theme (stores/<slug>/theme.css) sets the tokens below
  and adds its own decoration; this file never hardcodes a store's colors or fonts.
*/
:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --ink: #1f1f1f;
  --muted: #6b6b6b;
  --line: #e7e1d7;
  --brand: #222222;
  --brand-ink: #ffffff;
  --accent: #c0392b;
  --accent-ink: #ffffff;
  --wa: #1fa855;
  --font-display: Georgia, serif;
  --font-body: system-ui, sans-serif;
  --radius: 18px;
  --radius-sm: 10px;
  --card-ratio: 4 / 3;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px -12px rgb(0 0 0 / 0.18);
  --gutter: 16px;
  --header-h: 60px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 56px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.has-cart-bar {
  padding-bottom: 84px;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  background: var(--surface);
  padding: 8px 12px;
}
.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.narrow {
  max-width: 620px;
}
.muted {
  color: var(--muted);
}
.center {
  text-align: center;
}
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ---------- top ---------- */
.aviso {
  background: var(--brand);
  color: var(--brand-ink);
  text-align: center;
  font-size: 0.88rem;
  padding: 8px var(--gutter);
}
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  height: var(--header-h);
  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 {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  white-space: nowrap;
}
.cart-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink);
}
.cart-count {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.2s ease,
    opacity 0.2s;
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
}
.btn-ghost {
  border-color: currentColor;
  background: transparent;
}
.btn-wa {
  background: var(--wa);
  color: #fff;
  font-size: 1.08rem;
}
.btn-block {
  width: 100%;
}
.link-btn {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- hero ---------- */
.hero {
  padding: 28px 0 8px;
}
.hero-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-tagline {
  max-width: 34ch;
  font-size: 1.12rem;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

/* ---------- info strip ---------- */
.info {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  margin: 22px auto 0;
}
.info li {
  font-size: 0.86rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* ---------- catalog ---------- */
.catalog {
  padding: 44px 0 24px;
}
.catalog-title {
  text-align: center;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  margin-bottom: 18px;
}
.cat-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 15;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 0;
  margin-bottom: 8px;
}
.cat-nav-in {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: safe center;
}
.cat-nav-in::-webkit-scrollbar {
  display: none;
}
.cat-nav a {
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  font-size: 0.92rem;
  white-space: nowrap;
}
.cat {
  padding: 22px 0 10px;
}
.cat-head {
  margin-bottom: 16px;
}
.cat-name {
  font-size: 1.6rem;
}
.cat-desc {
  color: var(--muted);
  margin-top: 6px;
}
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (min-width: 720px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
  }
}
@media (min-width: 1040px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
  }
  .card:hover .card-img img {
    transform: scale(1.04);
  }
}
.card-img {
  position: relative;
  aspect-ratio: var(--card-ratio);
  overflow: hidden;
  background: var(--line);
}
.card-img img,
.card-img .ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.card.is-out .card-img img {
  filter: grayscale(0.7);
  opacity: 0.7;
}
.badge-out {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.75rem;
}
.card-body {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.card-name {
  font-size: 1.1rem;
}
.card-opts {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}
.card-price {
  margin-top: auto;
  padding-top: 6px;
  font-size: 0.95rem;
}
.card-price .from,
.card-price .unit {
  color: var(--muted);
  font-size: 0.8rem;
}
.price {
  font-weight: 700;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 0;
}

/* placeholder for products without photo */
.ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: var(--line);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1rem;
}

/* ---------- how to ---------- */
.howto {
  padding: 40px 0 56px;
}
.howto-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 22px;
}
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 14px;
  align-items: start;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: var(--brand-ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.steps strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.steps span {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- product ---------- */
.product {
  padding-top: 14px;
  padding-bottom: 48px;
}
.back {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 6px 0 12px;
}
.product-grid {
  display: grid;
  gap: 22px;
}
@media (min-width: 860px) {
  .product-grid {
    grid-template-columns: 1.1fr 1fr;
    gap: 44px;
    align-items: start;
  }
  .buy {
    position: sticky;
    top: calc(var(--header-h) + 20px);
  }
}
.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter));
}
@media (min-width: 620px) {
  .gallery {
    margin: 0;
    border-radius: var(--radius);
  }
}
.gallery::-webkit-scrollbar {
  display: none;
}
.gallery-item {
  scroll-snap-align: start;
  aspect-ratio: var(--card-ratio);
  background: var(--line);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-name {
  font-size: clamp(2rem, 7vw, 2.8rem);
}
.product-price {
  margin-top: 10px;
  font-size: 1.35rem;
}
.product-price .unit,
.product-price .range {
  color: var(--muted);
  font-size: 0.95rem;
}
.product-desc {
  margin-top: 14px;
  color: var(--muted);
}
.opt,
.field-set {
  border: 0;
  padding: 0;
  margin: 22px 0 0;
}
.opt legend,
.field-set legend {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  padding: 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  position: relative;
  cursor: pointer;
}
.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.chip span {
  display: inline-block;
  min-width: 48px;
  text-align: center;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--surface);
  transition:
    border-color 0.15s,
    background 0.15s;
}
.chip input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-ink);
}
.chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.chip.is-dim span {
  color: var(--muted);
  border-style: dashed;
}
.chip.is-out span {
  color: var(--muted);
  text-decoration: line-through;
  opacity: 0.6;
}
.stock-note {
  min-height: 1.4em;
  margin-top: 12px;
  color: var(--accent);
  font-size: 0.9rem;
}
.buy-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.btn-add {
  flex: 1;
}
.qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  height: 50px;
}
.qty input {
  width: 40px;
  border: 0;
  background: none;
  text-align: center;
  font-weight: 600;
  -moz-appearance: textfield;
  appearance: textfield;
}
.qty input::-webkit-inner-spin-button {
  display: none;
}
.qty-btn {
  width: 44px;
  height: 100%;
  border: 0;
  background: none;
  font-size: 1.3rem;
  cursor: pointer;
}
.qty-btn:disabled {
  opacity: 0.3;
}
.qty-sm {
  height: 36px;
}
.qty-sm .qty-btn {
  width: 34px;
  font-size: 1.1rem;
}
.qty-sm span {
  min-width: 22px;
  text-align: center;
  font-weight: 600;
}
.policy {
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- checkout ---------- */
.page-title {
  font-size: clamp(1.9rem, 6.5vw, 2.6rem);
  margin: 10px 0 18px;
}
.checkout {
  padding-top: 12px;
  padding-bottom: 56px;
}
.checkout-grid {
  display: grid;
  gap: 22px;
}
@media (min-width: 900px) {
  .checkout-grid {
    grid-template-columns: 1.15fr 1fr;
    gap: 40px;
    align-items: start;
  }
  .order-form {
    position: sticky;
    top: calc(var(--header-h) + 16px);
  }
}
.lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.line {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.line-img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--line);
}
.line-img img,
.line-img .ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.line-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.line-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  text-decoration: none;
}
.line-opts,
.line-unit {
  font-size: 0.82rem;
  color: var(--muted);
}
.line-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.line-total {
  font-size: 0.95rem;
}
.empty-cart {
  text-align: center;
  padding: 36px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  display: grid;
  gap: 16px;
  justify-items: center;
}
.problems {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--ink);
  font-size: 0.92rem;
  display: grid;
  gap: 4px;
}
.order-form {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 20px 18px 22px;
  display: grid;
  gap: 14px;
}
.form-title {
  font-size: 1.35rem;
}
.field {
  display: grid;
  gap: 6px;
}
.field > span {
  font-size: 0.88rem;
  font-weight: 500;
}
.field em {
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
}
.field input,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--bg);
  font-size: 16px;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
}
.field-set {
  margin: 0;
}
.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}
.totals {
  margin: 6px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 6px;
}
.totals > div {
  display: flex;
  justify-content: space-between;
}
.totals dt {
  color: var(--muted);
}
.totals dd {
  margin: 0;
}
.totals .total dt,
.totals .total dd {
  color: var(--ink);
  font-weight: 700;
  font-size: 1.2rem;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--accent);
  font-size: 0.92rem;
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--brand);
  flex: none;
}
.notice {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  font-size: 0.92rem;
  line-height: 1.45;
}
.form-error {
  color: var(--accent);
  font-weight: 500;
}

/* ---------- confirmation ---------- */
.confirm {
  padding-top: 26px;
  padding-bottom: 60px;
  display: grid;
  gap: 16px;
}
.confirm .page-title {
  margin: 0;
}
.lead {
  font-size: 1.05rem;
  color: var(--muted);
}
.receipt {
  list-style: none;
  margin: 8px 0 0;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.receipt li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.receipt small {
  display: block;
  color: var(--muted);
}
.receipt .ship {
  color: var(--muted);
}
.receipt .total {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  font-weight: 700;
  font-size: 1.12rem;
}
.facts {
  margin: 0;
  display: grid;
  gap: 8px;
}
.facts > div {
  display: grid;
  grid-template-columns: 90px 1fr;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
}

/* ---------- prose pages ---------- */
.prose {
  padding-bottom: 56px;
}
.prose h2 {
  font-size: 1.4rem;
  margin: 26px 0 8px;
}
.prose p,
.prose li {
  color: var(--ink);
}
.prose ul {
  padding-left: 1.2em;
  margin: 0;
}

/* ---------- upload ---------- */
.upload-pick {
  margin-top: 18px;
}
.upload-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 8px;
}
.upload-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
}
.upload-list img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.upload-list .err {
  color: var(--accent);
}

/* ---------- footer ---------- */
.foot {
  background: var(--brand);
  color: var(--brand-ink);
  padding: 36px 0 calc(28px + env(safe-area-inset-bottom));
}
.foot-in {
  display: grid;
  gap: 20px;
}
.foot-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.foot-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.foot-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.foot-city {
  opacity: 0.75;
  font-size: 0.9rem;
}
.foot-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}
.foot-links a {
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, currentColor 35%, transparent);
}
.foot-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  font-size: 0.82rem;
  opacity: 0.85;
}
.arrepentimiento {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid currentColor;
  text-decoration: none;
  font-weight: 600;
}

/* ---------- floating ---------- */
.cart-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 30;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  text-decoration: none;
  box-shadow: 0 12px 30px -10px rgb(0 0 0 / 0.45);
  animation: rise 0.3s ease;
}
.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  top: calc(var(--header-h) + 10px);
  z-index: 40;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.25s,
    transform 0.25s;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast small {
  opacity: 0.75;
}
.toast a {
  font-weight: 700;
  white-space: nowrap;
}
@keyframes rise {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
