/* Fancy Liquidation — estilos
   Paleta: blanco, tinta, gris frío, azul cobalto (acción) y amarillo cinta (detalle) */
:root {
  --paper: #FFFFFF;
  --wash: #F2F4F7;
  --line: #E1E4EA;
  --ink: #171A21;
  --muted: #5B6170;
  --cobalt: #2445C8;
  --cobalt-dark: #1A35A3;
  --tape: #FFD23F;
  --danger: #B42318;
  --radius: 14px;
  --display: 'Bricolage Grotesque', 'Public Sans', system-ui, sans-serif;
  --body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--body); }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

h1, h2, h3 { font-family: var(--display); font-weight: 650; letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; line-height: 1.25; }
.lede { font-size: 1.125rem; color: var(--muted); max-width: 34ch; margin: 18px 0 0; }

/* ----------------------------- Encabezado ----------------------------- */
#site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.12rem; letter-spacing: -0.02em; white-space: nowrap; }
.logo-mark { width: 28px; height: 28px; fill: var(--tape); stroke: var(--ink); stroke-width: 2; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; padding: 6px 0; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--ink); }
.header-tools { display: flex; align-items: center; gap: 12px; }
.lang { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .875rem; cursor: pointer; color: var(--muted); }
.lang:hover { color: var(--ink); border-color: var(--ink); }
.cart-link { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.cart-link:hover { background: var(--wash); }
.cart-link svg { width: 23px; height: 23px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cart-count { position: absolute; top: 1px; right: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--tape); color: var(--ink); font-size: .72rem; font-weight: 700; display: grid; place-items: center; }

@media (max-width: 720px) {
  .header-row { gap: 12px; }
  .nav { gap: 16px; }
  .nav-how { display: none; }
  .brand span { font-size: 1rem; }
}
@media (max-width: 460px) {
  .brand span { display: none; }
  .nav { margin-left: 0; }
  .header-tools { margin-left: auto; }
}

/* ------------------------------ Botones ------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--paper); text-decoration: none; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-dark); border-color: var(--cobalt-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ------------------------------- Hero -------------------------------- */
.hero { padding: 64px 0 80px; }
.hero-grid { display: grid; grid-template-columns: 1fr minmax(0, 470px); gap: 64px; align-items: start; }
.hero-copy { padding-top: 28px; }
.hero-copy h1 { max-width: 13ch; }
.hero-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
@media (max-width: 900px) {
  .hero { padding: 36px 0 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-copy { padding-top: 0; }
}

/* -------------------------- Formulario de pago ------------------------ */
.pay-panel { background: var(--wash); border-radius: 22px; padding: 30px; }
.pay-panel h2 { font-size: 1.35rem; margin-bottom: 18px; }
.amount-field { display: block; background: var(--paper); border-radius: var(--radius); padding: 16px 20px 10px; border: 1.5px solid transparent; cursor: text; }
.amount-field:focus-within { border-color: var(--cobalt); }
.amount-label { font-size: .85rem; color: var(--muted); }
.amount-row { display: flex; align-items: baseline; font-family: var(--display); font-weight: 600; letter-spacing: -0.04em; line-height: 1; overflow: hidden; }
.amount-cur { font-size: clamp(2.2rem, 6vw, 3rem); color: var(--muted); margin-right: 4px; }
.amount-row input { border: 0; outline: 0; background: transparent; padding: 4px 0 8px; font-size: clamp(3.4rem, 10vw, 4.6rem); font-family: inherit; font-weight: inherit; letter-spacing: inherit; min-width: 2ch; max-width: 100%; font-variant-numeric: tabular-nums; }
.amount-row input::placeholder { color: #C3C8D1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 22px; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 14px; font-weight: 500; font-size: .92rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.fields { display: grid; gap: 12px; margin-bottom: 8px; }
.fields label { display: grid; gap: 5px; font-size: .88rem; font-weight: 500; }
.fields input { height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; background: var(--paper); font-size: 1rem; }
.fields input:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px rgba(36, 69, 200, .15); }
.form-error { color: var(--danger); font-size: .92rem; font-weight: 500; min-height: 1.4em; margin: 6px 0 10px; }
.fine { font-size: .82rem; color: var(--muted); margin: 12px 0 0; line-height: 1.45; }
.fine.secure { display: flex; gap: 8px; align-items: flex-start; }
.fine.secure svg { flex: none; width: 15px; height: 15px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; }
@media (max-width: 460px) { .pay-panel { padding: 20px; border-radius: 18px; margin-inline: -4px; } }

/* --------------------------- Cómo funciona --------------------------- */
.section { padding: 80px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 36px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; counter-reset: step; }
.steps li { counter-increment: step; padding: 0 28px 0 0; }
.steps li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--tape); font-family: var(--display); font-weight: 700; margin-bottom: 18px; }
.steps p { color: var(--muted); margin: 8px 0 0; max-width: 32ch; }
@media (max-width: 760px) {
  .section { padding: 56px 0; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps li, .steps li + li { padding: 0; border: 0; display: grid; grid-template-columns: 38px 1fr; column-gap: 16px; }
  .steps li::before { margin: 0; grid-row: span 2; }
}

/* ------------------------------ Tienda ------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 36px 24px; }
.card { text-decoration: none; display: block; }
.card-img { aspect-ratio: 4 / 5; background: var(--wash); border-radius: var(--radius); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-img img { transform: scale(1.03); }
.card h3 { margin-top: 14px; font-family: var(--body); font-weight: 600; font-size: 1rem; letter-spacing: 0; }
.card .price { color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.empty { background: var(--wash); border-radius: var(--radius); padding: 40px; color: var(--muted); max-width: 640px; }
.empty .btn { margin-top: 18px; }

/* ------------------------------ Producto ----------------------------- */
.page { padding: 40px 0 88px; }
.back { display: inline-flex; gap: 6px; color: var(--muted); text-decoration: none; font-size: .92rem; margin-bottom: 24px; }
.back:hover { color: var(--ink); }
.product { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.gallery-main { aspect-ratio: 4 / 5; background: var(--wash); border-radius: 20px; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; }
.thumbs button { width: 72px; aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--wash); cursor: pointer; }
.thumbs button[aria-current="true"] { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-info h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.product-price { font-family: var(--display); font-size: 1.7rem; font-weight: 600; margin: 14px 0 0; font-variant-numeric: tabular-nums; }
.product-desc { color: var(--muted); margin: 18px 0 28px; max-width: 46ch; }
.option { border: 0; padding: 0; margin: 0 0 22px; }
.option legend { font-weight: 600; font-size: .92rem; margin-bottom: 10px; padding: 0; }
.option legend span { font-weight: 400; color: var(--muted); }
.values { display: flex; flex-wrap: wrap; gap: 8px; }
.value { min-width: 52px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.value:hover { border-color: var(--ink); }
.value[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.value.is-out { color: #A3A9B4; text-decoration: line-through; }
.swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.buy-row { display: flex; gap: 12px; align-items: stretch; margin-top: 8px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; height: 52px; }
.qty button { width: 42px; height: 100%; background: none; border: 0; font-size: 1.2rem; cursor: pointer; border-radius: 999px; }
.qty button:hover { background: var(--wash); }
.qty span { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.buy-row .btn { flex: 1; }
.toast { margin-top: 14px; font-weight: 500; display: flex; gap: 10px; align-items: center; }
.toast a { color: var(--cobalt); }
@media (max-width: 860px) { .product { grid-template-columns: 1fr; gap: 28px; } }

/* ------------------------------ Carrito ------------------------------ */
.cart { display: grid; grid-template-columns: 1fr 340px; gap: 48px; align-items: start; margin-top: 28px; }
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.line { display: grid; grid-template-columns: 88px 1fr auto; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line img { width: 88px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; background: var(--wash); }
.line h3 { font-family: var(--body); font-size: 1rem; font-weight: 600; letter-spacing: 0; }
.line h3 a { text-decoration: none; }
.line .meta { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.line .qty { height: 40px; margin-top: 12px; }
.line .qty button { width: 36px; }
.line-total { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.line-remove { display: block; margin-top: 8px; background: none; border: 0; padding: 0; color: var(--muted); font-size: .85rem; text-decoration: underline; cursor: pointer; }
.summary { background: var(--wash); border-radius: 20px; padding: 26px; position: sticky; top: 88px; }
.summary dl { margin: 0 0 20px; display: grid; grid-template-columns: 1fr auto; row-gap: 10px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.summary .total-row { font-weight: 700; font-size: 1.15rem; color: var(--ink); border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 860px) { .cart { grid-template-columns: 1fr; } .summary { position: static; } }

/* --------------------------- Página simple --------------------------- */
.narrow { max-width: 560px; }
.center-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 64px 0; }
.center-page .lede { margin-inline: auto; }
.check { width: 64px; height: 64px; border-radius: 50%; background: var(--tape); display: grid; place-items: center; margin: 0 auto 24px; }
.check svg { width: 30px; height: 30px; fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.center-page .btn { margin-top: 28px; }

/* -------------------------------- Pie -------------------------------- */
#site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; color: var(--muted); font-size: .92rem; }
.footer-row { display: grid; grid-template-columns: 1fr auto; gap: 16px 32px; }
.footer-row strong { color: var(--ink); font-family: var(--display); font-size: 1.05rem; }
.footer-row p { margin: 4px 0 0; }
.footer-links { display: flex; flex-direction: column; gap: 6px; text-align: right; }
.footer-copy { grid-column: 1 / -1; font-size: .82rem; }
@media (max-width: 600px) { .footer-row { grid-template-columns: 1fr; } .footer-links { text-align: left; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* País de envío en el carrito */
.country { display: grid; gap: 6px; font-size: .88rem; font-weight: 500; margin-bottom: 18px; }
.country select { height: 46px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--paper); font-size: 1rem; }
.country select:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px rgba(36, 69, 200, .15); }
.summary dd.muted { color: var(--muted); font-weight: 400; font-size: .92rem; }
