/* YCStudio · tienda
   Sistema visual YC (diseño-ui): paleta "Dosímetro", bordes "Esquina recortada",
   Chakra Petch + JetBrains Mono. Versión para web: medidas en píxeles, no en vh. */

:root {
    --ground: #0e0f0c;
    --surface: #161813;
    --surface-2: #1f221b;
    --line: #2c3026;
    --edge: #6b705f;
    --text: #e6e8dd;
    --dim: #a3a797;
    --accent: #e8f23a;
    --accent-hover: #f2f86e;
    --ink: #0e0f0c;

    --danger: #e5484d;
    --warning: #f0a33a;
    --info: #38b6e0;
    --success: #7bd88f;

    --font: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
    --mono: 'JetBrains Mono', Consolas, monospace;

    --notch-panel: 16px;
    --notch-control: 10px;
    --notch-field: 8px;

    --wrap: 1200px;
    --gutter: 24px;
    --header-h: 72px;

    color-scheme: dark;
}

@media (max-width: 640px) {
    :root { --gutter: 16px; --header-h: 62px; }
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ground);
    color: var(--text);
    font-family: var(--font);
    font-weight: 500;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

main { flex: 1; outline: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 0.9em; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: var(--edge); }

.wrap {
    width: 100%;
    max-width: calc(var(--wrap) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip {
    position: absolute;
    left: 8px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--accent);
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.skip:focus { top: 8px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ── Esquina recortada ─────────────────────────────────────────────────
   El elemento pinta el borde (--border) y ::before el relleno (--fill) 1 px hacia dentro.
   El relleno tiene que ser opaco y el foco se marca cambiando --border (outline no se ve). */
.cut {
    --cut: var(--notch-control);
    --fill: var(--surface);
    --border: var(--edge);
    position: relative;
    isolation: isolate;
    background: var(--border);
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}

.cut::before {
    content: '';
    position: absolute;
    inset: 1px;
    z-index: -1;
    background: var(--fill);
    clip-path: polygon(0 0, calc(100% - var(--cut) + 0.6px) 0, 100% calc(var(--cut) - 0.6px), 100% 100%, 0 100%);
}

.panel {
    --cut: var(--notch-panel);
    --border: var(--line);
    padding: 24px;
}

.panel-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* ── Texto ─────────────────────────────────────────────────────────────── */
.overline {
    margin: 0;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--dim);
}

.overline--accent { color: var(--accent); }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); }

.chip {
    --chip: var(--dim);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
    white-space: nowrap;
}

.chip::before {
    content: '';
    flex: none;
    width: 8px;
    height: 8px;
    background: var(--chip);
}

.chip--accent { --chip: var(--accent); }
.chip--success { --chip: var(--success); }
.chip--warning { --chip: var(--warning); }
.chip--danger { --chip: var(--danger); }
.chip--info { --chip: var(--info); }

.segments {
    display: flex;
    gap: 3px;
}

.segments i {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.07);
}

.segments i.on { background: var(--accent); }

/* ── Botones ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { --fill: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; --border: var(--accent); }
.btn:disabled, .btn.is-busy { opacity: 0.5; pointer-events: none; }

.btn--primary { --border: var(--accent); --fill: var(--accent); color: var(--ink); }
.btn--primary:hover { --border: var(--accent-hover); --fill: var(--accent-hover); }
.btn--primary:focus-visible { --border: var(--text); }

.btn--danger { --border: var(--danger); }
.btn--danger:hover { --fill: #2a1514; }

.btn--lg { min-height: 52px; padding: 0 26px; font-size: 14px; }
.btn--block { width: 100%; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--dim);
    cursor: pointer;
}

.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { color: var(--text); }

/* ── Campos ────────────────────────────────────────────────────────────── */
.field {
    --cut: var(--notch-field);
    --fill: var(--surface-2);
    display: flex;
    align-items: center;
}

.field:focus-within { --border: var(--accent); }

.field svg {
    flex: none;
    width: 17px;
    height: 17px;
    margin-left: 14px;
    color: var(--dim);
}

.field input {
    flex: 1;
    min-width: 0;
    min-height: 46px;
    padding: 0 14px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
}

