/* =========================================
   VARIABLES DE COLOR (ICE CYBERPUNK - CIAN PURO)
   ========================================= */
:root {
    /* Fondos: Gris espacial profundo, ligeramente más azulado */
    --bg-dark: #070B11; 
    --bg-card: rgba(18, 28, 41, 0.7); /* Superficie tipo cristal tech */
    --bg-tertiary: #19273A;
    
    /* Acentos ICE (Cian y Teal) */
    --neon-cyan: #66FCF1;
    --neon-cyan-glow: rgba(102, 252, 241, 0.4);
    
    /* Tono secundario de contraste (Azul verdoso / Teal) en lugar del naranja */
    --neon-teal: #45A29E; 
    --neon-teal-glow: rgba(69, 162, 158, 0.3);
    
    /* Textos: Blanco grisáceo para lectura suave */
    --text-main: #E0E2E4;
    --text-muted: #8B95A5;
    --border-glass: rgba(102, 252, 241, 0.15); /* Borde sutilmente cian */
}

/* =========================================
   ESTILOS BASE
   ========================================= */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif; 
}

body { 
    background-color: var(--bg-dark); 
    background-image: 
        radial-gradient(circle at 50% -20%, rgba(102, 252, 241, 0.05), transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(69, 162, 158, 0.05), transparent 40%);
    background-attachment: fixed;
    color: var(--text-main); 
    line-height: 1.6; 
    overflow-x: hidden;
}

/* Barra de scroll personalizada */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #1f2833; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-cyan); }

/* =========================================
   NAVEGACIÓN
   ========================================= */
nav {
    background: rgba(11, 12, 16, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1.2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav .logo { 
    font-size: 1.8rem; 
    font-weight: 800; 
    letter-spacing: 1px;
    color: var(--text-main); 
    text-decoration: none; 
    display: flex;
    align-items: center;
    gap: 8px;
}

/* LA PALABRA LOOT BRILLA EN CIAN */
nav .logo span {
    color: var(--neon-cyan);
    text-shadow: 0 0 15px var(--neon-cyan-glow);
}

nav a { 
    color: var(--text-main);
    text-decoration: none; 
    font-weight: 500; 
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

nav a:visited {
    color: var(--text-main);
}

nav a:hover { 
    color: var(--neon-cyan); 
    text-shadow: 0 0 8px var(--neon-cyan-glow);
}

/* =========================================
   MENÚ DE USUARIO Y AVATAR
   ========================================= */
.user-menu-container {
    position: relative;
    display: inline-block;
}

.user-menu-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.95rem;
    transition: 0.3s;
}

.user-menu-btn:hover {
    background: rgba(102, 252, 241, 0.08);
    border-color: var(--neon-cyan);
}

/* FILTRO ICE PARA EL AVATAR PEQUEÑO */
.nav-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--neon-cyan);
    filter: grayscale(100%) sepia(100%) hue-rotate(180deg) saturate(300%) brightness(0.8);
    transition: filter 0.3s ease, border-color 0.3s ease;
}

.nav-avatar:hover {
    filter: grayscale(100%) sepia(100%) hue-rotate(180deg) saturate(500%) brightness(1.2);
    border-color: #FFF;
    box-shadow: 0 0 12px var(--neon-cyan-glow);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #1F2833;
    border: 1px solid var(--border-glass);
    min-width: 180px;
    border-radius: 12px;
    display: none;
    flex-direction: column;
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
    margin-top: 15px;
    overflow: hidden;
}

.dropdown-menu.active {
    display: flex;
}

.dropdown-item {
    color: var(--text-main);
    padding: 12px 15px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
    display: block;
}

.dropdown-item:hover {
    background: rgba(102, 252, 241, 0.1);
    color: var(--neon-cyan);
    text-shadow: none;
}

.login-btn-nav {
    color: var(--neon-cyan) !important;
    border: 1px solid var(--neon-cyan);
    padding: 8px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.login-btn-nav:visited {
    color: var(--neon-cyan) !important;
}

.login-btn-nav:hover {
    background: var(--neon-cyan);
    color: #0B0C10 !important;
    box-shadow: 0 0 15px var(--neon-cyan-glow);
}

/* FIX: EL BOTÓN VENDER INVISIBLE AHORA ES UN BOTÓN OUTLINE CIAN */
.btn-vender {
    background: transparent;
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.btn-vender:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--neon-cyan-glow);
    background-color: var(--neon-cyan);
    color: #0B0C10;
}

