/* Tipografías propias (SIL Open Font License): Manrope para títulos, Inter para texto. */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600 800; font-display: swap; src: url("/static/fonts/manrope-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("/static/fonts/inter-latin.woff2") format("woff2"); }

:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #eef2f8; --warm: #fbf1ea; --fg: #0f1b2d; --muted: #44526a; --muted-2: #5a6780; --line: #e2e6ec; --line-2: #c9d1dc;
  --brand: #1b5fd9; --brand-hover: #154db3; --brand-ink: #ffffff; --brand-soft: #e7eefc; --nav: #0f1b2d; --nav-fg: #e8edf5; --nav-muted: #b4c0d2;
  --wa: #1a9e55; --ok: #13703f; --ok-soft: #e3f4ea; --warn: #9a5b00; --bad: #b42318; --radius: 14px;
  --shadow: none;
  --f-head: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--fg); font: 16px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--f-head); line-height: 1.15; letter-spacing: -.02em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.eyebrow { display: block; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }

/* Header */
.topbar { background: var(--nav); color: var(--nav-fg); font-size: .86rem; }
.topbar .wrap { display: flex; gap: 6px 24px; justify-content: space-between; align-items: center; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.topbar a { color: #fff; font-weight: 600; }
.site-header { background: var(--surface); color: var(--fg); position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--fg); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-img { display: block; height: 38px; width: auto; }
.logo-tag { font-size: .8rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 8px; }
.mainnav { display: flex; gap: 24px; font-size: .95rem; font-weight: 500; white-space: nowrap; }
.mainnav a { color: var(--fg); }
.mainnav a.active { color: var(--brand); font-weight: 600; }
.search { display: flex; margin-left: auto; width: 220px; }
.search input { flex: 1; min-width: 0; height: 42px; border: 1px solid var(--line-2); border-right: 0; border-radius: 10px 0 0 10px; padding: 0 12px; font: inherit; font-size: .95rem; background: var(--surface); color: var(--fg); }
.search input::placeholder { color: var(--muted-2); }
.search button { height: 42px; border: 1px solid var(--line-2); border-radius: 0 10px 10px 0; padding: 0 12px; background: var(--surface-2); color: var(--fg); cursor: pointer; }
.head-wa { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; color: var(--fg); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.head-wa svg { color: var(--wa); }
.head-wa:hover { text-decoration: none; border-color: var(--wa); }
.header-links { display: flex; gap: 18px; font-size: .92rem; }
.header-links a { color: var(--fg); }

/* Hero */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 64px; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.06; margin: 0 0 20px; }
.hero-copy > p { color: var(--muted); font-size: 1.15rem; max-width: 56ch; margin: 0 0 24px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-copy .hero-note { margin: 12px 0 0; font-size: .92rem; color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: .92rem; color: var(--muted); }
.checks li { display: flex; align-items: center; gap: 6px; }
.checks svg { color: var(--brand); flex: none; }
.hero-list { background: var(--bg); padding: 20px; display: grid; gap: 10px; }
.hero-row { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px 10px 10px; color: var(--fg); }
.hero-row:hover { text-decoration: none; border-color: var(--brand); }
.hero-thumb { width: 64px; height: 64px; flex: none; border-radius: 8px; background: var(--surface-2); padding: 4px; }
.hero-thumb.warm { background: var(--warm); }
.hero-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hero-name span { font-size: .84rem; color: var(--muted-2); }
.hero-price { font: 800 1.35rem/1 var(--f-head); white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 24px; border-radius: 10px; border: 0; font: inherit; font-weight: 600; cursor: pointer; background: var(--brand); color: var(--brand-ink); }
.btn:hover { text-decoration: none; background: var(--brand-hover); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--fg); border: 1px solid var(--line-2); }
.btn.ghost svg { color: var(--wa); }
.btn.ghost:hover { border-color: var(--fg); }
.btn.light { background: #fff; color: var(--fg); }

/* Promoción: etiqueta sin precio tachado */
.promo-tag { display: inline-block; align-self: flex-start; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .78rem; padding: 3px 9px; border-radius: 6px; }
.buybox .promo-tag { margin-bottom: 10px; }
.card-price { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }

/* Sections */
.section { padding: 56px 0 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; margin-bottom: 22px; }
.section-head h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; }

/* Product cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pcard { display: flex; flex-direction: column; overflow: hidden; color: var(--fg); transition: border-color .15s ease; }
.pcard:hover { text-decoration: none; border-color: var(--brand); }
.pcard .art { background: var(--surface-2); padding: 20px 48px; }
.pcard .art.warm { background: var(--warm); }
.pcard .body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcard h3 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.pcard .price { font: 800 1.75rem/1.1 var(--f-head); }
.pcard .btn { margin-top: 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: .76rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--fg); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }

/* Steps / FAQ / dueño */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { padding: 24px; }
.step-n { display: block; font: 800 .95rem/1 var(--f-head); color: var(--brand); margin-bottom: 10px; }
.step h3 { margin: 0 0 8px; font-size: 1.2rem; }
.step p { margin: 0; color: var(--muted); }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 4px; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-family: var(--f-head); font-weight: 700; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--brand); font-weight: 800; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 10px 0 0; color: var(--muted); }

