
.pill-condicion {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 0.78em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.pill-condicion:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.pill-condicion.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* Footer de versión */
.footer-version {
    text-align: center;
    margin-top: 40px;
    color: #888;
    font-size: 0.95em;
}
/* Botón especial para el tablón */
.btn-tablon {
    padding: 10px 24px;
    background: #ffd700;
    color: #3b2f2f;
    font-weight: bold;
    border-radius: 8px;
    border: 2px solid #a67c52;
    font-size: 1.1rem;
    cursor: button;
    margin-bottom: 10px;
}
.btn-tablon:hover {
    background: #ffcc00;
    color: #222;
}

.enlace-volver {
    color: #007bff;
    text-decoration: underline;
    font-size: 1rem;
    margin-bottom: 20px;
    display: inline-block;
}

/* --- THEME VARIABLES --- */
:root {
    --color-background: #e8f4f8;
    --color-surface: #fff;
    --color-text-primary: #333;
    --color-text-secondary: #555;
    --color-text-muted: #7f8c8d;
    --color-primary: #3498db;
    --color-primary-hover: #2980b9;
    --color-border: #e0e0e0;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --color-card-bg: #fafafa;
    --color-card-border: #ddd;
    --color-header-bg: #fff;
    --color-header-border: #eee;
    --color-header-shadow: rgba(0,0,0,0.05);
    --color-header-link: #3498db;
    --color-header-link-hover-bg: #f0f0f0;
    --color-header-link-hover-text: #2980b9;
    --color-footer-bg: rgba(255, 255, 255, 0.6);
    --color-footer-text: #555;
    --color-h1-h2: #34495e;
    --color-input-border: #ccc;
    --color-success-bg: #eaf7ed;
    --color-success-text: #27ae60;
    --color-error-bg: #fdecea;
    --color-error-text: #c0392b;
}

body.dark-mode {
    --color-background: #121212;
    --color-surface: #1e1e1e;
    --color-text-primary: #e0e0e0;
    --color-text-secondary: #b0b0b0;
    --color-text-muted: #888;
    --color-primary: #63b3ed;
    --color-primary-hover: #5dade2;
    --color-border: #333;
    --color-shadow: rgba(0, 0, 0, 0.2);
    --color-card-bg: #2a2a2a;
    --color-card-border: #444;
    --color-header-bg: #1e1e1e;
    --color-header-border: #333;
    --color-header-shadow: rgba(0,0,0,0.2);
    --color-header-link: #87CEFA;
    --color-header-link-hover-bg: #333;
    --color-header-link-hover-text: #fff;
    --color-footer-bg: #1e1e1e;
    --color-footer-text: #b0b0b0;
    --color-h1-h2: #ecf0f1;
    --color-input-border: #555;
    --color-success-bg: rgba(39, 174, 96, 0.2);
    --color-success-text: #2ecc71;
    --color-error-bg: rgba(192, 57, 43, 0.2);
    --color-error-text: #e74c3c;
}

/* Mejora de visibilidad para el menú móvil en modo oscuro */
body.dark-mode .mobile-nav a {
    color: #FFFFFF;
}

/* --- ESTILOS PARA EL LAYOUT DE TIENDA/CATÁLOGO/TABLÓN --- */
.tienda-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.tienda-sidebar {
    flex: 0 0 250px;
    position: sticky;
    top: 80px; /* ✅ CAMBIO: era 20px, ahora respeta la altura del header */
    max-height: calc(100vh - 100px); /* ✅ NUEVO: evita que se salga de la pantalla */
    overflow-y: auto; /* ✅ NUEVO: scroll interno si los filtros son largos */
}
.tienda-sidebar .tienda-controles {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
    text-align: left;
}
.tienda-productos-main {
    flex: 1;
}

/* --- Media Query para el layout en móvil --- */
@media (max-width: 850px) {
    .tienda-layout {
        flex-direction: column;
    }
    .tienda-sidebar {
        position: static;
        width: 100%;
    }
}

/* --- ESTILOS PARA EL MENÚ HAMBURGUESA (MÓVIL) --- */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: var(--color-text-primary);
}

