:root {
  --fondo: #f6f4ec;
  --tarjeta: #ffffff;
  --texto: #1f2a22;
  --suave: #5c6b60;
  --borde: #dcd9cc;
  --verde: #2f6b3f;
  --verde-oscuro: #224f2e;
  --verde-claro: #e3efe2;
  --acento: #b4532a;
  --error: #a3271c;
  --radio: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.contenedor { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.suave { color: var(--suave); }
.chico { font-size: 0.875rem; }
.precio { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Botones */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--verde); border-radius: 999px;
  background: var(--verde); color: #fff; font-weight: 600; text-decoration: none;
}
.boton:hover { background: var(--verde-oscuro); }
.boton:disabled { opacity: 0.55; cursor: default; }
.boton.claro { background: transparent; color: var(--verde); }
.boton.claro:hover { background: var(--verde-claro); }
.boton.peligro { background: transparent; border-color: var(--error); color: var(--error); }
.boton.ancho { width: 100%; }
.enlace { background: none; border: 0; padding: 0; color: var(--verde); text-decoration: underline; }

/* Formularios */
label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type="text"], input[type="tel"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--borde); border-radius: 10px; background: #fff;
}
textarea { min-height: 84px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid #8fbf9a; outline-offset: 2px;
}
.campo { margin-bottom: 14px; }
.aviso { padding: 10px 14px; border-radius: 10px; background: var(--verde-claro); }
.aviso.error { background: #f8e3df; color: var(--error); }

/* Encabezado de la tienda */
.encabezado {
  position: sticky; top: 0; z-index: 5;
  background: var(--fondo); border-bottom: 1px solid var(--borde);
}
.encabezado .contenedor { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.marca { font-family: Georgia, serif; font-size: 1.35rem; font-weight: 700; color: var(--verde-oscuro); }
.portada { display: grid; gap: 20px; padding: 28px 0 8px; }
.portada h1 { font-size: clamp(1.7rem, 5vw, 2.8rem); max-width: 18ch; }
.portada p { margin-top: 8px; max-width: 56ch; }
.portada-fotos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.portada-fotos img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: var(--verde-claro); }
@media (min-width: 800px) {
  .portada { grid-template-columns: 1fr 1.15fr; align-items: center; gap: 40px; padding-top: 40px; }
  .portada-fotos { gap: 12px; }
  .portada-fotos img:nth-child(odd) { transform: translateY(14px); }
}

.filtros { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 4px; }
.filtro {
  flex: none; padding: 8px 14px; min-height: 40px;
  border: 1px solid var(--borde); border-radius: 999px; background: #fff;
}
.filtro[aria-pressed="true"] { background: var(--verde); border-color: var(--verde); color: #fff; }

.grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; padding: 16px 0 40px; }
@media (min-width: 700px) { .grilla { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; } }
.tarjeta {
  display: flex; flex-direction: column;
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden;
}
.tarjeta .foto { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; background: var(--verde-claro); }
.tarjeta .abrir { background: none; border: 0; padding: 0; text-align: left; }
.tarjeta .datos { padding: 10px 12px 0; }
.tarjeta h3 { font-size: 1.05rem; }
.tarjeta .pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 12px; margin-top: auto; }
.tarjeta .pie .boton { flex: 1 1 auto; min-height: 40px; padding: 6px 14px; }
.vacio { padding: 48px 0; text-align: center; }

/* Ventanas */
dialog {
  width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: var(--radio); color: var(--texto); background: var(--tarjeta);
}
dialog::backdrop { background: rgba(20, 30, 22, 0.55); }
.ventana { padding: 20px; }
.ventana-titulo { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cerrar { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--verde-claro); font-size: 1.2rem; }
.ficha-foto { width: 100%; max-height: 360px; object-fit: cover; border-radius: 10px; margin-bottom: 14px; }
.cuidados { display: grid; gap: 10px; margin: 14px 0; padding: 0; list-style: none; }
.cuidados li { padding: 10px 12px; background: var(--fondo); border-radius: 10px; }
.cuidados b { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--suave); }

.renglon { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--borde); }
.renglon img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.renglon .info { flex: 1; min-width: 0; }
.cantidad { display: inline-flex; align-items: center; gap: 4px; }
.cantidad button { width: 40px; height: 40px; border: 1px solid var(--borde); border-radius: 50%; background: #fff; font-size: 1.2rem; }
.cantidad span { min-width: 28px; text-align: center; font-weight: 600; }
.totales { margin: 14px 0; }
.totales div { display: flex; justify-content: space-between; padding: 4px 0; }
.totales .total { font-size: 1.2rem; font-weight: 700; border-top: 1px solid var(--borde); margin-top: 6px; padding-top: 10px; }
.opciones { display: grid; gap: 8px; margin-bottom: 14px; }
.opcion { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--borde); border-radius: 10px; font-weight: 400; margin: 0; }
.opcion:has(input:checked) { border-color: var(--verde); background: var(--verde-claro); }
.opcion input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--verde); }
.opcion .costo { margin-left: auto; font-weight: 700; white-space: nowrap; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 8px; }

.pie-pagina { border-top: 1px solid var(--borde); padding: 20px 0 32px; }