/* Product page */
.crumbs { font-size: .88rem; color: var(--muted-2); padding: 20px 0 0; }
.crumbs a { color: var(--muted-2); }
.product { display: grid; grid-template-columns: 1fr 1fr 380px; gap: 28px; padding: 20px 0 8px; align-items: start; }
.product .gallery { padding: 28px; max-width: 440px; background: var(--surface-2); }
.product .gallery.warm { background: var(--warm); }
.product h1 { margin: 8px 0 6px; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; }
.feature-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 10px; }
.feature-list li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231b5fd9'%3E%3Cpath d='M8.1 13.4 4.7 10l-1.2 1.2 4.6 4.6 9-9-1.2-1.2z'/%3E%3C/svg%3E") center/14px no-repeat; }
.buybox { padding: 24px; position: sticky; top: 88px; }
.buybox .price { font: 800 2.4rem/1 var(--f-head); letter-spacing: -.02em; }
.buybox .stock { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 600; font-size: .92rem; margin: 12px 0; }
.buybox .stock::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.buybox .stock.out { color: var(--bad); } .buybox .stock.out::before { background: var(--bad); }
.btn[disabled], .btn.soldout { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.buybox label { display: block; font-weight: 600; font-size: .95rem; margin: 14px 0 6px; }
.buybox input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--fg); font: inherit; }
.buybox input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.buybox .btn { margin-top: 14px; height: 54px; font-size: 1.05rem; }
.guarantees { list-style: none; padding: 16px 0 0; margin: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 12px; font-size: .92rem; }
.guarantees li { display: flex; gap: 10px; align-items: flex-start; }
.guarantees svg { flex: none; color: var(--brand); margin-top: 2px; }
.paychips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; justify-content: center; }
.paychip { font-size: .8rem; font-weight: 600; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; color: var(--muted); }
.err { color: var(--bad); font-weight: 600; font-size: .92rem; margin: 10px 0 0; }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 8px 0 24px; }
.details .card { padding: 26px; }
.details h2 { margin: 0 0 12px; font-size: 1.35rem; font-weight: 800; }
.spec { width: 100%; border-collapse: collapse; font-size: .94rem; }
.spec th, .spec td { text-align: left; padding: 9px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec th { color: var(--muted); font-weight: 600; width: 38%; }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }
ol.howto { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

/* Generic page / order status */
.page { max-width: 760px; margin: 0 auto; padding: 28px 16px 56px; }
.page .card { padding: 24px; }
.status-pill { display: inline-block; font-weight: 700; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); }
.s-paid, .s-delivered { color: var(--ok); } .s-review, .s-pending_payment { color: var(--warn); }
.s-payment_failed, .s-create_failed, .s-canceled, .s-refunded { color: var(--bad); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 16px 0 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; word-break: break-word; }
.notice { background: var(--brand-soft); border-radius: 10px; padding: 12px 14px; font-size: .92rem; }
.prose h2 { font-size: 1.2rem; margin-top: 24px; } .prose p, .prose li { color: var(--fg); }

/* Próximamente */
.soon-body { min-height: 100vh; display: grid; place-items: center; background: var(--nav); color: #e8ecf5; }
.soon { text-align: center; padding: 32px 16px; max-width: 560px; }
.soon-logo { width: min(320px, 80vw); height: auto; }
.soon h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 28px 0 10px; }
.soon p { color: #b8c3dc; font-size: 1.05rem; }
.soon a { color: #8fb6ff; }

/* Footer */
.site-footer { background: var(--nav); color: var(--nav-muted); margin-top: 72px; font-size: .92rem; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; padding-top: 40px; padding-bottom: 24px; }
.site-footer .logo { color: #fff; }
.site-footer h4 { color: var(--nav-fg); margin: 0 0 10px; font-size: .95rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--nav-muted); }
.site-footer a:hover { color: var(--nav-fg); }
.site-footer .legal { border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; padding-bottom: 24px; font-size: .8rem; }

/* Admin (reutiliza tarjetas) */
.inline-deliver { display: flex; gap: 8px; align-items: center; }
.admin .inline-deliver input { height: 38px; font-family: ui-monospace, monospace; font-size: .88rem; text-transform: uppercase; }
.admin .inline-deliver .btn { margin-top: 0; height: 38px; padding: 0 14px; }
.admin table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin th, .admin td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin .scroll { overflow-x: auto; }
.admin form input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); font: inherit; }
.admin form textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); font-family: ui-monospace, monospace; text-transform: uppercase; resize: vertical; }
.admin .btn { margin-top: 12px; height: 44px; }