.field input::placeholder { color: var(--dim); opacity: 1; }
.field input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.6); }

/* ── Barra de demostración ─────────────────────────────────────────────── */
.demo-bar {
    background: #2a2210;
    border-bottom: 1px solid #5c4a1c;
    font-size: 13px;
    color: var(--text);
}

.demo-bar .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    padding-top: 9px;
    padding-bottom: 9px;
}

/* ── Cabecera ──────────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(14, 15, 12, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    height: var(--header-h);
}

.brand { flex: none; display: flex; align-items: center; }
.brand img { width: auto; height: calc(var(--header-h) - 16px); }

.nav { display: flex; align-items: center; gap: 4px; }

.nav a {
    position: relative;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--dim);
}

.nav a:hover, .nav a.is-active { color: var(--text); }

.nav a.is-active::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 3px;
    height: 2px;
    background: var(--accent);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.account-chip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

.cart-count {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    background: var(--surface-2);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0;
    color: var(--dim);
}

.cart-btn.has-items { --border: var(--accent); }
.cart-btn.has-items .cart-count { background: var(--accent); color: var(--ink); }
.cart-btn.is-bump { animation: bump 0.4s ease; }

@keyframes bump {
    40% { transform: translateY(-3px); }
}

.menu-btn { display: none; }

@media (max-width: 860px) {
    .menu-btn { display: inline-grid; }
    .account-chip { display: none; }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px var(--gutter) 16px;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
    }

    .nav.is-open {
        transform: none;
        opacity: 1;
        visibility: visible;
        transition: opacity 0.18s ease, transform 0.18s ease;
    }

    .nav a { padding: 14px 4px; border-bottom: 1px solid var(--line); }
    .nav a:last-child { border-bottom: 0; }
    .nav a.is-active::after { left: auto; right: 4px; top: 50%; bottom: auto; width: 8px; height: 8px; margin-top: -4px; }
}

@media (max-width: 480px) {
    .cart-label { display: none; }
    .cart-btn { padding: 0 12px; }
    .header-actions { gap: 4px; }
}

/* ── Portada ───────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(var(--ground), rgba(14, 15, 12, 0) 30%, rgba(14, 15, 12, 0) 70%, var(--ground)),
        repeating-linear-gradient(90deg, rgba(230, 232, 221, 0.035) 0 1px, transparent 1px 64px),
        repeating-linear-gradient(0deg, rgba(230, 232, 221, 0.035) 0 1px, transparent 1px 64px);
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center;
    gap: 56px;
    padding-top: 72px;
    padding-bottom: 80px;
}

.hero-title {
    margin: 18px 0 0;
    font-size: clamp(36px, 5.2vw, 64px);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: 0.01em;
    text-wrap: balance;
}

.hero-title em {
    font-style: normal;
    color: var(--accent);
}

.hero-text {
    max-width: 560px;
    margin: 22px 0 0;
    font-size: 18px;
    color: var(--dim);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-top: 34px;
}

.hero-art { position: relative; }

.hero-frame {
    --fill: var(--surface);
    --border: var(--edge);
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 0.86;
    padding: 40px;
}

.hero-frame::after {
    content: '';
    position: absolute;
    inset: 14px;
    z-index: -1;
    background:
        repeating-linear-gradient(90deg, rgba(230, 232, 221, 0.05) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(0deg, rgba(230, 232, 221, 0.05) 0 1px, transparent 1px 28px);
    mask-image: radial-gradient(closest-side, #000 30%, transparent);
    -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent);
}

.hero-frame img {
    width: 100%;
    max-width: 380px;
    height: auto;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
}

.hero-tag {
    position: absolute;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--dim);
}

.hero-tag--tl { top: 18px; left: 20px; }
.hero-tag--br { right: 20px; bottom: 16px; }
.hero-art .segments { position: absolute; left: 20px; bottom: 18px; }

@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; gap: 40px; padding-top: 44px; padding-bottom: 56px; }
    .hero-art { order: -1; max-width: 460px; }
    .hero-frame { aspect-ratio: 16 / 9; padding: 28px; }
    .hero-frame img { width: auto; height: min(150px, 30vw); }
    .hero-text { font-size: 17px; }
}

@media (max-width: 480px) {
    .hero-actions .btn { flex: 1 1 100%; }
}

/* ── Ventajas ──────────────────────────────────────────────────────────── */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    padding-top: 40px;
}