/* Estilos generales para todas las páginas */
body {
    font-family: 'Arial', sans-serif;
    background-color: var(--color-background);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='160' opacity='0.12'%3E%3Crect x='5' y='5' width='110' height='150' rx='10' ry='10' fill='none' stroke='%23888' stroke-width='3'/%3E%3Crect x='12' y='12' width='96' height='136' rx='7' ry='7' fill='none' stroke='%23888' stroke-width='1.5'/%3E%3Ccircle cx='60' cy='75' r='28' fill='none' stroke='%23888' stroke-width='2'/%3E%3Cpath d='M60 47 L73 68 L95 68 L78 83 L85 105 L60 91 L35 105 L42 83 L25 68 L47 68 Z' fill='none' stroke='%23888' stroke-width='2'/%3E%3C/svg%3E");
    background-size: 120px 160px;
    background-repeat: repeat;
    color: var(--color-text-primary);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--color-surface);
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--color-shadow);
}

h1, h2 {
    color: var(--color-h1-h2);
    text-align: center;
}

/* Ocultar el menú móvil por defecto en todas las vistas */
.mobile-nav {
    display: none;
    width: 100%;
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--color-text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    height: 100px;
    width: 220px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .header-logo {
        height: 80px;
        width: 190px;
        object-fit: contain;
    }
}

body.dark-mode .header-logo {
    content: url('/LOGOSIMPLENOCHE.jpg');
}

/* Estilos del Header y Navegación */
header {
    padding: 0;
    background-color: var(--color-header-bg);
    box-shadow: 0 2px 4px var(--color-header-shadow);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: sticky; /* ✅ NUEVO: header pegado al tope al hacer scroll */
    top: 0;           /* ✅ NUEVO */
    z-index: 500;     /* ✅ NUEVO: queda por encima del contenido */
}

/* Barra principal (logo, búsqueda, acciones) */
.header-main-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 16px;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    border-bottom: 1px solid var(--color-border);
}

/* --- ESTILOS PARA EL NUEVO FILTRO DE JUEGO GLOBAL --- */
.game-filter-container {
    display: flex;
    align-items: center;
}
.game-filter {
    display: flex;
    gap: 10px;
    background-color: var(--color-surface);
    padding: 5px;
    border-radius: 25px;
    border: 1px solid var(--color-border);
}
.game-filter label {
    cursor: pointer;
    position: relative;
}
.game-filter input[type="radio"] {
    display: none;
}
.tcg-logo-filter {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 50%;
    transition: transform 0.2s, box-shadow 0.2s;
}
.game-filter input[type="radio"]:checked + .tcg-logo-filter {
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--color-primary);
}

/* Contenedor de la búsqueda */
.header-search-form {
    flex-grow: 1;
    display: flex;
    max-width: 600px;
    margin: 0 20px;
}

.header-search-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--color-input-border);
    border-radius: 25px 0 0 25px;
    font-size: 1em;
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    border-right: none;
}

.header-search-form button {
    padding: 0 15px;
    border: 1px solid var(--color-input-border);
    border-left: none;
    background-color: var(--color-surface);
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 0 25px 25px 0;
    font-size: 1.2em;
}

/* Contenedor para botones de la derecha */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-bar {
    width: 100%;
    background-color: #212F42;
    padding: 5px 0;
}

header nav.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 25px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    box-sizing: border-box;
}

header .nav-bar a {
    text-decoration: none;
    color: #d0d3d4;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 5px;
    transition: color 0.2s, background-color 0.2s;
}

header .nav-bar a:hover {
    background-color: var(--color-primary-hover);
    color: #FFD700 !important;
}

/* --- THEME TOGGLE BUTTON --- */
.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    color: var(--color-text-secondary);
    padding: 0;
}

.theme-toggle:hover {
    background-color: var(--color-header-link-hover-bg);
}

/* Botón de Vender en el header */
.btn-vender {
    background-color: #2ecc71;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s;    
}

.btn-vender:hover {
    background-color: #27ae60;
}

/* Estilos para los enlaces de login/registro en el header */
.auth-links-desktop a {
    margin: 0 8px;
    font-weight: bold;
    color: var(--color-primary);
    text-decoration: none;
}

