/* Catálogo de sombreros SensStyle — teléfono primero, luego tablet y computador.
   Colores tomados de la web de SensStyle (ink, parchment, saddle, gold). */
@font-face {
  font-family: "Playfair Display"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fuentes/playfair-display-latin-700-normal.woff2") format("woff2");
}
:root {
  --fondo: #fbf6ec;          /* parchment */
  --crema: #f5ede0;          /* cream */
  --tarjeta: #ffffff;
  --tinta: #1b120a;          /* ink */
  --carbon: #3a2b1e;         /* charcoal */
  --suave: #6b5a46;          /* muted */
  --tenue: #9c8b75;
  --linea: #efe4d2;          /* bone */
  --linea-fuerte: #d9c9ad;
  --arena: #e6d6bb;          /* sand */
  --acento: #8a5a2e;         /* saddle-300 */
  --acento-osc: #6b3f1d;     /* saddle-500 */
  --acento-suave: #f6e7c0;   /* gold-50 */
  --oro: #d4a94a;            /* gold-300 */
  --oro-claro: #ebd28c;      /* gold-100 */
  --oro-osc: #8a6220;        /* gold-700 */
  --ok: #3e5c3a;
  --error: #9b3b25;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(27, 18, 10, .05), 0 2px 8px rgba(27, 18, 10, .045);
  --letra: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --letra-marca: "Playfair Display", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 124px; scroll-padding-bottom: 104px; }
html.bloqueado { overflow: hidden; }
body {
  margin: 0; background: var(--fondo); color: var(--tinta);
  font: 15px/1.45 var(--letra);
  -webkit-font-smoothing: antialiased;
}
body.con-barra { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
img { max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(138, 90, 46, .45); outline-offset: 2px; }

.envoltura { width: 100%; max-width: 1400px; margin: 0 auto; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
.saltar { position: absolute; left: -999px; top: 8px; background: var(--tinta); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.saltar:focus { left: 8px; }

/* ---------- cabecera ---------- */
.cabecera {
  background: var(--tinta); color: var(--fondo);
  padding: 16px 0 18px; border-bottom: 3px solid var(--oro);
  background-image: radial-gradient(120% 140% at 0% 0%, rgba(212, 169, 74, .16), transparent 55%);
}
.marca { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.logo { display: block; flex: none; height: 50px; width: auto; }
.logo-texto { font: 700 26px/1 var(--letra-marca); color: var(--oro); }
.marca h1 { margin: 0; font: 700 22px/1.15 var(--letra-marca); letter-spacing: .005em; color: var(--fondo); }
.intro { margin: 5px 0 0; color: var(--arena); font-size: 13.5px; line-height: 1.45; }
.intro b { color: var(--oro-claro); }

/* ---------- filtros ---------- */
.filtros {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251, 246, 236, .93);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--linea);
}
.filtros-fila { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 10px; padding-bottom: 10px; }
.buscar { position: relative; flex: 1 1 100%; display: block; }
.buscar svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; fill: none; stroke: var(--tenue); stroke-width: 2.2; stroke-linecap: round; pointer-events: none; }
.buscar input {
  width: 100%; height: 42px; padding: 0 12px 0 38px; font-size: 16px;
  background: var(--tarjeta); border: 1px solid var(--linea-fuerte); border-radius: 12px; outline: none;
}
.buscar input:focus { border-color: var(--acento); box-shadow: 0 0 0 3px rgba(138, 90, 46, .16); }
.chips { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1 1 100%; min-width: 0; padding: 1px; }
.chips::-webkit-scrollbar { display: none; }
.chips.hay-mas { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.chip {
  flex: none; display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--linea-fuerte); background: var(--tarjeta); color: var(--tinta); font-size: 14px; font-weight: 600;
}
.chip[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: var(--fondo); padding-right: 10px; }
.chip[aria-pressed="true"]::after { content: "\00d7"; margin-left: 7px; font-size: 17px; line-height: 1; font-weight: 400; opacity: .85; }
.chips-sep { flex: none; width: 1px; height: 22px; margin: 0 4px; background: var(--linea-fuerte); }

/* ---------- lista ---------- */
.lista { padding-top: 6px; padding-bottom: 28px; min-height: 50vh; }
.estado-carga, .vacio { text-align: center; color: var(--suave); padding: 48px 12px; }
.vacio .btn { margin-top: 12px; }
.seccion { margin-top: 18px; scroll-margin-top: 120px; }
.sec-cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 2px 10px; }
.sec-cab h2 { margin: 0; font: 700 20px/1.2 var(--letra-marca); letter-spacing: .005em; color: var(--tinta); }
.sec-cab p { margin: 0; color: var(--suave); font-size: 13px; }
.sec-cab .sec-sub::after { content: " · "; }
.rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------- tarjeta ---------- */
.tarjeta {
  container-type: inline-size;
  display: flex; flex-direction: column;
  background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra);
  overflow: hidden; scroll-margin-top: 130px; transition: border-color .15s, box-shadow .15s;
}
.tarjeta.activa { border-color: var(--acento); box-shadow: 0 0 0 1px var(--acento), var(--sombra); }
.tarjeta.resaltar { animation: resaltar 1.4s ease-out; }
@keyframes resaltar { 0%, 30% { box-shadow: 0 0 0 4px rgba(212, 169, 74, .85); } 100% { box-shadow: var(--sombra); } }
.foto {
  display: block; width: 100%; aspect-ratio: 1 / 1; padding: 0; border: 0; background: #fff;
  border-bottom: 1px solid var(--linea); cursor: zoom-in;
}
.foto img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sin-foto { display: grid; place-items: center; height: 100%; color: var(--tenue); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; background: var(--crema); }
.info { padding: 9px 10px 2px; }
.fila-sku { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.sku { font-weight: 800; font-size: 14px; letter-spacing: .01em; }
.modelo {
  display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--acento-suave); color: var(--acento-osc);
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1.7;
}
.desc {
  margin: 5px 0 0; color: var(--suave); font-size: 12.5px; line-height: 1.38;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.tallas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 8px 10px 10px; margin-top: auto; }