.feature {
    display: flex;
    gap: 16px;
    padding: 20px;
}

.feature-icon {
    --fill: var(--surface-2);
    --border: var(--line);
    --cut: 8px;
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    color: var(--accent);
}

.feature-icon svg { width: 22px; height: 22px; }

.feature h3 {
    margin: 2px 0 4px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.feature p { margin: 0; font-size: 14px; color: var(--dim); }

/* ── Secciones ─────────────────────────────────────────────────────────── */
.section { padding: 72px 0; }
.section + .section { padding-top: 0; }

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 26px;
}

.section-title {
    margin: 8px 0 0;
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 700;
    line-height: 1.1;
}

/* ── Catálogo ──────────────────────────────────────────────────────────── */
.toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0;
    scrollbar-width: none;
}

.filters::-webkit-scrollbar { display: none; }

.filter {
    --fill: var(--surface);
    --border: var(--line);
    flex: none;
    min-height: 40px;
    padding: 0 16px;
    font-size: 12px;
    color: var(--dim);
}

.filter:hover { --border: var(--edge); color: var(--text); }
.filter[aria-pressed='true'] { --border: var(--accent); --fill: var(--surface-2); color: var(--text); }

@media (max-width: 720px) {
    .toolbar { grid-template-columns: 1fr; }
    .filters { margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); }
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 18px;
}

.card {
    --cut: var(--notch-panel);
    --border: var(--line);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: transform 0.18s ease;
}

.card:hover { --border: var(--edge); }
.card:focus-within { --border: var(--accent); }

.card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.card-link:focus-visible { outline: none; }

.card-media {
    position: relative;
    margin: 1px 1px 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-2);
    clip-path: polygon(0 0, calc(100% - var(--cut) + 0.6px) 0, 100% calc(var(--cut) - 0.6px), 100% 100%, 0 100%);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.card:hover .card-media img { transform: scale(1.04); }

.card-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    padding: 4px 8px;
    background: var(--accent);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    padding: 18px 18px 0;
}

.card-title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.2;
}

.card-text {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14px;
    color: var(--dim);
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 18px;
}

.card-foot .btn { position: relative; z-index: 2; }

.price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    font-family: var(--mono);
}

.price-now { font-size: 18px; font-weight: 700; color: var(--text); }
.price-old { font-size: 13px; color: var(--dim); text-decoration: line-through; }
.price-sub { width: 100%; font-size: 11px; letter-spacing: 0.08em; color: var(--dim); text-transform: uppercase; }

/* Imagen que falta: marco técnico con las iniciales */
.placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(90deg, rgba(230, 232, 221, 0.04) 0 1px, transparent 1px 22px),
        repeating-linear-gradient(0deg, rgba(230, 232, 221, 0.04) 0 1px, transparent 1px 22px),
        var(--surface-2);
}

.placeholder span {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--edge);
}

/* Esqueleto mientras carga */
.skeleton .card-media,
.skeleton .sk {
    background: linear-gradient(90deg, var(--surface-2) 0%, #262a21 50%, var(--surface-2) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.3s linear infinite;
}

.sk { height: 14px; }
.sk--title { width: 70%; height: 20px; }
.sk--short { width: 45%; }

@keyframes shimmer {
    to { background-position: -200% 0; }
}

.state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 32px;
}

.state h3 { margin: 0; font-size: 20px; }
.state p { margin: 0; max-width: 560px; color: var(--dim); }

/* ── Sobre nosotros (texto de inicio de Tebex) ─────────────────────────── */
.about { padding: 32px; }

/* ── Ficha de recurso ──────────────────────────────────────────────────── */
.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 28px 0 22px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dim);
}

.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--text); }

.pkg {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-areas:
        'media buy'
        'desc buy';
    align-items: start;
    gap: 24px;
    padding-bottom: 72px;
}

.pkg-media { grid-area: media; min-width: 0; }
.pkg-buy { grid-area: buy; position: sticky; top: calc(var(--header-h) + 20px); }
.pkg-desc { grid-area: desc; min-width: 0; }

