/* ==========================================================================
   P2K Dev Store — Sistema de diseño propio
   Sin dependencias externas. Organización:
   1. Tokens   2. Base   3. Layout   4. Componentes   5. Tienda
   6. Producto 7. Panel de administración   8. Utilidades
   ========================================================================== */

/* 1. Tokens
   ----------------------------------------------------------------------- */
:root {
    color-scheme: dark;

    /* Superficies */
    --bg: #07080b;
    --bg-elev: #0b0d12;
    --surface: #0f1218;
    --surface-2: #151922;
    --surface-3: #1c212c;
    --overlay: rgba(4, 5, 8, .72);

    /* Bordes */
    --border: rgba(255, 255, 255, .07);
    --border-strong: rgba(255, 255, 255, .12);
    --border-focus: rgba(59, 130, 255, .55);

    /* Texto */
    --text: #eef1f6;
    --text-2: #a5adbb;
    --text-3: #6c7484;

    /* Marca (azul eléctrico del logotipo) */
    --accent: #2f7bff;
    --accent-hover: #4a8dff;
    --accent-press: #1f66e5;
    --accent-text: #7fb0ff;
    --accent-soft: rgba(47, 123, 255, .12);
    --accent-line: rgba(47, 123, 255, .32);
    --accent-glow: 0 8px 28px -8px rgba(47, 123, 255, .55);

    /* Estados */
    --success: #2fbf71;
    --success-soft: rgba(47, 191, 113, .12);
    --warning: #f2a93b;
    --warning-soft: rgba(242, 169, 59, .12);
    --danger: #f0506e;
    --danger-soft: rgba(240, 80, 110, .12);
    --discord: #5865f2;
    --discord-hover: #4752c4;

    /* Tipografía */
    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    --fs-xs: .75rem;
    --fs-sm: .8125rem;
    --fs-md: .9375rem;
    --fs-lg: 1.0625rem;
    --fs-xl: 1.25rem;
    --fs-2xl: 1.625rem;
    --fs-3xl: 2.125rem;
    --fs-4xl: clamp(2.25rem, 4.6vw, 3.5rem);

    /* Espaciado y forma */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --container: 1200px;
    --gutter: clamp(16px, 4vw, 32px);
    --header-h: 68px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 8px 24px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .75);
    --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--fs-md);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--text); font-weight: 700; line-height: 1.2; letter-spacing: -.015em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
strong { color: var(--text); font-weight: 600; }
code, kbd { font-family: var(--font-mono); font-size: .9em; }

::selection { background: var(--accent); color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2a3140; }

.icon {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -.2em;
}
.icon-spin { animation: spin .8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 3. Layout
   ----------------------------------------------------------------------- */
.page { display: flex; flex-direction: column; min-height: 100vh; }
.page > main { flex: 1; }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.container-narrow { max-width: 640px; }

.section { padding-block: clamp(40px, 6vw, 72px); }
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.section-title { font-size: var(--fs-2xl); }
.section-sub { color: var(--text-2); font-size: var(--fs-sm); margin-top: 6px; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent-text);
}

/* Cabecera pública */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(7, 8, 11, .78);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.site-header .container {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: var(--r-md);
    background: #000;
    border: 1px solid var(--border-strong);
    overflow: hidden;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.35); }
.brand-name { font-weight: 700; font-size: var(--fs-lg); letter-spacing: -.01em; white-space: nowrap; }
.brand-tag {
    display: block;
    font-size: 11px;
    color: var(--text-3);
    font-weight: 500;
    letter-spacing: .02em;
    margin-top: 1px;
}

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-2);
    transition: color .15s, background .15s;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a.is-active { color: var(--text); }
.main-nav a.is-active .icon { color: var(--accent); }

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

.cart-trigger { position: relative; }
.count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg);
}
.count-badge.is-hidden { display: none; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 4px 4px 4px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--r-md);
}
.user-chip-info { line-height: 1.2; padding-right: 2px; }
.user-chip-name { display: block; font-size: var(--fs-sm); font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); }

.avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    object-fit: cover;
    background: var(--surface-3);
    flex-shrink: 0;
}
.avatar-lg { width: 40px; height: 40px; border-radius: var(--r-md); }

/* Pie de página */
.site-footer {
    margin-top: 48px;
    border-top: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text-3);
    font-size: var(--fs-sm);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    padding-block: 48px 32px;
}
.site-footer .brand-name { color: var(--text); }
.footer-about { max-width: 340px; margin-top: 14px; line-height: 1.6; }
.footer-title { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); font-weight: 600; margin-bottom: 14px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a, .footer-links span { display: inline-flex; align-items: center; gap: 8px; transition: color .15s; }
.footer-links a:hover, .footer-links button:hover { color: var(--text); }
.btn-reset { background: none; border: 0; padding: 0; color: inherit; font: inherit; display: inline-flex; align-items: center; gap: 8px; transition: color .15s; }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-block: 20px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: var(--fs-xs);
}

/* 4. Componentes
   ----------------------------------------------------------------------- */

/* Botones */
.btn {
    --btn-h: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--btn-h);
    padding: 0 16px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    user-select: none;
    transition: background .15s, border-color .15s, color .15s, box-shadow .2s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn-primary:active { background: var(--accent-press); }

.btn-secondary { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-3); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--accent-line); background: var(--accent-soft); }

.btn-discord { background: var(--discord); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn-discord:hover { background: var(--discord-hover); box-shadow: 0 8px 24px -10px rgba(88, 101, 242, .7); }

.btn-danger-outline { background: transparent; border-color: rgba(240, 80, 110, .35); color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger-soft); }

.btn-sm { --btn-h: 32px; padding: 0 12px; font-size: var(--fs-xs); border-radius: var(--r-sm); }
.btn-lg { --btn-h: 50px; padding: 0 22px; font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn-block { width: 100%; }
.btn-icon { width: var(--btn-h); padding: 0; }
.btn-icon .icon { width: 1.25em; height: 1.25em; }

/* Etiquetas */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 9px;
    border-radius: var(--r-sm);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    white-space: nowrap;
}
.tag-accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.tag-success { background: var(--success-soft); border-color: rgba(47, 191, 113, .3); color: var(--success); }
.tag-warning { background: var(--warning-soft); border-color: rgba(242, 169, 59, .3); color: var(--warning); }
.tag-danger { background: var(--danger-soft); border-color: rgba(240, 80, 110, .3); color: var(--danger); }
.tag-overlay { background: rgba(7, 8, 11, .78); border-color: var(--border-strong); color: var(--text); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex-shrink: 0; }
.dot-live { color: var(--success); animation: pulse 2s ease-in-out infinite; }

/* Tarjetas genéricas */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}
.card-pad { padding: clamp(20px, 3vw, 28px); }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.card-title { font-size: var(--fs-md); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card-title .icon { color: var(--accent); }

/* Alertas */
.flash-stack { display: grid; gap: 10px; padding-top: 20px; }
.flash-stack:empty { display: none; }
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: var(--fs-sm);
    color: var(--text);
    animation: fade-up .3s var(--ease);
}
.alert .icon { width: 18px; height: 18px; margin-top: 1px; }
.alert-success { border-color: rgba(47, 191, 113, .3); background: linear-gradient(0deg, var(--success-soft), var(--success-soft)), var(--surface); }
.alert-success .icon { color: var(--success); }
.alert-error { border-color: rgba(240, 80, 110, .3); background: linear-gradient(0deg, var(--danger-soft), var(--danger-soft)), var(--surface); }
.alert-error .icon { color: var(--danger); }
.alert-info { border-color: var(--accent-line); background: linear-gradient(0deg, var(--accent-soft), var(--accent-soft)), var(--surface); }
.alert-info .icon { color: var(--accent-text); }
.alert-warning { border-color: rgba(242, 169, 59, .3); background: linear-gradient(0deg, var(--warning-soft), var(--warning-soft)), var(--surface); color: #f6d39c; }
.alert-warning .icon { color: var(--warning); }

/* Estado vacío */
.empty {
    text-align: center;
    padding: clamp(40px, 7vw, 72px) 24px;
    color: var(--text-2);
}
.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: var(--r-lg);
    display: grid;
    place-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-3);
}
.empty-icon .icon { width: 26px; height: 26px; }
.empty h3 { font-size: var(--fs-lg); margin-bottom: 6px; }
.empty p { font-size: var(--fs-sm); max-width: 380px; margin: 0 auto; }
.empty .btn { margin-top: 20px; }

