/* Soy Resinator · portal B2C
   Oscuro por defecto; [data-theme="light"] para el modo claro. */

:root,
:root[data-theme="dark"] {
  --bg: #0B0800;
  --bg-2: #120e05;
  --surface: #17120a;
  --surface-2: #211a0f;
  --line: #33291a;
  --text: #EDEAE4;
  --muted: #B6B5B2;
  --gold: #A77F41;
  --gold-hi: #C59B5B;
  --on-gold: #0B0800;
  --danger: #E07B6A;
  --focus: #E2B977;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --ph-a: #1d170d;
  --ph-b: #0f0b04;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F4F0E8;
  --bg-2: #ECE6DA;
  --surface: #FFFDF9;
  --surface-2: #EFE9DE;
  --line: #D8CEBC;
  --text: #1A150C;
  --muted: #57524A;
  --gold: #7A5A26;
  --gold-hi: #8E6A2F;
  --on-gold: #FFFFFF;
  --danger: #A3321F;
  --focus: #7A5A26;
  --shadow: 0 8px 24px rgba(60, 40, 10, .12);
  --ph-a: #E6DECF;
  --ph-b: #D6CBB6;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

h1, h2, h3, .section-title, .brand-name, .price, .kicker {
  font-family: "Saira Condensed", "Arial Narrow", sans-serif;
  letter-spacing: .02em;
}
h1, h2, h3 { line-height: 1.1; margin: 0 0 .5em; color: var(--gold); font-weight: 700; }

a { color: var(--gold-hi); }
:root[data-theme="light"] a { color: var(--gold); }
img { max-width: 100%; display: block; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--on-gold); padding: 10px 14px; border-radius: 6px; font-weight: 600;
}
.skip:focus { top: 8px; }

/* Cabecera */
.site-header {
  position: relative; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 12px; padding-top: 8px; padding-bottom: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.brand-name { font-size: 1.35rem; font-weight: 700; text-transform: uppercase; color: var(--gold); margin: 0; }
.brand-mark {
  width: 22px; height: 22px; transform: rotate(45deg);
  border: 2px solid var(--gold); box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 11px var(--gold);
}
.header-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; order: 3; width: 100%; }
.cart-btn { order: 2; }
@media (min-width: 640px) {
  .site-header { position: sticky; top: 0; }
  .header-row { flex-wrap: nowrap; }
  .brand { margin-right: auto; }
  .header-tools { order: 0; width: auto; }
}

.select {
  min-height: 44px; padding: 8px 36px 8px 12px; border-radius: 6px;
  border: 1px solid var(--line); background-color: var(--surface); color: var(--text);
  font: inherit; appearance: none; -webkit-appearance: none; max-width: 100%;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
.select-sm { padding-right: 30px; }

.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--gold); border-radius: 6px; cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-btn .i-moon { fill: currentColor; stroke: none; }
:root[data-theme="dark"] .icon-btn .i-moon,
:root:not([data-theme]) .icon-btn .i-moon { display: none; }
:root[data-theme="light"] .icon-btn .i-sun { display: none; }

.nav-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--text); text-decoration: none; }
.nav-link:hover { color: var(--gold-hi); }
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border-radius: 6px; background: var(--gold); color: var(--on-gold) !important; text-decoration: none; font-weight: 600;
}
.count {
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: inline-grid; place-items: center;
  background: var(--on-gold); color: var(--gold); font-size: .85rem; font-weight: 700;
}

/* Portada */
.hero {
  position: relative; overflow: hidden;
  padding: 56px 0 48px;
  background:
    radial-gradient(120% 80% at 80% 0%, color-mix(in srgb, var(--gold) 22%, transparent), transparent 60%),
    repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--gold) 5%, transparent) 14px 15px),
    linear-gradient(var(--bg-2), var(--bg));
  border-bottom: 1px solid var(--line);
}
.kicker { text-transform: uppercase; color: var(--muted); font-size: 1rem; font-weight: 600; letter-spacing: .18em; margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.1rem, 8vw, 4rem); text-transform: uppercase; max-width: 16ch; }
.lead { font-size: 1.1rem; color: var(--text); max-width: 56ch; margin: 0 0 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; border-radius: 6px; border: 1px solid transparent;
  font: 600 1rem/1.2 "IBM Plex Sans", sans-serif; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--gold); color: var(--on-gold) !important; }
.btn-primary:hover { background: var(--gold-hi); }
.btn-ghost { background: transparent; color: var(--gold-hi); border-color: var(--gold); }
:root[data-theme="light"] .btn-ghost { color: var(--gold); }
.btn-block { width: 100%; }

.pillars { display: grid; gap: 12px; padding-top: 28px; padding-bottom: 8px; }
.pillar { border-left: 2px solid var(--gold); padding: 4px 0 4px 14px; }
.pillar h2 { font-size: 1.3rem; text-transform: uppercase; margin-bottom: 4px; }
.pillar p { margin: 0; color: var(--muted); }

