:root {
  --fondo: #FFFFFF;
  --suave: #F6F5F2;
  --tinta: #1B1B1F;
  --sutil: #5C5B60;
  --borde: #EFEDE8;
  --borde-fuerte: #D3D0C8;
  --acento: #A3204F;
  --acento-oscuro: #7E1239;
  --rosa: #F6DDE7;
  --verde: #17603A;  --verde-fondo: #DFF1E6;
  --ambar: #5E3B00;  --ambar-fondo: #FBEFD5;
  --rojo: #8E1F1F;   --rojo-fondo: #FDECEA;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font-family: 'DM Sans', system-ui, sans-serif; font-size: 16px; line-height: 1.4; }
a { color: var(--acento); text-decoration: none; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.serif { font-family: 'Fraunces', Georgia, serif; }

/* Cabecera */
.cabecera { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,0.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--borde); display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.marca { font-family: 'Fraunces', Georgia, serif; font-size: 24px; font-weight: 700; color: var(--tinta); letter-spacing: -0.01em; min-height: 44px; display: flex; align-items: center; }
.cabecera-acciones { display: flex; align-items: center; gap: 6px; }
.enlace { min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; font-size: 14px; font-weight: 600; }
.carrito-icono { position: relative; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--tinta); }
.burbuja { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--acento); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.vista { max-width: 560px; margin: 0 auto; padding: 16px 16px 120px; display: flex; flex-direction: column; gap: 18px; }

/* Piezas */
.banner { background: var(--tinta); color: #fff; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.banner h2 { font-family: 'Fraunces', Georgia, serif; font-size: 22px; }
.banner p { color: #D9D8DD; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.desliza { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.chip { flex-shrink: 0; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--borde-fuerte); background: #fff; color: var(--tinta); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.chip.activo { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.chip:disabled { border-style: dashed; color: #8E8D93; text-decoration: line-through; cursor: not-allowed; background: #fff; }

.rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
.tarjeta-prenda { display: flex; flex-direction: column; gap: 4px; color: var(--tinta); }
.foto { aspect-ratio: 3 / 4; border-radius: 14px; background: var(--suave); overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; color: #8E8D93; font-weight: 700; }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto .marca-agua { font-size: 13px; }
.etiqueta { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; display: inline-block; }
.foto .etiqueta { position: absolute; left: 8px; bottom: 8px; background: #fff; color: var(--rojo); }
.nombre { font-size: 15px; font-weight: 600; }
.sutil { color: var(--sutil); font-size: 13px; }
.precio { font-size: 17px; font-weight: 700; }
.precio-promo { font-size: 13px; font-weight: 700; color: var(--acento-oscuro); }

.galeria { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; margin: 0 -16px; padding: 0 16px; }
.galeria .foto { flex: 0 0 88%; scroll-snap-align: center; }
.titulo { font-family: 'Fraunces', Georgia, serif; font-size: 28px; font-weight: 700; line-height: 1.15; }
.bloque { display: flex; flex-direction: column; gap: 10px; }
.bloque-titulo { font-size: 12px; font-weight: 700; color: var(--sutil); letter-spacing: 0.05em; text-transform: uppercase; }
.caja { background: var(--suave); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.linea { display: flex; justify-content: space-between; gap: 10px; }
.total { font-family: 'Fraunces', Georgia, serif; font-size: 26px; font-weight: 700; }

.boton { min-height: 52px; width: 100%; border-radius: 14px; border: 0; background: var(--acento); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; text-align: center; }
.boton:hover { background: var(--acento-oscuro); }
.boton.secundario { background: #fff; color: var(--tinta); border: 1px solid var(--borde-fuerte); }
.boton.oscuro { background: var(--tinta); }
.boton.chico { min-height: 44px; width: auto; font-size: 14px; }
.boton:disabled { background: #ECEAE5; color: #6E6D72; border: 0; cursor: not-allowed; }
.barra-fija { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; background: rgba(255,255,255,0.97); border-top: 1px solid var(--borde); padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
.barra-fija > div { max-width: 528px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }

.item { display: flex; gap: 12px; align-items: center; }
.item .foto { width: 72px; flex-shrink: 0; border-radius: 10px; font-size: 11px; }
.item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cantidad { display: flex; align-items: center; gap: 4px; }
.cantidad button { width: 40px; height: 40px; border-radius: 20px; border: 1px solid var(--borde-fuerte); background: #fff; font-size: 18px; font-weight: 700; cursor: pointer; color: var(--tinta); }
.cantidad span { min-width: 22px; text-align: center; font-weight: 700; }

label { font-size: 14px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 48px; border: 1px solid var(--borde-fuerte); border-radius: 12px; padding: 0 14px; font: inherit; font-size: 16px; background: #fff; color: var(--tinta); }
input:focus, select:focus { outline: 2px solid var(--acento); outline-offset: 1px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.fila-campos { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
.ref4 { width: 150px; font-size: 22px; font-weight: 700; letter-spacing: 0.3em; }

.nota { border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 600; }
.nota.verde { background: var(--verde-fondo); color: var(--verde); }
.nota.ambar { background: var(--ambar-fondo); color: var(--ambar); }
.nota.rojo { background: var(--rojo-fondo); color: var(--rojo); }
.nota.gris { background: var(--suave); color: #46454B; font-weight: 500; }

.datos-pago { white-space: pre-line; font-size: 15px; color: #2F2E33; }
.subir { min-height: 56px; border-radius: 12px; border: 1px dashed var(--acento); background: #FBF4F7; color: var(--acento); font: inherit; font-weight: 700; cursor: pointer; width: 100%; }
.subir.listo { border: 1px solid var(--verde); background: var(--verde-fondo); color: var(--verde); }
.miniatura { width: 72px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--borde); }

.pasos { display: flex; flex-direction: column; }
.paso { display: flex; gap: 14px; }
.paso-marca { display: flex; flex-direction: column; align-items: center; width: 20px; }
.punto { width: 18px; height: 18px; border-radius: 9px; background: #fff; border: 2px solid var(--borde-fuerte); flex-shrink: 0; }
.paso.hecho .punto { background: var(--verde); border-color: var(--verde); }
.paso.actual .punto { background: var(--acento); border-color: var(--acento); box-shadow: 0 0 0 4px var(--rosa); }
.raya { flex: 1; width: 2px; min-height: 22px; background: #E4E2DC; }
.paso.hecho .raya { background: var(--verde); }
.paso:last-child .raya { display: none; }
.paso-texto { padding-bottom: 16px; display: flex; flex-direction: column; gap: 2px; }
.paso-texto b { font-weight: 500; color: #8E8D93; }
.paso.hecho .paso-texto b, .paso.actual .paso-texto b { font-weight: 700; color: var(--tinta); }

.vacio { text-align: center; color: var(--sutil); padding: 36px 8px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.cargando { color: var(--sutil); text-align: center; padding: 40px 0; }

.aviso { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; max-width: calc(100% - 32px); z-index: 10; text-align: center; }
.aviso.error { background: #B42318; }