/* Icono en caja */
.icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent-text);
}
.icon-box .icon { width: 22px; height: 22px; }
.icon-box-lg { width: 64px; height: 64px; border-radius: var(--r-lg); }
.icon-box-lg .icon { width: 30px; height: 30px; }
.icon-box-success { background: var(--success-soft); border-color: rgba(47, 191, 113, .3); color: var(--success); }
.icon-box-discord { background: rgba(88, 101, 242, .12); border-color: rgba(88, 101, 242, .35); color: #8b95ff; }

/* Formularios */
.field { display: grid; gap: 8px; }
.label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.label .req { color: var(--danger); margin-left: 2px; }
.hint { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.5; }
.input, .select, .textarea {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    color: var(--text);
    font-size: var(--fs-sm);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.select {
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5adbb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(255, 255, 255, .18); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(47, 123, 255, .18);
    background: var(--bg);
}
.input-mono { font-family: var(--font-mono); font-size: 12.5px; }

.search {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    padding: 5px;
    transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 4px rgba(47, 123, 255, .14); }
.search > .icon { margin-left: 12px; color: var(--text-3); }
.search input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    background: transparent;
    border: 0;
    outline: none;
    font-size: var(--fs-md);
}
.search input::placeholder { color: var(--text-3); }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    color: var(--text-3);
    padding-block: 20px;
    min-width: 0;
}
.breadcrumb a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: color .15s; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .icon { width: 14px; height: 14px; }
.breadcrumb .current { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Lista clave / valor */
.kv { display: grid; gap: 0; margin: 0; }
.kv-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--fs-sm);
}
.kv-row:last-child { border-bottom: 0; }
.kv-row dt { color: var(--text-3); }
.kv-row dd { margin: 0; font-weight: 600; text-align: right; display: inline-flex; align-items: center; gap: 6px; }

/* Lista de garantías */
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.check-list li { display: flex; gap: 12px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.5; }
.check-list .icon { width: 18px; height: 18px; color: var(--accent-text); margin-top: 1px; }

/* Toast */
.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    font-size: var(--fs-sm);
    font-weight: 500;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.toast .icon { width: 18px; height: 18px; }
.toast-success .icon { color: var(--success); }
.toast-error .icon { color: var(--danger); }
.toast-info .icon { color: var(--accent-text); }