/* =========================================
   CONTENEDORES Y GRIDS
   ========================================= */
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px 60px 20px; 
}

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

/* =========================================
   TARJETAS DE PRODUCTO / PANELES (CON OVERRIDE DE NARANJA)
   ========================================= */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid transparent;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-glass);
    transition: 0.4s;
    border-radius: 12px 12px 0 0;
    opacity: 0.9;
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--neon-cyan);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px var(--neon-cyan-glow);
}

.card:hover img {
    transform: scale(1.05);
    opacity: 1;
}

/* FIX: FORZAR QUE CUALQUIER ÍCONO (COMO EL CANDADO) DENTRO DE LA TARJETA SEA CIAN */
.card i, .card svg {
    color: var(--neon-cyan) !important;
    fill: var(--neon-cyan) !important;
}

/* FIX: APLICAR EL FILTRO ICE A CUALQUIER AVATAR GRANDE (Para matar el naranja) */
.card div[style*="border-radius: 50%"], .profile-avatar-container {
    filter: grayscale(100%) sepia(100%) hue-rotate(180deg) saturate(300%) brightness(0.8);
    border: 2px solid var(--neon-cyan);
}

/* =========================================
   TABLAS (HISTORIAL DE COMPRAS / ADMIN)
   ========================================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th {
    color: var(--neon-cyan); /* Hace que "Artículo", "Estado", etc. sean azules */
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-align: left;
    padding: 15px 10px;
    border-bottom: 1px solid var(--border-glass);
}

td {
    padding: 15px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    color: var(--text-main);
    vertical-align: middle;
}

tbody tr:hover td {
    background: rgba(102, 252, 241, 0.03); /* Brillo sutil al pasar el mouse por la fila */
}

/* =========================================
   BOTONES
   ========================================= */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-primary { 
    background: var(--neon-cyan); 
    color: #0B0C10; 
    box-shadow: 0 4px 0px #3E9A93; 
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: none;
}

.btn-primary:hover {
    box-shadow: 0 0 20px var(--neon-cyan-glow), 0 4px 0px #3E9A93;
}

/* =========================================
   FORMULARIOS (CON VISIBILIDAD MEJORADA)
   ========================================= */
label {
    display: block;
    margin-top: 15px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

input, textarea, select {
    width: 100%;
    padding: 15px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #1F2833;
    border-radius: 12px;
    color: #ffffff;
    outline: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

input:focus, textarea:focus, select:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 4px var(--neon-cyan-glow);
    background: rgba(255, 255, 255, 0.06);
}

/* =========================================
   SEPARADOR "O"
   ========================================= */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0 15px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-glass);
}

.auth-divider::before { margin-right: 15px; }
.auth-divider::after { margin-left: 15px; }

/* =========================================
   BOTÓN DE GOOGLE
   ========================================= */
.google-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #ffffff !important;
    color: #1f1f1f !important;
    border: 1px solid #dadce0 !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    text-decoration: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    font-weight: bold !important;
    transition: background 0.3s;
}

.google-btn:hover {
    background-color: #f1f1f1 !important;
}

.google-btn img {
    width: 20px !important;    
    height: 20px !important;   
    min-width: 20px !important;
    max-width: 20px !important;
    object-fit: contain !important;
    margin-right: 10px !important;
    border: none !important;    
    display: block !important;
    padding: 0 !important;
    transform: none !important; 
    box-shadow: none !important;
}

/* =========================================
   UTILIDADES
   ========================================= */
.loading {
    text-align: center;
    padding: 50px;
    color: var(--neon-cyan);
    font-weight: bold;
    letter-spacing: 2px;
}

/* =========================================
   ESTILOS PARA EL INICIO (HERO SECTION)
   ========================================= */
.hero-section {
    background: radial-gradient(circle at top, var(--bg-card) 0%, var(--bg-dark) 80%);
    padding: 100px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-glass);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-content h1 { 
    font-size: 3.5rem; 
    font-weight: 800;
    margin-bottom: 15px; 
    letter-spacing: -1.5px;
    color: var(--text-main);
}

.hero-content p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 40px; }
#search-container { max-width: 700px; margin: 0 auto; }