body.dark-mode .auth-links-desktop a {
    color: #ecf0f1;
}
body.dark-mode .auth-links-desktop a:hover {
    color: var(--color-primary);
}

/* --- NUEVOS ESTILOS PARA INDEX.HTML --- */
.hero-search {
    background: #2c3e50;
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.hero-search-title {
    font-size: 2.8em;
    margin-bottom: 10px;
    color: white;
}

.hero-search-subtitle {
    font-size: 1.2em;
    color: #bdc3c7;
    margin-bottom: 30px;
}

.hero-search-title .sub-headline {
    display: block;
    font-size: 0.6em;
    font-weight: normal;
    margin-top: 10px;
    letter-spacing: 0.5px;
}

.hero-search-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    max-width: 750px;
    margin: 0 auto;
}

.hero-search-form .search-logo {
    height: 80px;
    width: auto;
}

.hero-search-form input {
    width: 100%;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    font-size: 1.1em;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.hero-search-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.hero-search-form button {
    padding: 15px 25px;
    border: none;
    border-radius: 5px;
    background-color: var(--color-primary);
    color: white;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.hero-search-form button:hover {
    background-color: var(--color-primary-hover);
}

.btn-vender-hero {
    display: inline-block;
    padding: 15px 25px;
    background-color: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-vender-hero:hover {
    background-color: #27ae60;
}

.features-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 50px 20px;
    width: 100%;
    box-sizing: border-box;
}

.features-section .misiones-container,
.features-section .contenedor-cartas {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
}

.features-section h2 {
    color: var(--color-h1-h2);
}

.btn-mision {
    background-color: #e67e22;
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 15px;
    display: inline-block;
    transition: background-color 0.2s;
}

.btn-mision:hover {
    background-color: #d35400;
}

/* Estilos para botones generales */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-azul {
    background-color: var(--color-primary);
}

.btn-azul:hover {
    background-color: var(--color-primary-hover);
}

.btn-verde {
    background-color: #ae275f;
}
.btn-verde:hover {
    background-color: #7b1e41;
}

.publicar-main {
    max-width: 600px;
    margin: 20px auto;
    background-color: var(--color-surface);
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Estilos para el formulario de publicación */
.formulario-publicar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.formulario-publicar label {
    font-weight: bold;
    color: var(--color-text-secondary);
}

.formulario-publicar input[type="text"],
.formulario-publicar input[type="number"],
.formulario-publicar input[type="tel"],
.formulario-publicar textarea,
.formulario-publicar input[type="file"],
.formulario-publicar select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-input-border);
    border-radius: 5px;
    box-sizing: border-box;
    background-color: var(--color-surface);
    color: var(--color-text-primary);
}

/* Estilos para el botón de regresar */
.boton-regresar {
    display: inline-block;
    padding: 10px 15px;
    margin-bottom: 20px;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.boton-regresar:hover {
    background-color: var(--color-primary-hover);
}

/* Estilos de la lista de cartas (tienda.html) */
#contenedor-cartas-publicadas {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 1100px) {
    #contenedor-cartas-publicadas {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    #contenedor-cartas-publicadas {
        grid-template-columns: repeat(2, 1fr);
        width: 100% !important;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    #contenedor-cartas-publicadas {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
}

.contenedor-cartas {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.contenedor-cartas .card {
    flex: 0 0 180px;
    max-width: 200px;
}

.tienda-controles {
    margin-bottom: 20px;
    text-align: center;
}

/* Corrección para el fondo de autocompletado del navegador en modo oscuro */
body.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill:hover, 
body.dark-mode input:-webkit-autofill:focus, 
body.dark-mode input:-webkit-autofill:active,
body.dark-mode textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #1e1e1e inset !important;
    -webkit-text-fill-color: #e0e0e0 !important;
}

#buscador,
#buscador-misiones {
    width: 50%;
    padding: 12px;
    border: 1px solid var(--color-input-border);
    border-radius: 8px;
    font-size: 1em;
    background-color: var(--color-surface);
    color: var(--color-text-primary);
}

#buscador-misiones {
    margin-bottom: 15px;
}

.card {
    border: 1px solid var(--color-card-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px var(--color-shadow);
    transition: transform 0.2s;
    background-color: var(--color-card-bg);
    display: flex;
    flex-direction: column;
    padding: 0;
}

.card:hover {
    transform: translateY(-5px);
}

.card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}