/* Drawer del carrito */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: var(--overlay);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s var(--ease), visibility 0s linear .25s;
}
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 61;
    width: min(440px, 100vw);
    display: flex;
    flex-direction: column;
    background: var(--bg-elev);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .3s var(--ease), visibility 0s linear .3s;
}
.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; transition-delay: 0s; }
.drawer-open .drawer { transform: none; visibility: visible; transition-delay: 0s; }
.drawer-open { overflow: hidden; }

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.drawer-head h2 { font-size: var(--fs-lg); display: flex; align-items: center; gap: 10px; }
.drawer-head h2 .icon { color: var(--accent); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer-foot { border-top: 1px solid var(--border); padding: 20px; display: grid; gap: 14px; background: var(--surface); }
.drawer-total { display: flex; align-items: baseline; justify-content: space-between; }
.drawer-total span { font-size: var(--fs-sm); color: var(--text-2); }
.drawer-total strong { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; }
.drawer-note { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.drawer-note .icon { width: 14px; height: 14px; }

.cart-list { display: grid; gap: 10px; }
.cart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}
.cart-item img {
    width: 56px;
    height: 56px;
    border-radius: var(--r-sm);
    object-fit: cover;
    background: var(--surface-3);
    flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-price { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }
.cart-item .btn-icon:hover { color: var(--danger); background: var(--danger-soft); }

/* 5. Tienda
   ----------------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    isolation: isolate;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
}
.hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 720px;
    height: 720px;
    right: -180px;
    top: -320px;
    background: radial-gradient(circle, rgba(47, 123, 255, .22), transparent 62%);
    pointer-events: none;
}
.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
    padding-block: clamp(48px, 8vw, 96px);
}
.hero h1 { font-size: var(--fs-4xl); letter-spacing: -.035em; line-height: 1.04; margin-top: 18px; }
.hero h1 .accent {
    background: linear-gradient(100deg, #9cc2ff, var(--accent) 60%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-lead { margin-top: 18px; font-size: var(--fs-lg); color: var(--text-2); max-width: 540px; line-height: 1.6; }
.hero .search { margin-top: 32px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 28px; font-size: var(--fs-sm); color: var(--text-3); }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta .icon { color: var(--accent-text); }

.hero-visual { position: relative; display: grid; place-items: center; }
.hero-emblem {
    position: relative;
    width: min(100%, 380px);
    aspect-ratio: 1;
    border-radius: 28px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border-strong);
    box-shadow: 0 40px 100px -40px rgba(47, 123, 255, .55), var(--shadow-lg);
}
.hero-emblem img { width: 100%; height: 100%; object-fit: cover; }
.hero-emblem::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(160deg, rgba(255, 255, 255, .08), transparent 40%);
    pointer-events: none;
}
.hero-stat {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(15, 18, 24, .88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
}
.hero-stat .icon-box { width: 36px; height: 36px; }
.hero-stat .icon-box .icon { width: 18px; height: 18px; }
.hero-stat strong { display: block; font-size: var(--fs-lg); line-height: 1.1; }
.hero-stat small { font-size: 11.5px; color: var(--text-3); }
.hero-stat-a { left: -8px; bottom: 14%; }
.hero-stat-b { right: -8px; top: 12%; }

/* Barra de filtros */
.filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    max-width: 100%;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.filter:hover { color: var(--text); background: var(--surface-2); }
.filter.is-active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.filter .count { font-size: 11px; color: var(--text-3); font-weight: 600; }

.result-note { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--text-2); margin-bottom: 20px; }
.result-note a { color: var(--accent-text); }
.result-note a:hover { text-decoration: underline; }

/* Rejilla de productos */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: border-color .2s, transform .25s var(--ease), box-shadow .25s var(--ease);
    animation: fade-up .4s var(--ease) both;
}
.product-card:hover { border-color: var(--accent-line); transform: translateY(-3px); box-shadow: 0 22px 44px -24px rgba(47, 123, 255, .45); }
.product-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--bg-elev);
    overflow: hidden;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.product-card:hover .product-media img { transform: scale(1.04); }
.product-media .tag { position: absolute; top: 12px; left: 12px; }
.product-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 18px 0; flex: 1; }
.product-name { font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; }
.product-name a { transition: color .15s; }
.product-name a:hover { color: var(--accent-text); }
.product-name a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.product-desc {
    font-size: var(--fs-sm);
    color: var(--text-2);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 18px;
    margin-top: 12px;
    border-top: 1px solid var(--border);
}
.product-foot .btn { position: relative; z-index: 1; }

.price { display: inline-flex; align-items: baseline; gap: 5px; font-weight: 700; letter-spacing: -.02em; font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.price small { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--text-3); }
.price-label { display: block; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-bottom: 2px; }