.search-box {
    position: relative; background: var(--bg-tertiary); border: 1px solid var(--border-glass); border-radius: 40px;
    padding: 5px 25px; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3); transition: 0.4s; display: flex; align-items: center;
}
.search-box:focus-within { border-color: var(--neon-cyan); box-shadow: 0 0 25px var(--neon-cyan-glow); }
.search-icon { color: var(--text-muted); font-size: 1.4rem; margin-right: 15px; }
#home-search-input { flex: 1; background: transparent; border: none; outline: none; color: white; font-size: 1.1rem; padding: 15px 0; margin: 0; font-weight: 500; }

.direct-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 25px; }
.direct-link-card { background: var(--bg-card); border-radius: 20px; border: 1px solid transparent; overflow: hidden; cursor: pointer; transition: 0.4s; text-align: center; position: relative; }
.direct-link-card:hover { border-color: var(--neon-cyan); transform: translateY(-8px); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 15px var(--neon-cyan-glow); }
.direct-link-card img { width: 100%; height: 240px; object-fit: cover; opacity: 0.7; transition: 0.5s; }
.direct-link-card:hover img { opacity: 1; transform: scale(1.05); }
.direct-link-card h3 { position: absolute; bottom: 0; width: 100%; background: linear-gradient(transparent, rgba(11,12,16,0.9)); color: white; font-size: 1.1rem; font-weight: 700; padding: 20px; margin: 0; }

/* =========================================
   ESTILOS PARA EL DESPLEGABLE DE BÚSQUEDA
   ========================================= */
.dropdown-toggle-btn { background: none; border: none; color: #888; font-size: 1.2rem; cursor: pointer; padding: 0 10px; transition: transform 0.3s, color 0.3s; }
.dropdown-toggle-btn:hover { color: var(--neon-cyan); }
.dropdown-toggle-btn.open { transform: rotate(180deg); color: var(--neon-cyan); }

.search-dropdown {
    position: absolute; top: 110%; left: 0; width: 100%; background: #1F2833; border: 1px solid var(--border-glass);
    border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,0.8); max-height: 250px; overflow-y: auto; display: none; z-index: 100; text-align: left;
}
.search-dropdown.active { display: block; animation: fadeIn 0.2s ease-out; }
.dropdown-cat-item { padding: 12px 20px; color: white; cursor: pointer; border-bottom: 1px solid var(--border-glass); transition: 0.2s; display: flex; align-items: center; gap: 15px; }
.dropdown-cat-item:last-child { border-bottom: none; }
.dropdown-cat-item:hover { background: rgba(102, 252, 241, 0.1); color: var(--neon-cyan); }
.dropdown-cat-img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border-glass); }

/* =========================================
   NOTIFICACIÓN MÁGICA GLOBAL
   ========================================= */
.magic-toast {
    position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%); 
    background: #1F2833; 
    border: 1px solid var(--neon-cyan) !important; 
    border-left: 5px solid var(--neon-cyan) !important; 
    border-radius: 16px;
    padding: 15px 25px; display: flex; align-items: center; gap: 15px; 
    box-shadow: 0 15px 35px var(--neon-cyan-glow); backdrop-filter: blur(20px);
    transition: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); z-index: 9999; 
    color: white; min-width: 320px;
}
.magic-toast.show { bottom: 30px; }
.magic-toast:hover { background: #2C353F; transform: translateX(-50%) scale(1.02); }

/* =========================================
   ESTILOS NAVEGACIÓN SECUNDARIA Y CAMPANA
   ========================================= */
.nav-messages-link { 
    color: var(--text-main) !important; 
    text-decoration: none; 
    font-size: 0.95rem; 
    font-weight: 500; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    transition: all 0.3s ease; 
    padding: 8px 12px; 
    border-radius: 8px; 
}
.nav-messages-link .icon { 
    color: var(--neon-cyan); 
    transition: 0.3s; 
}
.nav-messages-link:hover { 
    color: var(--neon-cyan) !important; 
    text-shadow: 0 0 8px var(--neon-cyan-glow); 
    background: rgba(102, 252, 241, 0.05); 
}

.notification-link { 
    color: var(--text-main) !important; 
    text-decoration: none; 
    width: 44px; 
    min-width: 44px;
    height: 44px; 
    min-height: 44px;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 50%; 
    transition: all 0.3s ease; 
    position: relative;
    flex-shrink: 0; 
}

.notification-link svg { 
    width: 22px !important; 
    height: 24px !important;
    min-width: 22px;
    display: block; 
    fill: white; 
    transition: 0.3s; 
}

.notification-link:hover { 
    background: rgba(102, 252, 241, 0.1); 
}
.notification-link:hover svg { 
    fill: var(--neon-cyan); 
    filter: drop-shadow(0 0 8px var(--neon-cyan-glow)); 
}

.notification-badge { 
    position: absolute; 
    top: 4px; 
    right: 4px; 
    background: #ef4444; 
    color: white; 
    border-radius: 50%; 
    min-width: 14px; 
    height: 14px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 9px; 
    font-weight: bold; 
    border: 2px solid var(--bg-dark); 
    pointer-events: none;
    padding: 0 3px;
    box-sizing: content-box; 
}

/* =========================================
   DROPDOWN DE NOTIFICACIONES
   ========================================= */
.notif-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: #1F2833;
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    margin-top: 15px;
}
.notif-dropdown.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}
.notif-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-glass);
    font-weight: bold;
    color: white;
    background: #1F2833;
    position: sticky;
    top: 0;
    z-index: 10;
}
.notif-item {
    display: block;
    padding: 15px;
    border-bottom: 1px solid var(--border-glass);
    text-decoration: none;
    transition: 0.2s;
}
.notif-item:last-child {
    border-bottom: none;
}
.notif-item.read {
    color: var(--text-muted);
    background: transparent;
}
.notif-item.unread {
    color: white;
    background: rgba(102, 252, 241, 0.05);
    border-left: 4px solid var(--neon-cyan);
}
.notif-item:hover {
    background: rgba(255, 255, 255, 0.05);
}
.notif-msg {
    font-size: 0.9rem;
    line-height: 1.4;
    color: inherit;
}
.notif-time {
    font-size: 0.75rem;
    color: var(--neon-cyan);
    margin-top: 8px;
}