.card-content {
    padding: 8px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.1em;
    color: #3b4cca;
}

.card-content p {
    margin: 4px 0;
    font-size: 0.9em;
    color: var(--color-text-muted);
}

.card-content .card-game {
    font-weight: bold;
    color: #ffde00;
    background-color: #3b4cca;
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
    margin-bottom: 10px;
}

.card-content small {
    margin-top: auto;
    color: var(--color-text-muted);
}

body.dark-mode header .nav-bar a,
body.dark-mode header .desktop-nav a {
    color: #FFFFFF;
    font-weight: 500;
}

.card-content .btn-borrar-venta {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    align-self: flex-end;
    font-weight: bold;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

/* Estilos para los mensajes de estado */
.mensaje-estado {
    text-align: center;
    padding: 10px;
    margin-top: 20px;
    border-radius: 5px;
    font-weight: bold;
}

.mensaje-info {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--color-primary-hover);
}

.mensaje-success {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
}

.mensaje-error {
    background-color: var(--color-error-bg);
    color: var(--color-error-text);
}

.btn-recargar {
    display: block;
    width: 150px;
    margin: 10px auto;
}
.navegacion-botones {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.boton-tienda {
    padding: 10px 15px;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.boton-tienda:hover {
    background-color: var(--color-primary-hover);
}

/* Estilos para el botón flotante de Quejas y Sugerencias */
.feedback-whatsapp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.feedback-whatsapp a {
    display: block;
    padding: 10px 15px;
    background-color: #25D366;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    font-weight: bold;
    transition: transform 0.2s;
}

.feedback-whatsapp a:hover {
    transform: scale(1.05);
}

/* === Media Queries para Responsividad (Móviles) === */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        position: sticky; /* ✅ NUEVO: sticky también en móvil */
        top: 0;
        z-index: 500;
    }

    header nav {
        gap: 10px;
    }

    footer {
        font-size: 0.9em;
        padding-left: 5%;
        padding-right: 5%;
    }

    #buscador,
    #buscador-misiones {
        width: 85%;
    }

    .hero-search {
        padding: 30px 15px;
    }

    .hero-search-title {
        font-size: 1.5em;
    }

    .hero-search-form {
        flex-direction: column;
        box-shadow: none;
    }

    .hero-search-form input,
    .hero-search-form button,
    .hero-search-form .btn-vender-hero {
        border-radius: 8px;
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 10px;
        border: 2px solid #3498db;
        text-align: center;
    }

    .ventas-tabla, .vendedores-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .menu-toggle {
        display: block;
        order: 3;
        margin-left: auto;
    }

    /* ===== menú móvil rediseñado: panel deslizante desde la derecha ===== */
    header nav#mobile-nav {
        display: flex !important;
        flex-direction: column;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
        height: 100vh;
        width: min(300px, 82vw) !important;
        max-width: 82vw;
        box-sizing: border-box;
        background-color: var(--color-surface);
        padding: 76px 0 24px;
        overflow-x: hidden;
        overflow-y: auto;
        z-index: 99998 !important;
        transform: translatex(100%);
        transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
        box-shadow: -10px 0 30px rgba(0,0,0,0.28), 0 0 0 100vmax rgba(0,0,0,0.5);
    }

    header nav#mobile-nav.active {
        transform: translatex(0) !important;
    }

    body:has(#mobile-nav.active) {
        overflow: hidden;
    }
    @keyframes mobilenavfadein {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    /* evita que el fondo haga scroll detrás del panel abierto */
    body:has(#mobile-nav.active) {
        overflow: hidden;
    }

    header nav#mobile-nav a {
        width: auto;
        text-align: left;
        text-decoration: none !important;
        padding: 14px 26px;
        margin: 0 12px;
        border-bottom: none;
        border-radius: 10px;
        font-size: 1.02rem;
        font-weight: 700;
        color: var(--color-text-primary);
        display: flex;
        align-items: center;
        gap: 12px;
        transition: background-color 0.15s;
    }

    header nav#mobile-nav a:hover,
    header nav#mobile-nav a:active {
        background-color: var(--color-header-link-hover-bg);
    }

    header nav#mobile-nav a {
        width: auto;
        max-width: 100%;
        box-sizing: border-box;
        text-align: left;
        text-decoration: none !important;
        padding: 14px 26px;
        margin: 0 12px;
        border-bottom: none;
        border-radius: 10px;
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--color-text-primary);
        display: flex;
        align-items: center;
        gap: 10px;
        white-space: normal;
        transition: background-color 0.15s;
    }
    header nav#mobile-nav a:nth-of-type(2)::before { content: '🃏'; }
    header nav#mobile-nav a:nth-of-type(3)::before { content: '💬'; }
    header nav#mobile-nav a:nth-of-type(4)::before { content: '🗡️'; }
    header nav#mobile-nav a:nth-of-type(5)::before { content: '👥'; }
    header nav#mobile-nav a:nth-of-type(6)::before { content: '🎒'; }
    header nav#mobile-nav a:nth-of-type(7)::before { content: '📖'; }
    header nav#mobile-nav a:nth-of-type(8)::before { content: '💰'; }

    /* separador antes de "mi wallet", para que se sienta como otro grupo */
    header nav#mobile-nav a:nth-of-type(8) {
        margin-top: 10px;
        border-top: 1px solid var(--color-border);
        padding-top: 18px;
    }

    .header-right .btn-vender,
    
    .auth-links-desktop {
        display: none;
    }    

    .filtros-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .filtros-container label {
        margin-left: 0 !important;
    }

    .tienda-layout {
        flex-direction: column;
    }
    .tienda-sidebar {
        position: static;
        width: 100%;
        max-height: none; /* ✅ NUEVO: quita el max-height en móvil */
        overflow-y: visible; /* ✅ NUEVO: quita el scroll en móvil */
    }

    .header-main-bar {
        flex-wrap: wrap;
        justify-content: space-between;
        box-sizing: border-box;
        width: 100%;
        padding: 15px;
    }
    .header-search-form {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
    .nav-bar { display: none; }
    
    body {
        overflow-x: hidden;
    }
    
    * {
        max-width: 100vw;
    }
}