@media (max-width: 960px) {
    .pkg {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: 'media' 'buy' 'desc';
    }

    .pkg-buy { position: relative; top: auto; }
}

.stage {
    --cut: var(--notch-panel);
    --border: var(--line);
    padding: 1px;
}

.stage-view {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-2);
    clip-path: polygon(0 0, calc(100% - var(--cut) + 0.6px) 0, 100% calc(var(--cut) - 0.6px), 100% 100%, 0 100%);
}

.stage-view img { width: 100%; height: 100%; object-fit: cover; }
.stage-view iframe { display: block; width: 100%; height: 100%; border: 0; }

.thumbs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.thumb {
    --cut: 8px;
    --border: var(--line);
    flex: none;
    width: 112px;
    padding: 1px;
    border: 0;
    cursor: pointer;
}

.thumb:hover { --border: var(--edge); }
.thumb[aria-pressed='true'] { --border: var(--accent); }
.thumb:focus-visible { outline: none; --border: var(--accent); }

.thumb-view {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-2);
}

.thumb-view img { width: 100%; height: 100%; object-fit: cover; }

.thumb-view svg {
    position: absolute;
    inset: 0;
    width: 26px;
    height: 26px;
    margin: auto;
    color: var(--text);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

.pkg-buy { display: flex; flex-direction: column; gap: 16px; }

.pkg-title {
    margin: 0;
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 700;
    line-height: 1.1;
}

.pkg-buy .price-now { font-size: 30px; }
.pkg-buy .price-old { font-size: 15px; }

.pkg-actions { display: grid; gap: 10px; }

.spec {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface-2);
    font-size: 14px;
}

.row > span:last-child { font-family: var(--mono); font-size: 13px; color: var(--dim); text-align: right; }

.pkg-desc .panel-title { margin-bottom: 16px; }

/* Texto con formato que viene de Tebex */
.rich { font-size: 16px; color: var(--text); overflow-wrap: anywhere; }
.rich > :first-child { margin-top: 0; }
.rich > :last-child { margin-bottom: 0; }
.rich p, .rich ul, .rich ol, .rich blockquote, .rich pre, .rich table { margin: 0 0 14px; }
.rich h1, .rich h2, .rich h3, .rich h4, .rich h5, .rich h6 { margin: 26px 0 10px; font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: 0.04em; text-transform: uppercase; }
.rich ul, .rich ol { padding-left: 22px; }
.rich li { margin: 4px 0; }
.rich ul li::marker { color: var(--accent); }
.rich a { color: var(--accent); text-underline-offset: 3px; }
.rich strong, .rich b { color: #fff; }
.rich img { height: auto; margin: 10px 0; }
.rich hr { height: 1px; margin: 22px 0; border: 0; background: var(--line); }
.rich blockquote { padding: 10px 16px; border-left: 2px solid var(--accent); background: var(--surface-2); color: var(--dim); }
.rich code { padding: 1px 6px; background: var(--surface-2); }
.rich pre { padding: 14px; overflow-x: auto; background: var(--surface-2); }
.rich pre code { padding: 0; background: none; }
.rich table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rich th, .rich td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.rich .embed { position: relative; aspect-ratio: 16 / 9; margin: 14px 0; background: var(--surface-2); }
.rich .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rich video { width: 100%; height: auto; }

.related { padding-bottom: 80px; }

/* ── Páginas de texto y avisos ─────────────────────────────────────────── */
.page { max-width: 860px; padding-bottom: 80px; }
.page-head { padding: 28px 0 22px; }
.page-head h1 { margin: 10px 0 0; font-size: clamp(28px, 3.6vw, 42px); line-height: 1.1; }

.notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 640px;
    margin: 72px auto 96px;
    padding: 40px 32px;
    text-align: center;
}

.notice h1 { margin: 0; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; }
.notice p { margin: 0; color: var(--dim); }

.notice-icon {
    --fill: var(--surface-2);
    --border: var(--accent);
    --cut: 10px;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    color: var(--accent);
}

.notice-icon svg { width: 30px; height: 30px; }