/* =========================================
   EDITOR QUILL
   ========================================= */
.ql-toolbar.ql-snow {
    background: #1F2833 !important; 
    border: 1px solid var(--border-glass) !important; 
    border-radius: 12px 12px 0 0;
    margin-top: 8px;
}
.ql-container.ql-snow {
    border: 1px solid var(--border-glass) !important;
    border-top: none !important;
    border-radius: 0 0 12px 12px;
    background: rgba(255, 255, 255, 0.02) !important; 
}
.ql-snow .ql-stroke { stroke: #e2e8f0 !important; } 
.ql-snow .ql-fill { fill: #e2e8f0 !important; }

.ql-snow.ql-toolbar button:hover .ql-stroke, 
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button:focus .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--neon-cyan) !important; }

.ql-snow.ql-toolbar button:hover .ql-fill, 
.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button:focus .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--neon-cyan) !important; }

.ql-editor { font-family: 'Inter', sans-serif; font-size: 1rem; color: #ffffff !important; min-height: 200px; }
.ql-editor.ql-blank::before { color: var(--text-muted) !important; font-style: normal; }
.ql-snow .ql-picker { color: #e2e8f0; }
.ql-snow .ql-picker-options { background-color: #1F2833; border-color: var(--border-glass); }

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

/* =========================================
   FOOTER Y LEGALES
   ========================================= */
footer {
    background: #07080A;
    border-top: 1px solid var(--border-glass);
    padding: 40px 20px;
    margin-top: 60px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s;
}

.footer-links a:hover {
    color: var(--neon-cyan);
}

.footer-copy {
    color: #444;
    font-size: 0.85rem;
}

.legal-container {
    max-width: 800px;
    margin: 60px auto;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border-glass);
}

.legal-container h1 { color: white; margin-bottom: 20px; font-size: 2rem; }
.legal-container h2 { color: var(--neon-cyan); margin-top: 30px; margin-bottom: 15px; font-size: 1.3rem; }
.legal-container p { color: var(--text-muted); margin-bottom: 15px; line-height: 1.8; }

.nav-btn-light-outline {
    color: var(--text-main);
    background: transparent; 
    border: 1px solid var(--text-main);
    padding: 8px 20px;
    border-radius: 8px; 
    text-decoration: none; 
    font-weight: 500;
    transition: all 0.3s ease; 
    display: inline-block;
    cursor: pointer;
}

.nav-btn-light-outline:hover {
    background: rgba(102, 252, 241, 0.1); 
    border-color: var(--neon-cyan);
    color: var(--neon-cyan); 
}
/* Ocultar iconos privados por defecto para evitar el parpadeo (FOUC) al recargar la página */
#nav-messages-btn, 
#nav-notifications-btn {
    display: none;
}
/* 🚀 CORREGIDO: Forzar fondo oscuro en las opciones de selección */
select option {
    background-color: #0d0d11 !important;
    color: white !important;
}