/* Estilos para la página de perfil */
.perfil-container {
    background-color: var(--color-surface);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--color-shadow);
    max-width: 900px;
    margin: 20px auto;
}

#perfil-info {
    border-bottom: 2px solid var(--color-header-border);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.perfil-detalle {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: var(--color-text-secondary);
}

.perfil-detalle strong {
    color: var(--color-text-primary);
    min-width: 150px;
    display: inline-block;
}

.perfil-seccion h2 {
    color: var(--color-h1-h2);
    border-bottom: 1px solid var(--color-card-border);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

body.dark-mode .perfil-detalle {
    color: var(--color-text-secondary);
}
body.dark-mode .perfil-detalle strong {
    color: var(--color-text-primary);
}
body.dark-mode .perfil-seccion h2 {
    color: var(--color-h1-h2);
}

.card-producto a.producto-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-multi-imagen-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    height: auto;
    background-color: var(--color-header-link-hover-bg);
    overflow: hidden;
}

.card-multi-imagen-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-multi-imagen-container img:first-child:nth-last-child(1) {
    grid-column: 1 / span 2;
    grid-row: 1 / span 2;
}

/* Estilos para la página de detalle del producto */
.producto-detalle-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 20px auto;
    background: var(--color-surface);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--color-shadow);
}

.producto-imagen {
    flex: 1 1 300px;
    max-width: 350px;
}

.producto-imagen img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.producto-info {
    flex: 2 1 500px;
}

.producto-info h1 {
    text-align: left;
    margin-top: 0;
}

.producto-info h2 {
    text-align: left;
    color: var(--color-text-muted);
    font-weight: normal;
    margin-top: -10px;
    margin-bottom: 30px;
}

.ventas-tabla {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.95em;
    overflow-x: auto;
    display: block;
}

.ventas-tabla th, .ventas-tabla td {
    border: 1px solid var(--color-border);
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}

.ventas-tabla th {
    background-color: var(--color-card-bg);
    font-weight: 600;
    color: var(--color-text-secondary);
}

.ventas-tabla tr:hover {
    background-color: var(--color-header-link-hover-bg);
}