/* Catálogo */
.catalog { padding-top: 36px; padding-bottom: 48px; }
.catalog-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.section-title { font-size: clamp(2rem, 6vw, 2.8rem); text-transform: uppercase; margin: 0; }
.ship-to { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 220px; max-width: 320px; }
.ship-to label { font-size: .9rem; color: var(--muted); }
.price-note { color: var(--muted); margin: 10px 0 0; font-size: .95rem; }

.notice {
  margin-top: 16px; padding: 16px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line);
}
.notice p { margin: 0 0 8px; }
.notice-forge { border-color: var(--gold); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 14%, var(--surface)), var(--surface)); }
.notice-forge h3 { font-size: 1.6rem; text-transform: uppercase; }
.contact-row { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.contact-row a { display: inline-flex; align-items: center; min-height: 44px; }

.collection { margin-top: 36px; }
.collection-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.6rem; text-transform: uppercase; color: var(--text); margin-bottom: 16px;
}
.collection-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }

.card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow);
}
.media {
  position: relative; aspect-ratio: 4 / 3;
  background: radial-gradient(circle at 50% 40%, var(--ph-a), var(--ph-b));
  display: grid; place-items: center; text-align: center;
}
.media .ph-name {
  font-family: "Saira Condensed", sans-serif; font-size: 1.6rem; font-weight: 600; text-transform: uppercase;
  color: var(--muted); padding: 0 16px; opacity: .8;
}
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  background: var(--gold); color: var(--on-gold); padding: 4px 10px; border-radius: 4px;
  font: 700 .8rem/1.4 "IBM Plex Sans", sans-serif; text-transform: uppercase; letter-spacing: .06em;
}
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h4 {
  font-family: "Saira Condensed", "Arial Narrow", sans-serif; letter-spacing: .02em;
  font-size: 1.7rem; line-height: 1.1; font-weight: 700; text-transform: uppercase; color: var(--gold); margin: 0;
}
.price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.price { font-size: 1.9rem; font-weight: 700; color: var(--gold); }
.tax { font-size: .85rem; color: var(--muted); }
.includes { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: .95rem; }
.includes li::before { content: "◆"; color: var(--gold); font-size: .65em; margin-right: 8px; vertical-align: .15em; }
.colors-line { font-size: .95rem; color: var(--muted); margin: 0; }
.colors-line strong { color: var(--text); font-weight: 500; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 6px; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--text) 35%, transparent); }
.card-actions { margin-top: auto; padding-top: 6px; }
.closed-inline { font-size: .95rem; color: var(--muted); margin: 0; padding: 12px; border: 1px dashed var(--line); border-radius: 6px; }

/* Pie */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 32px 0 40px; }
.footer-grid { display: grid; gap: 20px; }
.footer-grid p { margin: 0 0 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 18px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); }