/* Ventajas */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { display: flex; gap: 16px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.feature h3 { font-size: var(--fs-md); font-weight: 600; margin-bottom: 4px; }
.feature p { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.55; }

/* Bloque de aviso centrado */
.notice-card { max-width: 620px; margin: 0 auto; text-align: center; }
.notice-card .icon-box { margin: 0 auto 20px; }
.notice-card h1, .notice-card h2 { font-size: var(--fs-2xl); margin-bottom: 10px; }
.notice-card > p { color: var(--text-2); }
.notice-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 28px; }

/* 6. Producto
   ----------------------------------------------------------------------- */
.product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 32px;
    align-items: start;
    padding-bottom: 24px;
}
.product-main { display: grid; gap: 20px; min-width: 0; }
.gallery-main {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--r-xl);
    overflow: hidden;
    background: var(--bg-elev);
    border: 1px solid var(--border);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumb {
    width: 88px;
    height: 60px;
    flex-shrink: 0;
    padding: 0;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    opacity: .6;
    transition: opacity .15s, border-color .15s;
}
.gallery-thumb:hover, .gallery-thumb.is-active { opacity: 1; border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

.buy-card { position: sticky; top: calc(var(--header-h) + 24px); padding: 28px; display: grid; gap: 22px; }
.buy-card h1 { font-size: var(--fs-3xl); letter-spacing: -.03em; line-height: 1.12; }
.buy-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-3); }
.buy-price {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 18px 20px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}
.buy-price .price { font-size: 2.25rem; }
.buy-price .price small { font-size: var(--fs-sm); }
.buy-actions { display: grid; gap: 10px; }
.buy-card .check-list { padding-top: 22px; border-top: 1px solid var(--border); }

/* Contenido enriquecido (descripción de Tebex) */
.prose { color: var(--text-2); font-size: var(--fs-md); line-height: 1.75; overflow-wrap: anywhere; }
.prose p:empty, .prose p:has(> br:only-child) { display: none; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 1em; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); margin: 1.6em 0 .6em; }
.prose h1 { font-size: var(--fs-2xl); }
.prose h2 { font-size: var(--fs-xl); }
.prose h3, .prose h4 { font-size: var(--fs-lg); }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: #fff; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--accent); }
.prose img { border-radius: var(--r-md); margin: 1em 0; height: auto; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; color: var(--text); }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; color: var(--text); }
.prose pre { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose iframe, .prose video { max-width: 100%; border-radius: var(--r-md); }

/* Página de éxito / pasos */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; text-align: left; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; font-size: var(--fs-sm); color: var(--text-2); }
.steps li::before {
    counter-increment: step;
    content: counter(step);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent-text);
    font-weight: 700;
    font-size: var(--fs-sm);
}
.steps strong { display: block; margin-bottom: 4px; font-size: var(--fs-md); }
.steps a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

.code-block {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 10px 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--accent-text);
}
.code-block code { flex: 1; min-width: 0; overflow-wrap: anywhere; user-select: all; }