@container (min-width: 250px) { .tallas.n6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; } }
.talla { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; }
.talla span { text-align: center; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; color: var(--suave); }
.talla input {
  width: 100%; min-width: 0; height: 38px; padding: 0 2px; text-align: center; font-size: 16px; font-weight: 600;
  border: 1.5px solid var(--linea-fuerte); border-radius: 8px; background: #fff; outline: none; -moz-appearance: textfield; appearance: textfield;
}
.talla input:focus { border-color: var(--acento); box-shadow: 0 0 0 3px rgba(138, 90, 46, .2); }
.talla.lleno input { border-color: var(--acento); background: var(--acento-suave); color: var(--acento-osc); font-weight: 800; }
.talla.lleno span { color: var(--acento-osc); }
.en-pedido {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin: -2px 10px 10px; padding: 6px 9px; border-radius: 9px; background: var(--acento-suave); color: var(--acento-osc); font-size: 12.5px;
}
.en-pedido > span { white-space: nowrap; }
.link { padding: 2px 0; border: 0; background: none; color: var(--acento); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.link-peligro { color: var(--error); }

/* ---------- pie ---------- */
.pie { padding-top: 8px; padding-bottom: 28px; color: var(--suave); font-size: 13px; text-align: center; }
.pie a { color: var(--acento); }

/* ---------- barra del pedido ---------- */
.barra-pedido {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom)); width: min(640px, calc(100% - 24px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 18px; border-radius: 18px; background: var(--tinta); color: var(--fondo);
  border: 1px solid rgba(212, 169, 74, .35); box-shadow: 0 10px 30px rgba(27, 18, 10, .3); animation: subir .2s ease-out;
}
@keyframes subir { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.bp-info { font-size: 15px; line-height: 1.25; }
.bp-info b { font-size: 20px; }
.bp-refs { color: var(--arena); font-size: 13px; display: block; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 12px; border: 0; font-weight: 800; font-size: 15px; white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn-acento { background: var(--acento); color: #fff; }
.btn-acento:hover:not(:disabled) { background: var(--acento-osc); }
.btn-claro { background: var(--oro); color: var(--tinta); }
.btn-claro:hover { background: var(--oro-claro); }
.btn-borde { background: var(--tarjeta); color: var(--tinta); border: 1px solid var(--linea-fuerte); }
.btn-grande { width: 100%; height: 52px; font-size: 16px; }
.btn-icono {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0;
  border: 0; border-radius: 999px; background: var(--crema); color: var(--tinta);
}
.btn-icono svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.btn-icono:hover { background: var(--linea); }

/* ---------- hoja del pedido ---------- */
dialog { border: 0; padding: 0; color: var(--tinta); }
dialog::backdrop { background: rgba(27, 18, 10, .55); }
.hoja {
  width: 100%; max-width: 100%; max-height: 92dvh; margin: auto auto 0; border-radius: 20px 20px 0 0;
  background: var(--tarjeta); overflow: hidden;
}
.hoja[open] { animation: hoja-sube .22s ease-out; }
@keyframes hoja-sube { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.hoja-caja { display: flex; flex-direction: column; max-height: 92dvh; }
.hoja-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--linea); }
.hoja-cab h2 { margin: 0; font: 700 20px/1.2 var(--letra-marca); }
.hoja-cuerpo { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 18px calc(18px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.lineas { list-style: none; margin: 0; padding: 0; }
.linea { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.linea.con-error { background: #f8e6e0; border-radius: 10px; padding-left: 6px; padding-right: 6px; }
.linea img { width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--linea); border-radius: 9px; background: #fff; }
.linea-sku { padding: 0; border: 0; background: none; font-weight: 800; font-size: 14px; text-align: left; text-decoration: underline; text-decoration-color: var(--linea-fuerte); text-underline-offset: 3px; }
.linea-modelo { color: var(--suave); font-size: 12px; margin-left: 4px; }
.linea-tallas { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip-talla { padding: 1px 7px; border-radius: 6px; background: var(--acento-suave); color: var(--acento-osc); font-size: 12px; white-space: nowrap; }
.linea-total { font-weight: 800; font-size: 17px; min-width: 28px; text-align: right; }
.linea .btn-icono { width: 34px; height: 34px; }
.linea .btn-icono svg { width: 16px; height: 16px; }
.total-pedido { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 4px; font-size: 15px; }
.form h3 { margin: 18px 0 10px; font-size: 16px; }
.campo { display: block; margin-bottom: 12px; }
.campo > span { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 5px; }
.campo i { font-style: normal; font-weight: 500; color: var(--tenue); }
.campo input, .campo textarea {
  width: 100%; font-size: 16px; padding: 10px 12px; border: 1px solid var(--linea-fuerte); border-radius: 11px; background: #fff; outline: none;
}
.campo input { height: 46px; }
.campo textarea { resize: vertical; min-height: 76px; }
.campo input:focus, .campo textarea:focus { border-color: var(--acento); box-shadow: 0 0 0 3px rgba(138, 90, 46, .16); }
.campo.mal input { border-color: var(--error); }
.error { display: block; min-height: 0; color: var(--error); font-size: 13px; margin-top: 4px; }
.error:empty { display: none; }
.trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.aviso-error { margin: 4px 0 12px; padding: 10px 12px; border-radius: 10px; background: #f8e6e0; color: var(--error); font-size: 14px; }
.nota { margin: 10px 0 0; color: var(--tenue); font-size: 12.5px; text-align: center; }
.enviado { text-align: center; padding: 18px 4px 6px; }
.ok-icono { width: 64px; height: 64px; margin: 6px auto 10px; border-radius: 999px; background: #e4ebdd; display: grid; place-items: center; }
.ok-icono svg { width: 34px; height: 34px; fill: none; stroke: var(--ok); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.enviado h3 { margin: 0 0 8px; font: 700 24px/1.2 var(--letra-marca); }
.enviado p { margin: 0 0 10px; color: var(--suave); }
.ok-numero b { color: var(--tinta); font-size: 17px; letter-spacing: .02em; }
.enviado .btn { margin-top: 12px; }

/* ---------- foto grande ---------- */
.zoom { background: transparent; max-width: min(560px, calc(100% - 24px)); width: 100%; margin: auto; overflow: visible; }
.zoom::backdrop { background: rgba(20, 18, 15, .78); }
.zoom-caja { position: relative; background: #fff; border-radius: 18px; overflow: hidden; }
.zoom img { display: block; width: 100%; height: auto; max-height: 68dvh; object-fit: contain; background: #fff; }
.zoom-cerrar { position: absolute; top: 10px; right: 10px; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.zoom-info { padding: 12px 16px 16px; border-top: 1px solid var(--linea); }
.zoom-info b { font-size: 16px; }
.zoom-info p { margin: 6px 0 0; color: var(--suave); font-size: 14px; }
.noscript { padding: 24px; }

/* ---------- tablet y computador ---------- */
@media (min-width: 560px) {
  .rejilla { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .marca { flex-direction: row; align-items: center; gap: 22px; }
  .marca-texto { padding-left: 22px; border-left: 1px solid rgba(212, 169, 74, .35); }
  .logo { height: 60px; }
  .marca h1 { font-size: 26px; }
  .buscar { flex: 1 1 260px; max-width: 380px; }
  .chips { flex: 1 1 auto; flex-wrap: wrap; overflow: visible; }
  .chips.hay-mas { -webkit-mask-image: none; mask-image: none; }
}
@media (min-width: 640px) {
  .hoja { max-width: 580px; max-height: 88dvh; margin: auto; border-radius: 20px; }
  .hoja-caja { max-height: 88dvh; }
  .barra-pedido { padding-left: 22px; }
  .bp-refs { display: inline; margin-left: 2px; }
}
@media (min-width: 900px) {
  .rejilla { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .cabecera { padding: 26px 0 16px; }
  .marca h1 { font-size: 30px; }
  .logo { height: 68px; }
  .intro { font-size: 14.5px; }
  .sec-cab h2 { font-size: 21px; }
  .seccion { margin-top: 26px; }
}
@media (min-width: 1240px) {
  .rejilla { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (hover: hover) {
  .tarjeta:hover { box-shadow: 0 2px 4px rgba(27, 18, 10, .06), 0 8px 22px rgba(27, 18, 10, .08); }
  .chip:hover:not([aria-pressed="true"]) { border-color: var(--tinta); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
