/* ==========================================================
   Plantillas Eros — estilo limpio y moderno con toques de color
   ========================================================== */
:root {
    /* Colores de acento (las claves coinciden con Template::COLORS) */
    --red: #ff5a5f;    --red-d: #e0393f;    --red-s: #fff0f0;
    --yellow: #ffb020; --yellow-d: #d98a00; --yellow-s: #fff7e6;
    --blue: #3b82f6;   --blue-d: #1d5fd6;   --blue-s: #eef4ff;
    --green: #10b981;  --green-d: #058a5f;  --green-s: #e8faf3;
    --orange: #ff7a45; --orange-d: #e0531b; --orange-s: #fff2ec;
    --purple: #7c5cff; --purple-d: #5a3ae0; --purple-s: #f3f0ff;

    --ink: #12131f;
    --ink-soft: #5b5e74;
    --ink-faint: #9a9cb0;
    --bg: #f7f7fb;
    --card: #ffffff;
    --line: #e7e7f0;
    --radius: 20px;
    --shadow-sm: 0 1px 2px rgba(18, 19, 31, .06), 0 2px 8px rgba(18, 19, 31, .04);
    --shadow: 0 2px 4px rgba(18, 19, 31, .04), 0 12px 32px rgba(18, 19, 31, .08);
    --shadow-lg: 0 4px 8px rgba(18, 19, 31, .05), 0 24px 60px rgba(18, 19, 31, .14);
    --gradient: linear-gradient(120deg, var(--purple) 0%, var(--red) 55%, var(--yellow) 100%);
    --font-head: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; letter-spacing: -.02em; line-height: 1.08; margin: 0; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- Botones ---------- */
.btn {
    --bg: var(--ink); --fg: #fff;
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    font: 600 .98rem/1 var(--font-body);
    padding: .9em 1.4em;
    color: var(--fg); background: var(--bg);
    border: 1px solid transparent; border-radius: 999px;
    text-decoration: none; cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(18, 19, 31, .18); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.btn-red { --bg: var(--red); }
.btn-blue { --bg: var(--blue); }
.btn-green { --bg: var(--ink); }
.btn-green:hover { --bg: var(--purple); }
.btn-white { --bg: #fff; --fg: var(--ink); border-color: var(--line); }
.btn-white:hover { box-shadow: var(--shadow-sm); border-color: #d4d4e2; }
.btn-gradient { background: var(--gradient); background-size: 200% 100%; color: #fff; }
.btn-gradient:hover { background-position: 100% 0; box-shadow: 0 10px 24px rgba(124, 92, 255, .35); }
.btn-sm { font-size: .88rem; padding: .7em 1.1em; }
.btn-block { width: 100%; }

/* ---------- Cabecera ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(247, 247, 251, .82);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.3rem var(--font-head); letter-spacing: -.02em; }
.logo-mark {
    display: grid; place-items: center; width: 34px; height: 34px;
    background: var(--gradient); color: #fff; border-radius: 10px;
    font: 800 1.05rem var(--font-head); transform: rotate(-6deg);
    box-shadow: 0 6px 14px rgba(255, 90, 95, .3);
}
.logo b { font-weight: 700; color: var(--purple); }
.nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.nav form { margin: 0; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 80px 0 70px; overflow: hidden; }
.hero::before, .hero::after {
    content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .45;
}
.hero::before { width: 460px; height: 460px; right: -80px; top: -60px; background: var(--purple-s); background: radial-gradient(circle, rgba(124, 92, 255, .45), transparent 70%); }
.hero::after { width: 380px; height: 380px; right: 280px; bottom: -160px; background: radial-gradient(circle, rgba(255, 176, 32, .4), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.tag {
    display: inline-flex; align-items: center; gap: 8px;
    font-weight: 600; font-size: .85rem; color: var(--ink-soft);
    padding: 6px 14px 6px 8px; background: #fff;
    border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm);
}
.tag::before { content: "Nuevo"; font-size: .72rem; font-weight: 700; color: #fff; background: var(--green); padding: 3px 9px; border-radius: 999px; }
.hero h1 { font-size: clamp(2.6rem, 5.6vw, 4.4rem); margin: 22px 0 20px; }
.hero h1 .hl { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .price {
    display: inline-block; position: relative; white-space: nowrap;
}
.hero h1 .price::after {
    content: ""; position: absolute; left: -2%; right: -2%; bottom: .04em; height: .32em; z-index: -1;
    background: var(--yellow); opacity: .55; border-radius: 6px; transform: rotate(-1.5deg);
}
.hero p { font-size: 1.15rem; color: var(--ink-soft); max-width: 520px; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats div { color: var(--ink-soft); font-size: .9rem; }
.hero-stats strong { display: block; font: 700 1.9rem var(--font-head); color: var(--ink); letter-spacing: -.02em; }

/* Ventanas flotantes del hero */
.showcase { position: relative; height: 420px; }
.window {
    --c: var(--purple);
    position: absolute; width: 300px;
    background: #fff; border: 1px solid var(--line); border-radius: 16px;
    box-shadow: var(--shadow-lg); overflow: hidden;
    animation: float 6s ease-in-out infinite;
}
.window-bar { display: flex; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.window-bar i { width: 9px; height: 9px; border-radius: 50%; background: #e3e3ec; }
.window-bar i:first-child { background: #ff6b6b; } .window-bar i:nth-child(2) { background: #ffc145; } .window-bar i:nth-child(3) { background: #3ccf8e; }
.window-body { padding: 18px; }
.window-hero { height: 86px; border-radius: 10px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #fff)); margin-bottom: 14px; }
.window-line { height: 9px; border-radius: 5px; background: #ececf3; margin-bottom: 8px; }
.window-line.w60 { width: 60%; } .window-line.w80 { width: 80%; background: #d9d9e4; }
.window-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.window-cols span { height: 42px; border-radius: 8px; background: color-mix(in srgb, var(--c) 14%, #fff); }
.window.w1 { --c: var(--purple); left: 4%; top: 30px; transform: rotate(-5deg); }
.window.w2 { --c: var(--red); left: 32%; top: 120px; z-index: 2; animation-delay: -2s; }
.window.w3 { --c: var(--green); left: 14%; top: 250px; width: 250px; transform: rotate(4deg); animation-delay: -4s; }
.sticker {
    position: absolute; z-index: 3; right: 2%; top: 60px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 96px; height: 96px; border-radius: 50%;
    font: 800 1.5rem/1 var(--font-head); color: var(--ink); text-align: center;
    background: var(--yellow); box-shadow: 0 12px 28px rgba(255, 176, 32, .4);
    transform: rotate(12deg); animation: wobble 5s ease-in-out infinite;
}
.sticker small { display: block; font: 600 .72rem/1.1 var(--font-body); }
@keyframes float { 50% { translate: 0 -12px; } }
@keyframes wobble { 50% { transform: rotate(4deg) scale(1.05); } }

/* ---------- Filtros ---------- */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
.section-head p { margin: 6px 0 0; color: var(--ink-soft); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    font: 600 .88rem var(--font-body); padding: 8px 16px; cursor: pointer;
    background: #fff; color: var(--ink-soft);
    border: 1px solid var(--line); border-radius: 999px;
    transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { color: var(--ink); border-color: #cfcfdf; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.search {
    font: 500 .95rem var(--font-body); padding: 11px 18px; min-width: 240px;
    border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.search:focus { outline: 3px solid color-mix(in srgb, var(--purple) 30%, transparent); border-color: var(--purple); }

/* ---------- Tarjetas de plantillas ---------- */
.catalog { padding: 30px 0 90px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.card {
    --c: var(--red); --cs: var(--red-s); --cd: var(--red-d);
    position: relative; display: flex; flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); overflow: hidden;
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card[data-color="yellow"] { --c: var(--yellow); --cs: var(--yellow-s); --cd: var(--yellow-d); }
.card[data-color="blue"] { --c: var(--blue); --cs: var(--blue-s); --cd: var(--blue-d); }
.card[data-color="green"] { --c: var(--green); --cs: var(--green-s); --cd: var(--green-d); }
.card[data-color="orange"] { --c: var(--orange); --cs: var(--orange-s); --cd: var(--orange-d); }
.card[data-color="purple"] { --c: var(--purple); --cs: var(--purple-s); --cd: var(--purple-d); }
.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--cs); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-badge {
    position: absolute; top: 14px; right: 14px;
    font: 700 .9rem var(--font-body); padding: 6px 12px;
    background: #fff; color: var(--ink); border-radius: 999px; box-shadow: var(--shadow);
}
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-cat { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: .8rem; color: var(--cd); }
.card-cat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.card-body h3 { font-size: 1.4rem; }
.card-body p { margin: 0; color: var(--ink-soft); font-size: .94rem; flex: 1; }
.card-actions { display: flex; gap: 10px; margin-top: 10px; }
.card-actions .btn { flex: 1; }

/* Miniatura generada por CSS cuando la plantilla no tiene imagen */
.mock {
    position: absolute; inset: 22px 22px 0; background: #fff;
    border-radius: 12px 12px 0 0; padding: 30px 16px 0; overflow: hidden;
    box-shadow: 0 -2px 20px rgba(18, 19, 31, .08);
    transition: transform .3s;
}
.card:hover .mock { transform: translateY(-4px); }
.mock::before { content: ""; position: absolute; top: 11px; left: 12px; width: 40px; height: 8px; background: radial-gradient(circle, #dcdce6 3.5px, transparent 4px) 0 0 / 13px 8px repeat-x; }
.mock-nav { display: flex; justify-content: space-between; margin-bottom: 16px; }
.mock-nav i, .mock-line, .mock-block { display: block; background: #ececf3; border-radius: 5px; }
.mock-nav i:first-child { width: 26%; height: 9px; background: var(--c); }
.mock-nav i:last-child { width: 38%; height: 9px; }
.mock-line { height: 11px; width: 72%; margin-bottom: 8px; background: var(--ink); opacity: .85; }
.mock-line.short { width: 48%; opacity: .15; }
.mock-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.mock-block { height: 46px; background: var(--cs); border-radius: 8px; }
.mock-block:nth-child(2) { background: color-mix(in srgb, var(--c) 30%, #fff); }
.mock-btn { display: inline-block; width: 64px; height: 18px; margin-top: 4px; background: var(--c); border-radius: 999px; }

.empty {
    text-align: center; padding: 60px 20px; background: #fff;
    border: 1px dashed #d4d4e2; border-radius: var(--radius); color: var(--ink-soft);
}
.empty h3 { color: var(--ink); font-size: 1.6rem; margin-bottom: 8px; }

/* ---------- Pasos ---------- */
.steps { padding: 20px 0 90px; }
.steps-box {
    position: relative; overflow: hidden;
    background: var(--ink); color: #fff; border-radius: 28px; padding: clamp(32px, 5vw, 60px);
}
.steps-box::after {
    content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 92, 255, .55), transparent 70%);
}
.steps h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin-bottom: 34px; position: relative; z-index: 1; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; position: relative; z-index: 1; }
.step { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 18px; padding: 24px; }
.step-num {
    display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px;
    font: 700 1.2rem var(--font-head); border-radius: 12px; color: #fff;
}
.step:nth-child(1) .step-num { background: var(--purple); }
.step:nth-child(2) .step-num { background: var(--red); }
.step:nth-child(3) .step-num { background: var(--green); }
.step h3 { font-size: 1.3rem; margin-bottom: 6px; }
.step p { margin: 0; color: rgba(255, 255, 255, .68); }

.footer { padding: 30px 0 40px; text-align: center; color: var(--ink-faint); font-size: .9rem; border-top: 1px solid var(--line); }

/* ---------- Avisos ---------- */
.flash {
    display: flex; align-items: center; gap: 10px;
    margin: 18px 0 0; padding: 14px 18px; font-weight: 600;
    background: var(--green-s); color: var(--green-d); border: 1px solid color-mix(in srgb, var(--green) 30%, #fff); border-radius: 14px;
}
.flash::before { content: "✓"; display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--green); color: #fff; font-size: .8rem; }
.flash.error { background: var(--red-s); color: var(--red-d); border-color: color-mix(in srgb, var(--red) 30%, #fff); }
.flash.error::before { content: "!"; background: var(--red); }
.toast {
    position: fixed; left: 50%; bottom: 26px; z-index: 100;
    translate: -50% 160%; opacity: 0; visibility: hidden;
    transition: translate .35s cubic-bezier(.3, 1.4, .5, 1), opacity .2s, visibility .35s;
    max-width: calc(100% - 32px);
    padding: 14px 22px; font-weight: 600; background: var(--ink); color: #fff;
    border-radius: 14px; box-shadow: var(--shadow-lg);
}
.toast.show { translate: -50% 0; opacity: 1; visibility: visible; }

/* ---------- Formularios / Auth ---------- */
.auth-wrap { min-height: calc(100vh - 160px); display: grid; place-items: center; padding: 50px 0; }
.panel {
    position: relative; width: min(440px, 100%);
    background: #fff; border: 1px solid var(--line); border-radius: 24px;
    box-shadow: var(--shadow-lg); padding: 38px 32px 32px; overflow: hidden;
}
.panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--panel-c, var(--gradient)); }
.panel h1 { font-size: 2rem; margin-bottom: 6px; }
.panel .sub { margin: 0 0 24px; color: var(--ink-soft); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .88rem; }
.field input, .field select, .field textarea {
    font: 500 .98rem var(--font-body); color: var(--ink);
    padding: 12px 14px; background: #fff;
    border: 1px solid #dcdce6; border-radius: 12px; width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px color-mix(in srgb, var(--purple) 15%, transparent); }
.field input[type="file"] { padding: 10px; background: var(--bg); }
.field .hint { font-size: .82rem; color: var(--ink-faint); }
.field .err { color: var(--red-d); font-weight: 600; font-size: .85rem; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-bottom: 20px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); }
.auth-alt { text-align: center; margin: 20px 0 0; color: var(--ink-soft); }
.auth-alt a { color: var(--purple); font-weight: 600; text-decoration: none; }

@media (max-width: 900px) {
    .hero { padding-top: 50px; }
    .hero-grid { grid-template-columns: 1fr; }
    .showcase { height: 340px; max-width: 460px; width: 100%; margin-inline: auto; }
    .window { width: 250px; }
    .window.w3 { width: 210px; top: 200px; }
    .steps-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .logo { font-size: 1.1rem; }
    .nav { flex-wrap: nowrap; gap: 6px; }
    .hero-stats { gap: 20px; }
    .hero-stats strong { font-size: 1.6rem; }
    .search { min-width: 0; width: 100%; }
    .grid { grid-template-columns: 1fr; }
    .showcase { height: 300px; }
    .window { width: 210px; }
    .window.w2 { left: 26%; }
    .window.w3 { width: 180px; top: 180px; }
    .sticker { width: 78px; height: 78px; font-size: 1.2rem; top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Vista previa en vivo ---------- */
.card-media[data-preview] { cursor: zoom-in; }
.card-media[data-preview]:focus-visible { outline: 3px solid var(--purple); outline-offset: -3px; }
.live-frame {
    position: absolute; top: 0; left: 0;
    width: 1280px; height: 800px; border: 0; background: #fff;
    transform-origin: 0 0; transform: scale(var(--s, .28));
    pointer-events: none;
}
.zoom-hint {
    position: absolute; left: 14px; bottom: 14px;
    padding: 6px 12px; font-size: .82rem; font-weight: 600;
    color: #fff; background: rgba(18, 19, 31, .78); border-radius: 999px;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    opacity: 0; translate: 0 6px; transition: opacity .2s, translate .2s;
}
.card-media:hover .zoom-hint, .card-media:focus-visible .zoom-hint { opacity: 1; translate: 0 0; }

.viewer {
    width: min(1400px, 100vw - 32px); height: min(900px, 100vh - 32px);
    max-width: none; max-height: none; padding: 0;
    border: 0; border-radius: 20px; overflow: hidden;
    background: var(--ink); color: #fff; box-shadow: var(--shadow-lg);
}
.viewer[open] { display: flex; flex-direction: column; animation: pop .25s cubic-bezier(.2, .9, .3, 1.2); }
.viewer::backdrop { background: rgba(18, 19, 31, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.viewer-bar { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 20px; flex-wrap: wrap; }
.viewer-bar strong { font: 700 1.1rem var(--font-head); margin-right: auto; }
.viewer-devices { display: flex; padding: 3px; background: rgba(255, 255, 255, .08); border-radius: 999px; }
.viewer-devices button {
    font: 600 .82rem var(--font-body); color: #a9abc0; background: none;
    border: 0; padding: 7px 14px; border-radius: 999px; cursor: pointer;
}
.viewer-devices button.active { background: #fff; color: var(--ink); }
.viewer-actions { display: flex; align-items: center; gap: 8px; }
.viewer-close {
    display: grid; place-items: center; width: 38px; height: 38px;
    font-size: 1rem; color: #fff; background: rgba(255, 255, 255, .1);
    border: 0; border-radius: 50%; cursor: pointer;
}
.viewer-close:hover { background: rgba(255, 255, 255, .2); }
.viewer-stage { flex: 1; display: flex; justify-content: center; padding: 0 10px 10px; background: var(--ink); min-height: 0; }
.viewer-stage iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: #fff; transition: width .3s; }

@media (max-width: 700px) {
    .viewer { width: 100vw; height: 100dvh; border-radius: 0; }
    .viewer-devices { display: none; }
    .viewer-bar .btn { font-size: .8rem; }
}

/* ---------- Valoraciones ---------- */
.reviews { padding: 0 0 90px; }
.reviews-head { justify-content: center; text-align: center; }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.review {
    position: relative; margin: 0; display: flex; flex-direction: column; gap: 16px;
    padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s;
}
.review:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.review.is-draft { border: 1px dashed var(--yellow-d); background: var(--yellow-s); }
.review-draft {
    position: absolute; top: -11px; left: 20px;
    padding: 3px 10px; font-size: .72rem; font-weight: 700;
    color: var(--ink); background: var(--yellow); border-radius: 999px;
}
.review-stars { display: flex; gap: 2px; font-size: 1.15rem; line-height: 1; color: #dcdce6; }
.review-stars .on { color: var(--yellow); }
.review blockquote { margin: 0; flex: 1; color: var(--ink); font-size: .98rem; line-height: 1.6; }
.review figcaption { display: flex; align-items: center; gap: 12px; font-size: .92rem; }
.review figcaption small { color: var(--ink-soft); font-size: .82rem; }
.review-avatar {
    display: grid; place-items: center; width: 42px; height: 42px; flex: none;
    font: 700 .9rem var(--font-head); color: #fff; background: var(--gradient); border-radius: 50%;
}
.card-media.is-playing .zoom-hint { opacity: 1; translate: 0 0; }

/* ---------- Favoritos (cabecera y tarjetas) ---------- */
.fav-link {
    position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none;
    color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 50%;
    transition: border-color .15s, box-shadow .15s;
}
.fav-link:hover, .fav-link.active { border-color: #d4d4e2; box-shadow: var(--shadow-sm); }
.fav-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.fav-link.active svg { fill: var(--red); stroke: var(--red); }
.fav-count {
    position: absolute; top: -5px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px;
    display: grid; place-items: center; font: 700 .7rem/1 var(--font-body);
    color: #fff; background: var(--red); border: 2px solid var(--bg); border-radius: 999px;
}
.fav-count.bump { animation: bump .35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 40% { transform: scale(1.35); } }

.fav-form { position: absolute; top: 14px; left: 14px; z-index: 4; margin: 0; }
.fav-btn {
    display: grid; place-items: center; width: 38px; height: 38px; padding: 0; cursor: pointer;
    color: var(--ink); background: rgba(255, 255, 255, .92); border: 0; border-radius: 50%;
    box-shadow: var(--shadow); transition: transform .15s;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.fav-btn:hover { transform: scale(1.1); }
.fav-btn:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.fav-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; transition: fill .15s, stroke .15s; }
.fav-btn.is-on svg { fill: var(--red); stroke: var(--red); animation: bump .35s cubic-bezier(.3, 1.8, .5, 1); }
.fav-btn:disabled { opacity: .7; }

/* ---------- Páginas de compra ---------- */
.page { padding: 50px 0 90px; min-height: calc(100vh - 170px); }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.7rem); }
.page-head p { margin: 6px 0 0; color: var(--ink-soft); }
.back-link { display: inline-block; margin-bottom: 10px; color: var(--ink-soft); font-weight: 600; font-size: .9rem; text-decoration: none; }
.back-link:hover { color: var(--ink); }
.checkout-grid { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.box-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.line-item { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-item form { margin: 0; }
.line-thumb {
    --c: var(--purple); --cs: var(--purple-s);
    display: grid; place-items: center; width: 64px; height: 46px; flex: none; overflow: hidden;
    font: 700 1.2rem var(--font-head); color: var(--c); background: var(--cs); border-radius: 10px;
}
.line-thumb[data-color="red"] { --c: var(--red); --cs: var(--red-s); }
.line-thumb[data-color="yellow"] { --c: var(--yellow-d); --cs: var(--yellow-s); }
.line-thumb[data-color="blue"] { --c: var(--blue); --cs: var(--blue-s); }
.line-thumb[data-color="green"] { --c: var(--green); --cs: var(--green-s); }
.line-thumb[data-color="orange"] { --c: var(--orange); --cs: var(--orange-s); }
.line-thumb img { width: 100%; height: 100%; object-fit: cover; }
.line-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.line-info strong { font-weight: 600; }
.line-info span { color: var(--ink-soft); font-size: .88rem; }
.line-info a { color: var(--purple); }
.line-price { font: 700 1.05rem var(--font-head); white-space: nowrap; }
.line-remove {
    display: grid; place-items: center; width: 32px; height: 32px; cursor: pointer;
    color: var(--ink-faint); background: none; border: 0; border-radius: 50%; font-size: .9rem;
}
.line-remove:hover { color: var(--red-d); background: var(--red-s); }
.line-total { justify-content: space-between; background: var(--bg); font-weight: 600; }
.line-total strong { font: 700 1.3rem var(--font-head); }

.summary {
    position: sticky; top: 90px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.summary h2 { font-size: 1.3rem; margin-bottom: 14px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; color: var(--ink-soft); }
.summary-row.total { margin: 6px 0 4px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.summary-row.total span:last-child { font: 700 1.6rem var(--font-head); }
.summary-note { margin: 12px 0 0; font-size: .85rem; color: var(--ink-soft); }
.summary-note a { color: var(--purple); font-weight: 600; }
.muted-sm { font-size: .85rem; color: var(--ink-soft); overflow-wrap: anywhere; text-align: right; }
.check.small { align-items: flex-start; font-size: .84rem; font-weight: 500; color: var(--ink-soft); line-height: 1.45; }
.check.small input { margin-top: 2px; flex: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.demo-banner {
    margin-bottom: 24px; padding: 14px 18px; font-size: .92rem;
    color: #7a5200; background: var(--yellow-s); border: 1px dashed var(--yellow-d); border-radius: 14px;
}
.pay-method {
    display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 16px 20px;
    background: #fff; border: 1px solid var(--line); border-radius: 16px;
}
.pay-method div { display: flex; flex-direction: column; }
.pay-method span:not(.pay-icon) { font-size: .88rem; color: var(--ink-soft); }
.pay-icon { font-size: 1.5rem; }

.success-head { text-align: center; margin-bottom: 30px; }
.success-icon {
    display: inline-grid; place-items: center; width: 68px; height: 68px; margin-bottom: 16px;
    font-size: 2rem; color: #fff; background: var(--green); border-radius: 50%;
    box-shadow: 0 12px 28px rgba(16, 185, 129, .35); animation: bump .5s cubic-bezier(.3, 1.8, .5, 1);
}
.success-head h1 { font-size: clamp(2rem, 4vw, 2.6rem); }
.success-head p { margin: 6px 0 0; color: var(--ink-soft); }

@media (max-width: 860px) {
    .checkout-grid { grid-template-columns: 1fr; }
    .summary { position: static; }
}
@media (max-width: 560px) {
    .line-item { flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
    .line-info { flex-basis: calc(100% - 140px); }
}

/* ---------- Cuenta: botón de perfil y desplegable ---------- */
.nav { flex-wrap: nowrap; gap: 10px; }
.account { position: relative; }
.account-btn {
    display: grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer;
    color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 50%;
    font: 700 .88rem var(--font-head); letter-spacing: .02em;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.account-btn:hover { border-color: #d4d4e2; box-shadow: var(--shadow-sm); }
.account-btn:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.account-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.account-btn.is-user { color: #fff; background: var(--gradient); border-color: transparent; }
.account-btn[aria-expanded="true"] { box-shadow: 0 0 0 4px color-mix(in srgb, var(--purple) 20%, transparent); }

.account-menu {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
    width: 270px; padding: 8px; display: flex; flex-direction: column; gap: 2px;
    background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
    animation: menu-in .16s ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }
.account-menu > a:not(.btn), .menu-logout {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 12px; border-radius: 10px;
    font: 500 .94rem var(--font-body); color: var(--ink); text-decoration: none;
    background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.account-menu > a:not(.btn):hover, .account-menu > a:not(.btn):focus-visible,
.menu-logout:hover, .menu-logout:focus-visible { background: var(--bg); outline: none; }
.account-menu form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
.menu-logout { color: var(--red-d); }
.menu-logout:hover, .menu-logout:focus-visible { background: var(--red-s); }
.menu-count { min-width: 20px; padding: 2px 6px; font-size: .72rem; font-weight: 700; text-align: center; color: #fff; background: var(--red); border-radius: 999px; }
.account-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.account-head span:last-child { display: flex; flex-direction: column; min-width: 0; }
.account-head strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-head small, .account-guest small { color: var(--ink-soft); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-guest { display: flex; flex-direction: column; padding: 8px 8px 12px; }
.account-guest small { white-space: normal; }
.account-menu .btn + .btn { margin-top: 6px; }
.account-avatar {
    display: grid; place-items: center; width: 40px; height: 40px; flex: none;
    font: 700 .9rem var(--font-head); color: #fff; background: var(--gradient); border-radius: 50%;
}
.account-avatar.lg { width: 72px; height: 72px; font-size: 1.5rem; margin-bottom: 10px; }

/* ---------- Páginas de perfil ---------- */
.profile { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }
.profile-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 16px; }
.profile-card {
    display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 18px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.profile-card strong { font-weight: 600; overflow-wrap: anywhere; }
.profile-card small { color: var(--ink-soft); font-size: .85rem; overflow-wrap: anywhere; }
.profile-card-text strong, .profile-card-text small { display: block; }
.profile-nav {
    display: flex; flex-direction: column; gap: 2px; padding: 8px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.profile-nav a {
    padding: 10px 14px; border-radius: 10px; color: var(--ink-soft); font-weight: 500; text-decoration: none;
}
.profile-nav a:hover { background: var(--bg); color: var(--ink); }
.profile-nav a.active { background: var(--ink); color: #fff; }
.profile-nav form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
.profile-nav .menu-logout { padding: 10px 14px; }
.profile-main, .profile-side { min-width: 0; }
.profile-card > span:not(.account-avatar) { min-width: 0; }
.box-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.optional { color: var(--ink-faint); font-weight: 500; }

@media (max-width: 860px) {
    .profile { grid-template-columns: 1fr; gap: 20px; }
    .profile-side { position: static; }
    .profile-card { flex-direction: row; text-align: left; gap: 14px; padding: 16px; }
    .profile-card-text { min-width: 0; }
    .profile-card .account-avatar.lg { width: 52px; height: 52px; font-size: 1.1rem; margin: 0; }
    .profile-card strong, .profile-card small { display: block; }
    .profile-nav { flex-direction: row; overflow-x: auto; }
    .profile-nav a, .profile-nav .menu-logout { white-space: nowrap; }
    .profile-nav form { margin: 0; padding: 0; border: 0; }
    .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Packs de créditos ---------- */
.packs { padding: 10px 0 90px; }
.packs-head { justify-content: center; text-align: center; }
.packs-balance {
    max-width: 640px; margin: -6px auto 26px; padding: 12px 18px; text-align: center;
    color: var(--purple-d); background: var(--purple-s); border-radius: 999px; font-size: .95rem;
}
.packs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 1020px; margin-inline: auto; align-items: center; }
.pack {
    position: relative; display: flex; flex-direction: column; padding: 30px 26px 26px;
    background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-sm);
    transition: transform .25s, box-shadow .25s;
}
.pack:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.pack.is-popular { padding-block: 40px 30px; border: 2px solid transparent; box-shadow: var(--shadow-lg);
    background: linear-gradient(#fff, #fff) padding-box, var(--gradient) border-box; }
.pack-flag {
    position: absolute; top: -14px; left: 50%; translate: -50% 0; white-space: nowrap;
    padding: 5px 14px; font-size: .78rem; font-weight: 700; color: #fff; background: var(--gradient); border-radius: 999px;
}
.pack h3 { font-size: 1.4rem; }
.pack-desc { margin: 4px 0 18px; color: var(--ink-soft); }
.pack-price { font: 800 2.8rem/1 var(--font-head); letter-spacing: -.03em; }
.pack-unit { margin: 8px 0 20px; color: var(--ink-soft); font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pack-save { padding: 3px 9px; font-size: .75rem; font-weight: 700; color: var(--green-d); background: var(--green-s); border-radius: 999px; }
.pack-list { list-style: none; margin: 0 0 24px; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: .93rem; }
.pack-list li { display: flex; gap: 10px; }
.pack-list li::before { content: "✓"; color: var(--green); font-weight: 700; }
.pack .btn { margin-top: auto; }

.redeem-form { flex: 1; margin: 0; }
.menu-credits { background: var(--purple-s); margin-bottom: 4px; }
.menu-credits strong { color: var(--purple-d); font-family: var(--font-head); font-size: 1.05rem; }
.credits-pill {
    margin-top: 12px; padding: 6px 14px; font-size: .85rem; font-weight: 600; text-decoration: none;
    color: var(--purple-d); background: var(--purple-s); border-radius: 999px;
}
.credits-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    margin-bottom: 22px; padding: 18px 22px;
    background: var(--purple-s); border: 1px solid color-mix(in srgb, var(--purple) 25%, #fff); border-radius: 18px;
}
.credits-banner div { display: flex; flex-direction: column; }
.credits-banner strong { color: var(--purple-d); }
.credits-banner span { color: var(--ink-soft); font-size: .9rem; }
.pack-thumb { --c: var(--purple); --cs: var(--purple-s); font-size: 1rem; }

@media (max-width: 860px) {
    .packs-grid { grid-template-columns: 1fr; max-width: 420px; }
    .pack.is-popular { order: -1; }
    .profile-card .credits-pill { margin: 0 0 0 auto; }
}

/* ---------- Packs en pequeño (bajo el hero) ---------- */
.mini-packs { position: relative; z-index: 2; margin: -30px 0 30px; }
.mini-packs-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
    padding: 16px 18px 16px 24px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm);
}
.mini-packs-label { display: flex; flex-direction: column; }
.mini-packs-label strong { font: 700 1.05rem var(--font-head); }
.mini-packs-label a { font-size: .88rem; font-weight: 600; color: var(--purple); text-decoration: none; }
.mini-packs-label a:hover { text-decoration: underline; }
.mini-packs-list { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-pack {
    display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px 10px 16px;
    color: var(--ink); text-decoration: none; background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.mini-pack:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: #d4d4e2; }
.mini-pack:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.mini-pack.is-popular { border: 2px solid transparent; background: linear-gradient(#fff, #fff) padding-box, var(--gradient) border-box; }
.mini-pack-name { font-size: .9rem; color: var(--ink-soft); }
.mini-pack-price { font: 700 1.05rem var(--font-head); }
.mini-pack-save { padding: 2px 8px; font-size: .74rem; font-weight: 700; color: var(--green-d); background: var(--green-s); border-radius: 999px; }

@media (max-width: 700px) {
    .mini-packs { margin-top: 10px; }
    .mini-packs-inner { padding: 16px; }
    .mini-packs-list { width: 100%; display: grid; grid-template-columns: 1fr; }
    .mini-pack { justify-content: space-between; border-radius: 14px; }
    .mini-pack-name { flex: 1; }
}

/* ---------- Página de plantilla ---------- */
.card-link { text-decoration: none; }
.card-link:hover { color: var(--purple); }
.card-link:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; border-radius: 4px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; font-size: .88rem; color: var(--ink-faint); }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }
.tpl-grid { display: grid; grid-template-columns: 1fr 320px; gap: 36px; align-items: start; }
.tpl-main { min-width: 0; }
.tpl-main h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); margin: 8px 0 12px; }
.tpl-main h2 { font-size: 1.5rem; margin: 40px 0 16px; }
.tpl-lead { margin: 0 0 26px; font-size: 1.1rem; color: var(--ink-soft); max-width: 720px; }
.tpl-preview { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.tpl-preview iframe, .tpl-preview img { display: block; width: 100%; aspect-ratio: 16 / 10; border: 0; object-fit: cover; }
.tpl-preview-empty { aspect-ratio: 16 / 10; display: grid; place-items: center; color: var(--ink-faint); background: var(--bg); }
.tpl-features { border-top: 0; padding-top: 0; }
.tpl-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; color: var(--ink-soft); }
.tpl-steps strong { color: var(--ink); }
.tpl-buy { top: 90px; }
.tpl-price { font: 800 3rem/1 var(--font-head); letter-spacing: -.03em; }
.tpl-actions { display: grid; gap: 10px; }
.tpl-actions form { margin: 0; }
.tpl-actions .btn { width: 100%; }
.tpl-related { margin-top: 56px; }
.tpl-related h2 { font-size: 1.5rem; margin-bottom: 16px; }
.line-link { color: inherit; text-decoration: none; transition: background .15s; }
.line-link:hover { background: var(--bg); }

/* ---------- Preguntas frecuentes ---------- */
.faq { padding: 0 0 90px; }
.faq-list { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.faq-item summary {
    list-style: none; cursor: pointer; padding: 18px 54px 18px 22px; position: relative;
    font: 600 1.02rem var(--font-body);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+"; position: absolute; right: 20px; top: 50%; translate: 0 -50%;
    display: grid; place-items: center; width: 26px; height: 26px; font-size: 1.1rem;
    color: var(--purple); background: var(--purple-s); border-radius: 50%; transition: rotate .2s;
}
.faq-item[open] summary::after { rotate: 45deg; }
.faq-item summary:focus-visible { outline: 3px solid var(--purple); outline-offset: -3px; border-radius: 16px; }
.faq-item p { margin: 0; padding: 0 22px 20px; color: var(--ink-soft); line-height: 1.65; }

@media (max-width: 900px) {
    .tpl-grid { grid-template-columns: 1fr; }
    .tpl-buy { position: static; }
}