.error-code {
    font-size: clamp(5rem, 16vw, 8.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.06em;
    background: linear-gradient(180deg, #fff, rgba(255, 255, 255, .15));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 12px;
}

/* 7. Panel de administración
   ----------------------------------------------------------------------- */
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
    position: sticky;
    top: 0;
    width: 256px;
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    z-index: 50;
}
.sidebar .brand { padding: 0 8px 22px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.nav-label { padding: 0 10px; margin: 6px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.side-nav { display: grid; gap: 2px; }
.side-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-2);
    transition: background .15s, color .15s;
}
.side-nav a .icon { width: 18px; height: 18px; color: var(--text-3); transition: color .15s; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.is-active { background: var(--surface-2); color: var(--text); }
.side-nav a.is-active .icon { color: var(--accent); }
.side-nav a.is-active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.sidebar-foot .btn { justify-content: flex-start; }
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-top: 6px;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--border);
}
.sidebar-user-info { flex: 1; min-width: 0; line-height: 1.25; }
.sidebar-user-info strong { display: block; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info span { font-size: 11px; color: var(--warning); font-weight: 600; letter-spacing: .04em; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 40;
    height: 60px;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: rgba(11, 13, 18, .9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.admin-content { padding: clamp(20px, 3.5vw, 40px); max-width: 1280px; width: 100%; }
.admin-content .flash-stack { padding-top: 0; margin-bottom: 24px; }
.sidebar-backdrop { display: none; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.page-head h1 { font-size: var(--fs-2xl); letter-spacing: -.025em; }
.page-head p { color: var(--text-2); font-size: var(--fs-sm); margin-top: 6px; }
.page-head form { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 20px; display: grid; gap: 14px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: var(--fs-sm); color: var(--text-2); font-weight: 500; }
.stat-top .icon { width: 18px; height: 18px; color: var(--text-3); }
.stat-value { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-value.is-ok { color: var(--success); font-size: var(--fs-xl); }
.stat-value.is-bad { color: var(--danger); font-size: var(--fs-xl); }
.stat-foot { font-size: var(--fs-xs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tablas */
.table-wrap { overflow-x: auto; }
.table { font-size: var(--fs-sm); }
.table th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 12px 22px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 14px 22px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; white-space: nowrap; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .02); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .t-right { text-align: right; }
.table .t-strong { color: var(--text); font-weight: 600; }
.table .t-wrap { white-space: normal; min-width: 220px; }
.cell-user { display: flex; align-items: center; gap: 12px; }
.cell-user strong { display: block; font-size: var(--fs-sm); }
.cell-user small { font-size: 11.5px; color: var(--text-3); }
.cell-thumb { width: 56px; height: 36px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-3); border: 1px solid var(--border); }
.cell-desc { font-size: var(--fs-xs); color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; max-width: 380px; margin-top: 2px; }

/* Ajustes */
.settings-section {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 32px;
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
}
.settings-section:first-of-type { padding-top: 0; }
.settings-intro h2 { font-size: var(--fs-lg); display: flex; align-items: center; gap: 10px; }
.settings-intro h2 .icon { color: var(--accent); }
.settings-intro p { margin-top: 8px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.6; }
.settings-intro a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.settings-fields { padding: 24px; display: grid; gap: 20px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.save-bar {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding: 16px 0;
    background: linear-gradient(180deg, transparent, var(--bg) 35%);
}
.save-bar p { font-size: var(--fs-sm); color: var(--text-3); }

/* 8. Utilidades
   ----------------------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-3); }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.text-accent { color: var(--accent-text); }
.mt-0 { margin-top: 0; }
.stack { display: grid; gap: 24px; }
.inline { display: inline; margin: 0; }
[hidden] { display: none !important; }

/* Responsive
   ----------------------------------------------------------------------- */
@media (max-width: 1080px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-layout { grid-template-columns: minmax(0, 1fr) 360px; }
    .settings-section { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 920px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-visual { display: none; }
    .product-layout { grid-template-columns: 1fr; }
    .buy-card { position: static; order: -1; }
    .features { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid > :first-child { grid-column: 1 / -1; }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform .28s var(--ease);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-open .sidebar { transform: none; }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 45;
        background: var(--overlay);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s, visibility 0s linear .25s;
    }
    .sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; transition-delay: 0s; }
    .admin-topbar { display: flex; }
}

@media (max-width: 720px) {
    :root { --header-h: 60px; }
    .main-nav, .brand-tag, .user-chip-info, .hide-sm { display: none; }
    .site-header .container { gap: 12px; }
    .btn-discord .btn-label { display: none; }
    .btn-discord.btn-collapse { width: var(--btn-h); padding: 0; }
    .field-row { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat { padding: 16px; }
    .stat-value { font-size: 1.6rem; }
    .buy-card { padding: 22px; }
    .buy-card h1 { font-size: var(--fs-2xl); }
    .section-head { margin-bottom: 18px; }
    .save-bar p { display: none; }
    .save-bar .btn { width: 100%; }
    .toast { right: 16px; bottom: 16px; left: 16px; min-width: 0; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr; }
}

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