/* Aviso flotante */
.toast {
  position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 140%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-weight: 500; box-shadow: var(--shadow);
  transition: transform .25s ease, opacity .25s ease, visibility .25s; z-index: 50; pointer-events: none;
  opacity: 0; visibility: hidden;
}
.toast:empty { display: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

[hidden] { display: none !important; }

/* Barra flotante "Ver pedido" */
.cart-float {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; border-radius: 8px; background: var(--gold); color: var(--on-gold) !important;
  font-weight: 600; text-decoration: none; box-shadow: var(--shadow);
}
body.has-float .site-footer { padding-bottom: 96px; }
body.has-float .toast { bottom: 80px; }

/* Pedido */
.order { max-width: 780px; padding-top: 28px; padding-bottom: 56px; }
.order-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.empty { padding: 32px 16px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }
.empty p { color: var(--muted); margin: 0 0 16px; }
.notice-warn { border-color: var(--gold); }
.notice-error { border-color: var(--danger); }
.notice-error h3 { color: var(--danger); font-size: 1.5rem; text-transform: uppercase; }
.notice-error ul { margin: 0; padding-left: 20px; }
.notice-error li a { display: inline-block; padding: 4px 0; color: var(--text); }
.err-head { font-weight: 600; }

.unit {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; margin-bottom: 16px; display: grid; gap: 14px; min-width: 0;
}
.unit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.unit-title { font-size: 1.6rem; text-transform: uppercase; margin: 0; }
.unit .price { font-size: 1.5rem; white-space: nowrap; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.part legend { font-weight: 600; margin-bottom: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 48px; min-height: 48px; cursor: pointer;
}
.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sw-dot {
  width: 40px; height: 40px; border-radius: 50%; margin: 4px;
  border: 1px solid color-mix(in srgb, var(--text) 35%, transparent);
  transition: box-shadow .15s ease;
}
.sw input:checked + .sw-dot { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--gold); }
.sw input:focus-visible + .sw-dot { outline: 3px solid var(--focus); outline-offset: 6px; }
.sw-tag { font-size: .7rem; line-height: 1; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.chosen { margin: 8px 0 0; font-size: .95rem; color: var(--muted); }

.block { margin-top: 28px; }
.block-title { font-size: 1.6rem; text-transform: uppercase; margin-bottom: 14px; }
legend.block-title { color: var(--gold); font-family: "Saira Condensed", sans-serif; font-weight: 700; line-height: 1.1; }

.field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label, .field-row label { font-weight: 500; }
.field-row { display: flex; gap: 12px; }
.field-row .field { margin-bottom: 14px; }
.field-prefix { flex: 0 0 96px; }
.field-cp { flex: 0 0 132px; }
.field-grow { flex: 1 1 auto; }
input:not([type="radio"]):not([type="checkbox"]), textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
textarea { min-height: 72px; resize: vertical; }
input:focus-visible, textarea:focus-visible, .select:focus-visible { border-color: var(--gold); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-err { margin: 0; color: var(--danger); font-size: .9rem; min-height: 0; }
.field-err:empty { display: none; }
.help { display: block; margin: 0; color: var(--muted); font-size: .9rem; }

.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.check, .choice { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 8px 0; cursor: pointer; }
.check input, .choice input { width: 22px; height: 22px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--gold); }
.choice { padding: 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--gold); }
.choice strong { display: block; }
.pay-info { color: var(--muted); margin: 8px 0 0; }

.sum { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sum-row > div { min-width: 0; }
.sum-det { display: block; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.sum-val { white-space: nowrap; font-weight: 600; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; }
.sum-total span:first-child { font-family: "Saira Condensed", sans-serif; font-size: 1.5rem; text-transform: uppercase; font-weight: 700; }
.sum-total .price { font-size: 2.2rem; }
.sum .tax { margin: 0; text-align: right; }
.sum-note { margin: 10px 0 0; color: var(--muted); font-size: .95rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-sm { min-height: 44px; padding: 8px 14px; font-size: .95rem; }
.btn-lg { min-height: 56px; font-size: 1.1rem; margin-top: 12px; }
.btn-danger { border-color: var(--line); color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Confirmación */
.id-box {
  margin: 20px 0; padding: 20px 16px; text-align: center; border-radius: 10px;
  border: 1px solid var(--gold); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 14%, var(--surface)), var(--surface));
}
.id-label { margin: 0; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-size: .85rem; }
.order-id {
  margin: 6px 0 14px; font-family: "Saira Condensed", sans-serif; font-weight: 700;
  font-size: clamp(2.6rem, 13vw, 4rem); letter-spacing: .06em; color: var(--gold); overflow-wrap: anywhere;
  user-select: all;
}
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }

/* Páginas: Mi pedido y legales */
.page-title { font-size: clamp(2.2rem, 8vw, 3.4rem); text-transform: uppercase; margin-top: 8px; }
.status-card {
  padding: 20px 16px; border-radius: 10px; border: 1px solid var(--gold);
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 12%, var(--surface)), var(--surface));
}
.status-title { font-size: clamp(2rem, 9vw, 2.8rem); text-transform: uppercase; margin: 4px 0; }
.timeline { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 6px 0 6px 28px; color: var(--muted); }
.timeline li::before {
  content: ""; position: absolute; left: 4px; top: 12px; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--bg);
}
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 9px; top: 26px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li.done { color: var(--text); }
.timeline li.done::before { background: var(--gold); border-color: var(--gold); }
.timeline li.done::after { background: var(--gold); }
.timeline li.current { color: var(--gold-hi); font-weight: 600; }
:root[data-theme="light"] .timeline li.current { color: var(--gold); }
.timeline li.current::before { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 25%, transparent); }
.facts { margin: 16px 0 0; display: grid; gap: 0; }
.facts > div { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.facts .help { margin-top: 12px; }
progress { width: 100%; height: 10px; accent-color: var(--gold); display: block; margin: 6px 0 4px; }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .03em; }

.legal { max-width: 780px; padding-top: 28px; padding-bottom: 56px; }
.legal section { margin-top: 28px; }
.legal h2 { font-size: 1.5rem; text-transform: uppercase; }
.legal p, .legal li { max-width: 68ch; }
.legal ul { padding-left: 20px; display: grid; gap: 8px; }

@media (min-width: 640px) {
  .facts > div { grid-template-columns: 220px 1fr; align-items: baseline; }
  .cart-float { display: none !important; }
  body.has-float .site-footer { padding-bottom: 40px; }
  body.has-float .toast { bottom: 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pillars { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .footer-grid { grid-template-columns: 2fr 1fr; }
  .hero { padding: 88px 0 72px; }
}
@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