.vendedores-table {
    width: 100%;
}

body.dark-mode .ventas-tabla td {
    background-color: transparent;
}

/* === Estilos del Footer === */
footer {
    text-align: center;
    padding: 25px 15%;
    margin-top: 50px;
    background-color: var(--color-footer-bg);
    border-top: 1px solid var(--color-border);
    font-size: 0.95em;
    color: var(--color-footer-text);
    line-height: 1.7;
}

footer p {
    margin: 8px 0;
}

footer a {
    color: var(--color-primary);
    font-weight: bold;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}
.footer-reclamos {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #c0392b;
    color: white !important;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.2s;
}
.footer-reclamos:hover {
    background: #e74c3c !important;
    text-decoration: none !important;
}

/* --- ESTILOS PARA LA PÁGINA PRE-PUBLICAR --- */
.pre-publicar-container {
    max-width: 900px;
    margin: 40px auto;
    text-align: center;
    padding: 0 20px;
}

.subtitulo-pre-publicar {
    font-size: 1.2em;
    color: var(--color-text-muted);
    margin-bottom: 40px;
}

.opciones-venta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.opcion-venta {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 30px 20px;
    text-decoration: none;
    color: var(--color-text-primary);
    box-shadow: 0 4px 10px var(--color-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.opcion-venta:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.opcion-icono {
    font-size: 3em;
    margin-bottom: 15px;
}

.opcion-venta h2 {
    margin-top: 0;
    color: var(--color-primary);
}

.opcion-venta p {
    color: var(--color-text-secondary);
    font-size: 0.95em;
}

.opcion-venta.disabled {
    background-color: var(--color-card-bg);
    cursor: not-allowed;
    opacity: 0.6;
}

.opcion-venta.disabled:hover {
    transform: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.guia-venta-container {
    margin-top: 40px;
    padding: 20px;
}

.btn-transparente {
    background-color: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 8px;
    display: inline-block;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}

.btn-transparente:hover {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-transparente strong {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* Ocultar/mostrar iconos de tema */
.sun-icon, .dark-mode .moon-icon {
    display: none;
}

.moon-icon, .dark-mode .sun-icon {
    display: block;
}

/* --- ESTILOS PARA MISIONES (TABLÓN E INDEX) --- */
/* DESPUÉS */
.misiones-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    padding: 20px 0;
    margin: 0 auto;
    max-width: 1200px;
    width: 100%;
}

.mision {
    flex: 0 0 280px;
    max-width: 300px;
}

.mision {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--color-shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mision:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px var(--color-shadow);
}

.mision h2 {
    font-size: 1.2em;
    color: #c0392b;
    margin-top: 0;
    margin-bottom: 15px;
}

.mision p {
    margin: 5px 0;
    font-size: 0.95em;
}

.mision em {
    margin-top: auto;
    padding-top: 10px;
    font-size: 0.85em;
    color: var(--color-text-muted);
}

body.dark-mode .mision h2 {
    color: #e57373;
}

.mision-link {
    font-weight: bold;
    color: var(--color-primary);
    text-decoration: none;
}

body.dark-mode .mision-link {
    color: #63b3ed;
}

body.dark-mode .mision a {
    color: #63b3ed;
    text-decoration: underline;
}

/* --- ESTILOS PARA SECCIÓN DE COMENTARIOS --- */
.comments-section {
    border-top: 1px solid var(--color-border);
    margin-top: 15px;
    padding-top: 15px;
}

.comments-section h4 {
    margin: 0 0 10px 0;
    font-size: 1em;
    color: var(--color-text-secondary);
}

.comments-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 5px;
}

.comment {
    background-color: var(--color-background);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.comment-author {
    font-weight: bold;
    color: var(--color-primary);
    margin-right: 5px;
}

.comment-date {
    font-size: 0.8em;
    color: var(--color-text-muted);
    margin-left: 5px;
}

.comment-form {
    display: grid;
    gap: 8px;
}

.comment-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--color-input-border);
    border-radius: 5px;
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    resize: vertical;
    min-height: 40px;
    box-sizing: border-box;
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.comment-form button {
    padding: 6px 12px;
    font-size: 0.9em;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.comment-form button:hover {
    background-color: var(--color-primary-hover);
}

.btn-share {
    background-color: #7f8c8d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.btn-share:hover {
    background-color: #95a5a6;
}

/* --- PRELOADER CON ANIMACIÓN DE GATITO --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-surface);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.75s ease, visibility 0.75s ease;
    opacity: 1;
    visibility: visible;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#preloader p {
    margin-top: 20px;
    font-size: 1.2em;
    color: var(--color-text-secondary);
    font-weight: bold;
}

.sun-loader {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #f1c40f;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.7);
    animation: sun-pulse 1.5s ease-in-out infinite alternate, sun-spin 4s linear infinite;
}

body.dark-mode .sun-loader {
    background-color: #f39c12;
    box-shadow: 0 0 25px rgba(243, 156, 18, 0.8);
}

@keyframes sun-pulse {
    from { transform: scale(0.9); }
    to { transform: scale(1.1); }
}

@keyframes sun-spin {
    from { transform: rotate(0deg) scale(1); }
    to { transform: rotate(360deg) scale(1); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}
.preloader-logo {
    animation: pulse 2s infinite ease-in-out;
    max-width: 150px;
}

/* --- ESTILOS PARA LA SECCIÓN DE SELECCIÓN DE TCG (INDEX.HTML) --- */
.tcg-selection-section {
    text-align: center;
    padding: 50px 20px;
    background-color: var(--color-surface-variant, #f9f9f9);
    transition: background-color 0.3s;
}
.tcg-selection-section h2 {
    margin-bottom: 30px;
    font-size: 2em;
    color: var(--color-h1-h2);
}
body.dark-mode .tcg-selection-section {
    background-color: var(--color-surface, #2d3748);
}
.tcg-options {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}
.tcg-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease-in-out;
}
.tcg-option:hover {
    transform: scale(1.05);
}
.tcg-option img {
    width: 320px;
    height: 200px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

/* --- ESTILO PARA IMAGEN DE GENGAR EN MODO NOCHE (INDEX) --- */
.gengar-noche-img {
    display: none;
    position: fixed;
    left: 20px;
    bottom: 90px;
    width: 120px;
    height: auto;
    z-index: 998;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
}

body.show-gengar .gengar-noche-img {
    display: block;
    opacity: 0.6;
}
/* --- BOTÓN DE CARRITO MINIMALISTA --- */
        .cart-icon-button {
            background: none;
            border: none;
            position: relative;
            cursor: pointer;
            font-size: 1.4rem;
            padding: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .cart-badge {
            position: absolute;
            top: 2px;
            right: -2px;
            background-color: #a78bfa; /* Color fucsia/rojo de tu imagen */
            color: white;
            font-size: 0.75rem;
            font-weight: bold;
            border-radius: 999px;
            padding: 2px 6px;
            min-width: 14px;
            text-align: center;
            line-height: 1;
        }

        /* --- VENTANA EMERGENTE (SIDEBAR) --- */
        .cart-sidebar {
            position: fixed;
            top: 0;
            right: -400px; /* Oculto por defecto a la derecha */
            width: 100%;
            max-width: 400px;
            height: 100vh;
            background-color: #ffffff;
            box-shadow: -5px 0 25px rgba(0,0,0,0.15);
            z-index: 1000;
            transition: right 0.3s ease;
            display: flex;
            flex-direction: column;
        }

        /* Clase que activa la animación para mostrarlo */
        .cart-sidebar.open {
            right: 0;
        }

        .cart-sidebar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px;
            border-bottom: 1px solid #e2e8f0;
            color: #1e293b;
        }

        .cart-sidebar-header h2 {
            font-size: 1.2rem;
            font-weight: 700;
            margin: 0;
        }

        .cart-close-btn {
            background: none;
            border: none;
            font-size: 1.8rem;
            cursor: pointer;
            color: #64748b;
        }

        .cart-sidebar-content {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
        }

        /* Fondo oscuro translúcido */
        .cart-overlay {
            position: fixed;
            inset: 0;
            background-color: rgba(0, 0, 0, 0.4);
            z-index: 999;
            display: none;
        }

        .cart-overlay.open {
            display: block;
        }