/* ==========================================================
   TODOYA — Estilos globales
   Paleta provisional: cámbiala editando solo las variables :root
   ========================================================== */
:root {
  --brand: #2563eb;
  --brand-600: #1d4ed8;
  --brand-50: #eff6ff;
  --accent: #ff6b2c;
  --accent-600: #ea580c;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --ok: #16a34a;
  --wa: #25d366;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 2px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 700; line-height: 1.2; transition: transform .12s ease, background .15s ease, box-shadow .15s ease; text-align: center; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(255, 107, 44, .28); }
.btn-accent:hover { background: var(--accent-600); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-wa { background: var(--wa); color: #06361a; }
.btn-wa:hover { filter: brightness(.95); }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Header ---------- */
#site-header { min-height: 112px; }
.topbar { background: var(--ink); color: #fff; font-size: .8rem; text-align: center; padding: 7px 0; }
.nav-wrap { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.nav { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "menu logo cart" "search search search" "nav nav nav"; gap: 8px 12px; align-items: center; padding: 10px 0; }
.menu-btn { grid-area: menu; }
.logo { grid-area: logo; display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; }
.logo-text b { color: var(--accent); }
.search { grid-area: search; display: flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.search input { flex: 1; border: 0; padding: 11px 14px; font: inherit; background: transparent; min-width: 0; }
.search input:focus { outline: none; }
.search:focus-within { border-color: var(--brand); background: #fff; }
.search button { border: 0; background: transparent; padding: 0 14px; font-size: 1.05rem; }
.main-nav { grid-area: nav; display: none; flex-direction: column; gap: 2px; }
.main-nav.open { display: flex; }
.main-nav a { padding: 11px 12px; border-radius: 10px; font-weight: 600; }
.main-nav a:hover, .main-nav a.active { background: var(--brand-50); color: var(--brand); }
.icon-btn { background: transparent; border: 0; font-size: 1.5rem; padding: 6px 8px; border-radius: 10px; line-height: 1; }
.cart-link { grid-area: cart; position: relative; font-size: 1.5rem; padding: 6px 8px; line-height: 1; }
.cart-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .72rem; display: grid; place-items: center; }
.cart-badge[hidden] { display: none; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, var(--brand-50) 0%, #fff 70%); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 28px; padding: 36px 0 44px; align-items: center; }
.eyebrow { display: inline-block; background: #fff; border: 1px solid var(--line); color: var(--brand); font-weight: 700; font-size: .8rem; padding: 5px 12px; border-radius: 99px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(2rem, 6.5vw, 3.4rem); font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead { font-size: 1.1rem; color: var(--muted); max-width: 52ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.hero-visual { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hv { border-radius: 20px; padding: 18px; display: grid; gap: 6px; align-content: end; min-height: 130px; box-shadow: var(--shadow); font-weight: 700; }
.hv span { font-size: 2.6rem; line-height: 1; }
.hv small { font-weight: 600; color: rgba(15, 23, 42, .65); }
.hv-1 { background: #dbeafe; grid-row: span 2; min-height: 272px; }
.hv-2 { background: #ffedd5; }
.hv-3 { background: #dcfce7; }

/* ---------- Secciones ---------- */
.section { padding: 44px 0; }
.section-alt { background: #fff; border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.4rem, 4vw, 2rem); margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.link-arrow { color: var(--brand); font-weight: 700; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Categorías ---------- */
.cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cat { background: var(--c, #e0e7ff); border-radius: var(--radius); padding: 18px 14px; display: grid; gap: 2px; justify-items: start; transition: transform .15s ease, box-shadow .15s ease; }
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cat-emoji { font-size: 2.2rem; line-height: 1.1; }
.cat small { color: rgba(15, 23, 42, .6); font-weight: 600; }

/* ---------- Productos ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s ease, transform .15s ease; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-media { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--bg); }
.card-media img, .ph { width: 100%; height: 100%; object-fit: cover; }
.ph { display: grid; place-items: center; background: var(--c, #e0e7ff); }
.ph span { font-size: clamp(3rem, 14vw, 5.5rem); line-height: 1; }
.badge { position: absolute; top: 8px; left: 8px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.card-body { padding: 12px; display: grid; gap: 6px; flex: 1; align-content: start; }
.card-cat { color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.card-title { font-size: .98rem; margin: 0; font-weight: 700; }
.card-title a:hover { color: var(--brand); }
.card .btn { margin-top: auto; padding: 10px 12px; font-size: .92rem; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.price b { font-size: 1.12rem; }
.price s { color: var(--muted); font-size: .85rem; }
.off { color: var(--ok); font-weight: 800; font-size: .8rem; }
.price.big b { font-size: 1.9rem; }
.price.big s { font-size: 1.05rem; }
.price.big .off { background: #dcfce7; padding: 2px 8px; border-radius: 99px; }

/* ---------- Beneficios / pasos ---------- */
.benefits { display: grid; gap: 14px; grid-template-columns: 1fr; }
.benefit { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.benefit .ico { font-size: 2rem; display: block; margin-bottom: 8px; }
.benefit h3 { font-size: 1.05rem; margin-bottom: 4px; }
.benefit p { color: var(--muted); margin: 0; font-size: .95rem; }
.steps { display: grid; gap: 14px; counter-reset: step; }
.step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 18px 64px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 16px; top: 16px; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; }
.step h3 { font-size: 1rem; margin-bottom: 2px; }
.step p { margin: 0; color: var(--muted); font-size: .93rem; }
.cta-band { background: var(--ink); color: #fff; border-radius: 22px; padding: 28px 22px; display: grid; gap: 14px; justify-items: start; }
.cta-band h2 { margin: 0; font-size: 1.5rem; }
.cta-band p { margin: 0; color: #cbd5e1; }

/* ---------- Tienda ---------- */
.page-title { padding: 28px 0 8px; }
.page-title h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); margin: 0; }
.page-title p { color: var(--muted); margin: 4px 0 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin: 14px 0 18px; }
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; max-width: 100%; scrollbar-width: thin; }
.chip { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 8px 14px; font-weight: 700; font-size: .88rem; }
.chip:hover { border-color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.sort { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.sort select { padding: 9px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font: inherit; color: var(--ink); }
.empty { text-align: center; padding: 56px 16px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .big { font-size: 3rem; display: block; margin-bottom: 8px; }
.notice { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 14px 16px; border-radius: 12px; }
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); aspect-ratio: 3 / 4; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Producto ---------- */
.crumbs { font-size: .85rem; color: var(--muted); padding: 16px 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a:hover { color: var(--brand); }
.pdp { display: grid; gap: 24px; padding-bottom: 32px; }
.gallery-main { aspect-ratio: 1 / 1; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs button { width: 64px; height: 64px; flex: none; border-radius: 10px; border: 2px solid transparent; padding: 0; overflow: hidden; background: #fff; }
.thumbs button.active { border-color: var(--brand); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pdp-info h1 { font-size: clamp(1.5rem, 5vw, 2.2rem); margin: 6px 0 8px; }
.pdp-info .lead { color: var(--muted); font-size: 1.05rem; }
.perks { display: grid; gap: 8px; margin: 18px 0; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: .93rem; font-weight: 600; }
.qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; font-weight: 700; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.qty button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.2rem; font-weight: 700; }
.qty button:hover { background: var(--brand-50); }
.qty output { min-width: 34px; text-align: center; font-weight: 800; }
.cta { display: grid; gap: 10px; }
.details-list { margin-top: 22px; display: grid; gap: 10px; }
details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--brand); }
details[open] summary::after { content: "−"; }
details > :not(summary) { padding-bottom: 14px; color: #334155; }
.feature-list li { padding: 4px 0 4px 26px; position: relative; }
.feature-list li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.sticky-buy { position: fixed; inset: auto 0 0 0; z-index: 40; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 12px; align-items: center; box-shadow: 0 -6px 20px rgba(15, 23, 42, .08); }
.sticky-buy .price { flex-direction: column; gap: 0; }
.sticky-buy .btn { flex: 1; }
.has-sticky { padding-bottom: 80px; }

/* ---------- Carrito / checkout ---------- */
.cart-layout { display: grid; gap: 20px; padding-bottom: 40px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel h2 { font-size: 1.15rem; margin-bottom: 14px; }
.line { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line:first-of-type { padding-top: 0; }
.line:last-of-type { border-bottom: 0; padding-bottom: 0; }
.line-media { width: 76px; height: 76px; border-radius: 12px; overflow: hidden; }
.line-media .ph span { font-size: 2.2rem; }
.line h3 { font-size: .98rem; margin: 0 0 2px; }
.line .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.link-btn { background: none; border: 0; color: var(--danger); font-weight: 600; font-size: .85rem; padding: 4px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-row.total { font-size: 1.25rem; font-weight: 800; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.free { color: var(--ok); font-weight: 800; }
.ship-hint { background: var(--brand-50); color: var(--brand-600); border-radius: 10px; padding: 10px 12px; font-size: .88rem; font-weight: 600; margin-bottom: 10px; }
.form-grid { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .9rem; }
.field label small { color: var(--muted); font-weight: 500; }
input, select, textarea { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pay-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--brand); background: var(--brand-50); border-radius: 12px; }
.pay-option input { width: auto; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.check input { width: auto; margin-top: 4px; }
.check a { color: var(--brand); text-decoration: underline; }
.form-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: .92rem; }
.form-error[hidden] { display: none; }
.done { text-align: center; max-width: 620px; margin: 0 auto; padding: 36px 0 56px; }
.done .big { font-size: 3.4rem; display: block; }
.done .ref { display: inline-block; background: var(--brand-50); color: var(--brand-600); font-weight: 800; padding: 6px 14px; border-radius: 99px; margin-bottom: 14px; }
.done .actions { display: grid; gap: 10px; margin-top: 18px; }
.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 12px; padding: 12px 14px; text-align: left; font-size: .93rem; }

/* ---------- Información ---------- */
.toc { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 24px; }
.info-section { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.info-section h2 { font-size: 1.35rem; }
.info-section h3 { font-size: 1.02rem; margin-top: 1.2em; }
.info-section ul.bullets { padding-left: 1.2em; list-style: disc; display: grid; gap: 6px; margin-bottom: 1em; }
.info-section p:last-child { margin-bottom: 0; }
.faq { display: grid; gap: 10px; }
.contact-cards { display: grid; gap: 12px; }
.contact-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 2px; }
.contact-card small { color: var(--muted); }
.legal-note { color: var(--muted); font-size: .85rem; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #cbd5e1; margin-top: 40px; padding: 40px 0 24px; font-size: .93rem; }
.footer-grid { display: grid; gap: 28px; }
.footer h4 { color: #fff; margin: 0 0 10px; font-size: .95rem; }
.footer li { padding: 3px 0; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer .logo { color: #fff; margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid #1e293b; margin-top: 28px; padding-top: 16px; color: #94a3b8; font-size: .82rem; display: grid; gap: 4px; }
.wa-float { position: fixed; right: 16px; bottom: 16px; z-index: 45; width: 56px; height: 56px; border-radius: 50%; background: var(--wa); display: grid; place-items: center; font-size: 1.7rem; box-shadow: 0 8px 20px rgba(0, 0, 0, .22); }
.has-sticky .wa-float { bottom: 92px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 99px; font-weight: 600; font-size: .92rem; box-shadow: var(--shadow); animation: pop .2s ease; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .cats { grid-template-columns: repeat(3, 1fr); }
  .benefits { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: span 2; }
  .contact-cards { grid-template-columns: repeat(2, 1fr); }
  .done .actions { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 760px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
}

/* ---------- Escritorio ---------- */
@media (min-width: 900px) {
  #site-header { min-height: 124px; }
  .nav { grid-template-columns: auto minmax(240px, 1fr) auto auto; grid-template-areas: "logo search nav cart"; gap: 20px; padding: 14px 0; }
  .menu-btn { display: none; }
  .main-nav { display: flex; flex-direction: row; gap: 4px; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; padding: 60px 0 68px; }
  .cats { grid-template-columns: repeat(6, 1fr); }
  .benefits { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .cta-band { grid-template-columns: 1fr auto; align-items: center; padding: 34px 40px; }
  .pdp { grid-template-columns: 1.05fr 1fr; gap: 44px; }
  .pdp-info { position: sticky; top: 100px; align-self: start; }
  .cta { grid-template-columns: 1fr 1fr; }
  .sticky-buy { display: none; }
  .has-sticky { padding-bottom: 0; }
  .has-sticky .wa-float { bottom: 16px; }
  .cart-layout { grid-template-columns: 1fr 380px; align-items: start; gap: 28px; }
  .summary-col { position: sticky; top: 100px; }
}
@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