/* ── Pie ───────────────────────────────────────────────────────────────── */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
    gap: 32px;
    padding-top: 44px;
    padding-bottom: 32px;
}

.footer-brand img { width: auto; height: 64px; }
.footer-brand p { max-width: 340px; margin: 14px 0 0; font-size: 14px; color: var(--dim); }

.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.footer-col .overline { margin-bottom: 6px; }
.footer-col a { font-size: 14px; color: var(--dim); text-decoration: none; }
.footer-col a:hover { color: var(--text); }
#footer-pages { display: contents; }

.footer-legal {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 18px;
    padding-bottom: 26px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--dim);
}

.footer-legal p { margin: 0; }
.footer-legal a { color: var(--text); }

@media (max-width: 760px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

/* ── Carrito ───────────────────────────────────────────────────────────── */
.drawer, .modal {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.drawer-backdrop, .modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 11, 9, 0.72);
    animation: fade 0.2s ease;
}

.drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(440px, 100%);
    background: var(--surface);
    border-left: 1px solid var(--line);
    outline: none;
    animation: slide 0.24s ease;
}

@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(32px); opacity: 0; } }

.drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 16px 16px 24px;
    border-bottom: 1px solid var(--line);
}

.drawer-head .panel-title { margin-top: 6px; font-size: 18px; }

.drawer-account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    color: var(--dim);
}

.link-btn {
    padding: 6px 0;
    border: 0;
    background: none;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.link-btn:hover { color: var(--text); }

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.line {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px;
    background: var(--surface-2);
}

.line + .line { margin-top: 8px; }

.line-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--ground); }
.line-media img { width: 100%; height: 100%; object-fit: cover; }
.line-media .placeholder span { font-size: 10px; letter-spacing: 0.1em; }
.line-name { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.25; }
.line-price { margin: 2px 0 0; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.line .icon-btn { width: 40px; height: 40px; }
.line .icon-btn:hover { color: var(--danger); }

.empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 0;
    color: var(--dim);
}

.drawer-foot {
    display: grid;
    gap: 14px;
    padding: 18px 24px 24px;
    border-top: 1px solid var(--line);
}

.coupon { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.coupon input { min-height: 44px; font-size: 15px; }
.coupons { display: flex; flex-wrap: wrap; gap: 8px; }

.coupon-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 4px 10px;
    background: var(--surface-2);
    font-family: var(--mono);
    font-size: 12px;
}

.coupon-tag button {
    padding: 2px 6px;
    border: 0;
    background: none;
    color: var(--dim);
    cursor: pointer;
}

.coupon-tag button:hover { color: var(--danger); }

.totals { display: grid; gap: 6px; margin: 0; }
.totals div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--dim); }
.totals dt, .totals dd { margin: 0; }
.totals dd { font-family: var(--mono); }
.totals .total { padding-top: 8px; border-top: 1px solid var(--line); font-size: 16px; font-weight: 700; color: var(--text); }
.totals .total dd { font-size: 18px; }

.secure {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-size: 12px;
    color: var(--dim);
}

.secure svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--success); }

/* ── Ventana de inicio de sesión ───────────────────────────────────────── */
.modal {
    display: grid;
    place-items: center;
    padding: 16px;
}

.modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(440px, 100%);
    padding: 28px;
    outline: none;
    animation: rise 0.22s ease;
}

@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

.modal-title { margin: 0; font-size: 24px; line-height: 1.15; }
.modal-panel .dim { margin: 0; font-size: 15px; }
.providers { display: grid; gap: 10px; margin-top: 6px; }

/* ── Avisos flotantes ──────────────────────────────────────────────────── */
.toasts {
    position: fixed;
    top: calc(var(--header-h) + 14px);
    left: 50%;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(440px, calc(100vw - 32px));
    transform: translateX(-50%);
    pointer-events: none;
}

.toast {
    --cut: 10px;
    --border: var(--edge);
    width: 100%;
    padding: 14px 16px;
    font-size: 14px;
    pointer-events: auto;
    animation: drop 0.22s ease;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

@keyframes drop { from { transform: translateY(-10px); opacity: 0; } }

.toast.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity 0.2s ease, transform 0.2s ease; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