@media (max-width: 1080px) {
  .search { display: none; }
}
@media (max-width: 980px) {
  .product { grid-template-columns: 1fr 1fr; }
  .buybox { grid-column: 1 / -1; position: static; }
  .hero .wrap { grid-template-columns: 1fr; gap: 32px; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .site-header .wrap { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 0; gap: 10px; }
  .head-wa { margin-left: auto; }
  .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; gap: 20px; padding: 6px 0 12px; }
  .logo-img { height: 32px; }
  .hero .wrap { padding-top: 32px; padding-bottom: 32px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .steps { grid-template-columns: 1fr; }
  .product, .details { grid-template-columns: minmax(0, 1fr); }
  .product > *, .details > * { min-width: 0; }
  .product .gallery { max-width: 300px; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .section { padding-top: 44px; }
}

/* Portal de activación */
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.bad { background: #fde8e6; color: var(--bad); }
.act-card { padding: 20px; margin: 14px 0; }
.act-card h3 { margin: 0 0 10px; }
.act-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.act-head .btn { height: 38px; }
.act-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 4px; }
.act-stats .card { padding: 14px; text-align: center; }
.act-stats b { display: block; font-size: 1.8rem; line-height: 1.1; }
.act-stats span { color: var(--muted); font-size: .86rem; }
.act-form label { display: block; font-weight: 650; font-size: .92rem; margin: 12px 0 6px; }
.act-form input, .act-form textarea, .act-form select { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); font: inherit; }
.act-form input, .act-form select { height: 44px; padding-top: 0; padding-bottom: 0; }
.act-form textarea { font-family: ui-monospace, monospace; resize: vertical; }
.act-form .btn { margin-top: 12px; }
.act-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.act-inline > div { min-width: 140px; }
.act-check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.act-check input, .admin form .act-check input { width: 18px; height: 18px; margin: 0; flex: none; }
.act-key { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--nav); color: #fff; border-radius: 10px; padding: 12px 14px; }
.act-key code { font-size: 1.1rem; letter-spacing: 1px; word-break: break-all; flex: 1; min-width: 0; }
.act-key .btn { height: 36px; background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.act-key .btn:hover { border-color: #fff; }
.act-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.act-row .btn, .btn.copy { height: 38px; padding: 0 14px; margin: 0; }
.act-req { border-radius: 10px; padding: 12px 14px; margin-top: 12px; background: var(--surface-2); }
.act-req.done { background: var(--ok-soft); }
.act-req.rejected { background: #fde8e6; }
.cid-blocks { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.cid-block { display: inline-flex; flex-direction: column; align-items: center; }
.cid-block small { font-size: .72rem; font-weight: 700; color: var(--muted); }
.cid-block code { font-size: 1.05rem; font-weight: 700; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; }
.admin .act-inline .btn { margin-top: 0; height: 36px; padding: 0 12px; }
.admin td form.act-inline { margin: 0 0 6px; }
.admin td form.act-inline input { height: 36px; }
@media (max-width: 560px) { .act-stats b { font-size: 1.4rem; } .act-head { flex-direction: column; } }

/* Descuento por cantidad */
.tier-hint { display: inline-block; margin: 4px 0 2px; font-size: .8rem; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: 6px; padding: 2px 8px; align-self: flex-start; }
.tiers { border: 1px solid var(--line); border-radius: 10px; margin: 14px 0 4px; overflow: hidden; }
.tiers-head { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 8px 12px; background: var(--surface-2); }
.tier { display: grid; grid-template-columns: 1fr auto 3.2em; gap: 8px; align-items: center; padding: 7px 12px; font-size: .92rem; border-top: 1px solid var(--line); }
.tier b { font-weight: 700; }
.tier em { font-style: normal; font-size: .8rem; font-weight: 700; color: var(--ok); text-align: right; }
.tier.on { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.qty { display: flex; align-items: stretch; width: 100%; max-width: 180px; margin-bottom: 8px; }
.qty input { text-align: center; border-radius: 0; margin: 0; -moz-appearance: textfield; appearance: textfield; min-width: 0; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-btn { width: 44px; flex: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); font-size: 1.2rem; cursor: pointer; }
.qty-btn:first-child { border-radius: 10px 0 0 10px; border-right: 0; }
.qty-btn:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.qty-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 2px 0 10px; font-size: .95rem; }
.qty-total span { color: var(--muted); }
.qty-total em { font-style: normal; color: var(--ok); font-weight: 700; font-size: .88rem; }

/* Visitas (admin) */
.vstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.vstats .card { padding: 14px 16px; display: flex; flex-direction: column; }
.vstats b { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.vstats span { color: var(--muted); font-size: .88rem; }
.vf-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) 2fr minmax(90px, .8fr); gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.vf-row:first-child { border-top: 0; }
.vf-label, .vf-num { display: flex; flex-direction: column; }
.vf-num b { font-size: 1.3rem; }
.vf-bar { height: 14px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.vf-bar span { display: block; height: 100%; background: var(--brand); border-radius: 7px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
@media (max-width: 640px) { .vf-row { grid-template-columns: 1fr; gap: 6px; } .vgrid { grid-template-columns: 1fr; } }
