/* ==========================================================================
   MAIN.CSS - ESTILOS GLOBALES Y COMPONENTES BISNEBISNE
   ========================================================================== */

/* --- 1. VARIABLES Y TEMA --- */
:root {
    --primary: #FF6B6B;       /* Coral Vibrante */
    --primary-light: #FFECEC; /* Coral Muy Claro */
    --primary-dark: #EE5253;  /* Coral Intenso */
    --secondary: #636E72;     /* Gris Frío */
    --accent: #5F27CD;        /* Púrpura Acento (Subastas) */
    
    --bg: #F7F9FC;            /* Fondo Gris Muy Suave */
    --surface: #FFFFFF;       /* Blanco Puro para Tarjetas */
    --text: #2D3436;          /* Texto Oscuro */
    --text-light: #636E72;    /* Texto Secundario */
    
    --success: #10ac84;       /* Verde Esmeralda */
    --border: #E4E9F2;        /* Borde Suave */
    
    --radius-lg: 20px;        /* Bordes más redondeados */
    --radius-md: 14px;
    
    --shadow: 0 12px 32px -8px rgba(45, 52, 54, 0.1);
    --shadow-sm: 0 4px 12px -4px rgba(45, 52, 54, 0.08);
    --glass: rgba(255, 255, 255, 0.9);
    --btn-glow: none;
    
    --gold: #FECA57;
    --vip-gold: #FF9F43;
    --auction: #5F27CD;
    --whatsapp: #10ac84;
    --danger: #EE5253;
}

[data-theme="dark"] {
    --bg: #161A23;            /* Azul Noche Muy Oscuro */
    --surface: #222B38;       /* Azul Noche Tarjetas */
    
    --text: #F7F9FC;          /* Blanco Roto */
    --text-light: #AAB3C6;    /* Gris Azulado */
    
    --primary: #FF8787;       /* Coral Suave */
    --primary-light: rgba(255, 107, 107, 0.15);
    --primary-dark: #FF6B6B;
    
    --secondary: #AAB3C6;
    --accent: #9B59B6;        /* Púrpura Claro */
    
    --border: #2D3748;        /* Bordes Oscuros */
    
    --glass: rgba(22, 26, 35, 0.85);
    --shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
    --btn-glow: 0 4px 20px rgba(255, 107, 107, 0.3);
}

/* --- 2. BASE & LAYOUT --- */
body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    display: block;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
    padding-bottom: 80px; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
}

.container { width: 100%; max-width: 100%; padding: 0 15px; box-sizing: border-box; position: relative; min-height: 100vh; }
@media (min-width: 1200px) { .container { max-width: 1400px; margin: 0 auto; padding: 0 30px; } }
main { min-height: 80vh; }

/* --- 3. SPLASH SCREEN (Carga Inicial) --- */
#auth-splash {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #F7F9FC;
    z-index: 99999; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.5s ease;
}
@media (prefers-color-scheme: dark) { #auth-splash { background-color: #161A23; } }
.splash-logo {
    font-size: 48px; font-weight: 900; color: #FF6B6B;
    letter-spacing: -2px; animation: splashPulse 1.5s infinite;
}
@keyframes splashPulse {
    0% { transform: scale(1); opacity: 1; filter: brightness(1); }
    50% { transform: scale(1.05); opacity: 0.8; filter: brightness(1.2); }
    100% { transform: scale(1); opacity: 1; filter: brightness(1); }
}

/* --- 4. HEADER Y NAVEGACIÓN --- */
.app-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow); margin-bottom: 20px; position: relative; z-index: 1200;
    border-bottom: 1px solid var(--border);
    transition: transform 0.3s ease, padding 0.3s ease;
}
.app-header::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg); z-index: -1;
}
@media (max-width: 640px) {
    .app-header { padding: 8px 12px; }
    .logo { font-size: 20px; }
    .theme-toggle { width: 32px; height: 32px; font-size: 16px; }
}

.header-left { display: flex; align-items: center; gap: 15px; }
.logo { font-size: 24px; font-weight: 800; color: var(--primary); letter-spacing: -1px; cursor: pointer; }
.theme-toggle { background: var(--primary-light); border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 18px; transition: transform 0.2s; }
.theme-toggle:hover { transform: scale(1.1); }

#auth-zone { display: flex; align-items: center; gap: 15px; }
.notification-bell {
    position: relative; cursor: pointer; color: var(--text-light);
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; transition: all 0.2s;
}
.notification-bell:hover { background: var(--bg); color: var(--primary); }

.user-pill { 
    display: flex; align-items: center; gap: 10px; 
    background: var(--surface); padding: 4px 6px 4px 15px; 
    border-radius: 30px; cursor: pointer; transition: all 0.2s; 
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.user-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--primary-light); }

.user-menu-container { position: relative; display: inline-block; }
.user-dropdown {
    display: none; position: absolute; top: 120%; right: 0; background: var(--surface);
    border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
    min-width: 200px; z-index: 2000; overflow: hidden; animation: fadeIn 0.2s ease; padding: 6px;
}
.user-dropdown.show { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 12px 15px; color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; border-radius: 10px; transition: all 0.2s; }
.dropdown-item:hover { background: var(--bg); color: var(--primary); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: #fee2e2; }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* --- INFO DE USUARIO Y NOTIFICACIONES --- */
.user-info { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }
.user-name { font-size: 14px; font-weight: 800; color: var(--text); }
.user-tokens { font-size: 12px; color: var(--primary); font-weight: 900; display: flex; align-items: center; gap: 4px; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--surface); box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.user-chevron { width: 18px; height: 18px; color: var(--text-light); }
.header-btn { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s; color: var(--text); position: relative; background: var(--bg); }
.header-btn:hover { background-color: var(--surface); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

#notif-badge { position: absolute; top: 4px; right: 4px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; padding: 0 6px; border-radius: 12px; min-width: 18px; height: 18px; display: none; align-items: center; justify-content: center; border: 2px solid var(--surface); box-shadow: 0 2px 5px rgba(238,82,83,.4); }

@media (max-width: 640px) {
    #auth-zone { gap: 8px; }
    .user-name { display: none; }
    .user-chevron { display: none; }
    .user-pill { padding: 0; border: none; background: transparent; box-shadow: none; }
    .user-pill:hover { background: transparent; border: none; transform: none; box-shadow: none; }
    .user-avatar { width: 36px; height: 36px; }
    .header-btn { width: 38px; height: 38px; }
    .user-tokens { font-size: 11px; }
}

/* Menú de Notificaciones */
.notification-container { position: relative; }
.notification-dropdown { width: 400px; right: -120px; padding: 0; max-height: 550px; overflow-y: auto; border-radius: 20px; box-shadow: 0 15px 50px -10px rgba(0,0,0,.2); scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.notification-dropdown::-webkit-scrollbar { width: 6px; }
.notification-dropdown::-webkit-scrollbar-thumb { background-color: var(--border); border-radius: 3px; }
.notification-dropdown::-webkit-scrollbar-track { background: transparent; }
@media (min-width: 769px) and (max-width: 1200px) { .notification-dropdown { right: 0; } }
.notif-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); z-index: 10; }
.notif-item { padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; gap: 16px; align-items: start; cursor: pointer; transition: background-color .2s; background: var(--surface); position: relative; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background-color: var(--bg); }
.notif-item.unread { background-color: var(--primary-light); }
.notif-item.unread:hover { background-color: #ffecec; }
[data-theme="dark"] .notif-item.unread:hover { background-color: #3d1c1c; }
.notif-icon { padding: 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.1); }
.notif-text { font-size: 14px; color: var(--text); line-height: 1.5; margin-bottom: 6px; word-break: break-word; }
.notif-item.unread .notif-text { font-weight: 700; }
.notif-date { font-size: 12px; color: var(--text-light); font-weight: 600; }
.notif-img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.notif-dot { width: 10px; height: 10px; background: var(--primary); border-radius: 50%; margin-top: 8px; flex-shrink: 0; box-shadow: 0 0 8px var(--primary); }
.mobile-back-btn { display: none; }
@media (max-width: 640px) {
    .notification-dropdown { position: fixed; top: 0; right: 0; width: 100%; height: 100%; max-height: none; z-index: 5000; background: var(--bg); border: none; border-radius: 0; display: block !important; transform: translateX(100%); transition: transform .4s cubic-bezier(.25,.8,.25,1); }
    .notification-dropdown.show { transform: translateX(0); }
    .mobile-back-btn { display: block; background: transparent; border: none; padding: 8px; cursor: pointer; color: var(--text); }
    .notif-header { padding: 16px; box-shadow: 0 4px 15px rgba(0,0,0,.05); }
}

.nav-tabs { display: flex; gap: 5px; }
.nav-btn { border: none; background: transparent; padding: 8px 12px; font-weight: 600; color: var(--secondary); cursor: pointer; border-radius: 12px; transition: all 0.2s; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.nav-btn.active { background: var(--primary-light); color: var(--primary); }

@media (max-width: 1024px) {
    .nav-tabs { 
        background: var(--surface); padding: 6px; border-radius: 24px; box-shadow: var(--shadow); margin: 0; border: 1px solid var(--border);
        position: fixed; bottom: 20px; left: 20px; right: 20px; margin: 0; z-index: 2000; border-radius: 24px; 
        background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%);
        max-width: none; width: auto; overflow-x: auto; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    }
    [data-theme="light"] .nav-tabs { background: rgba(255, 255, 255, 0.65); border: 1px solid rgba(255, 255, 255, 0.4); box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1); }
    .nav-btn { flex: 1; flex-direction: column; padding: 10px 15px; border-radius: 18px; min-width: 60px; gap: 4px; }
    .nav-btn.active { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }
}

/* --- 5. BÚSQUEDA Y FILTROS --- */
.search-wrapper { position: relative; background: var(--bg); padding: 0; margin-top: -10px; margin-bottom: 15px; z-index: 1000; }
.search-container { display: block; margin-bottom: 10px; position: sticky; top: 0; z-index: 1100; background: var(--bg); padding: 10px 0; }
.filters-container { display: flex; gap: 10px; margin-bottom: 0; flex-wrap: wrap; padding-bottom: 5px; }

@media (min-width: 768px) {
    .search-wrapper { display: flex; gap: 15px; align-items: center; position: sticky; top: 0; z-index: 1100; padding: 10px 0; }
    .search-container { flex: 1; margin-bottom: 0; position: static; padding: 0; }
    .filters-container { flex-shrink: 0; padding-bottom: 0; }
}

.search-input, .filter-select { padding: 14px 20px; border-radius: 16px; border: 1px solid var(--border); outline: none; box-shadow: var(--shadow-sm); background: var(--surface); color: var(--text); transition: all 0.3s ease; box-sizing: border-box; font-size: 14px; }
.search-input { width: 100%; min-width: 200px; }
.filter-select { cursor: pointer; }
.search-input:focus, .filter-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); transform: translateY(-1px); }

.category-bar { display: flex; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 8px; padding: 10px 10px 20px 10px; margin-bottom: 5px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.category-bar::-webkit-scrollbar { display: none; }
.cat-chip { flex-shrink: 0; white-space: nowrap; padding: 10px 18px; background: var(--surface); border-radius: 24px; font-size: 13px; font-weight: 600; color: var(--text-light); cursor: pointer; box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); display: flex; align-items: center; gap: 6px; user-select: none; }
.cat-chip:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); color: var(--primary); }
.cat-chip.active { background-color: var(--primary) !important; color: var(--btn-text, white) !important; border-color: var(--primary); box-shadow: var(--btn-glow); transform: scale(1.05); }
.cat-chip.active:hover { transform: scale(1.05) translateY(-2px); box-shadow: 0 12px 25px -8px rgba(99, 102, 241, 0.7); }
.cat-chip i { width: 16px; height: 16px; transition: color 0.2s; }

@media (max-width: 640px) and (orientation: portrait) {
    .category-bar { padding: 2px 5px 5px 5px; gap: 4px; }
    .cat-chip { padding: 2px 6px !important; font-size: 9px !important; border-radius: 8px; }
    .cat-chip i { width: 10px !important; height: 10px !important; }
    .search-input { min-width: 100%; }
    .filter-select { flex: 1; min-width: 0; }
}

/* Restauración de Layout */
.wall-layout-wrapper { display: flex; gap: 20px; align-items: start; }
.category-sidebar { width: 240px; flex-shrink: 0; position: sticky; position: -webkit-sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 5px; scrollbar-width: none; }
.category-sidebar::-webkit-scrollbar { display: none; }
.category-sidebar .category-bar { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 768px) {
    .wall-layout-wrapper { display: block; }
    .category-sidebar { width: 100%; position: static; height: auto; margin-bottom: 15px; overflow-x: auto; white-space: nowrap; padding-bottom: 5px; }
    .category-sidebar .category-bar { flex-direction: row; flex-wrap: nowrap; display: inline-flex; }
    .footer-legal { padding-bottom: 100px; }
}

/* --- 6. TARJETAS Y FEED (Unminified & Clean) --- */
.feed-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; flex-grow: 1; width: 100%; }
@media (min-width: 640px) { .feed-container { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 25px; } }

.post-card { background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; cursor: pointer; position: relative; border: 1px solid var(--border); transition: all .4s cubic-bezier(.25,.8,.25,1); aspect-ratio: 1/1; box-sizing: border-box; z-index: 0; }
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.post-card-img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; z-index: 0; transition: transform .6s cubic-bezier(.25,.8,.25,1); }
.post-card:hover .post-card-img { transform: scale(1.08); }
.post-card::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 60%; background: linear-gradient(to top, rgba(0,0,0,.85) 0, rgba(0,0,0,.4) 50%, transparent 100%); z-index: 1; pointer-events: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.post-content { position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; z-index: 2; background: 0 0; border: none; backdrop-filter: none; justify-content: flex-end; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
[data-theme="dark"] .post-content { background: 0 0; border: none; }
.post-card h4 { margin: 0; font-size: 14px; line-height: 1.4; font-weight: 800; color: #fff !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; order: 1; text-shadow: 0 2px 4px rgba(0,0,0,.9); }
.post-price { font-size: 18px; font-weight: 900; color: #10ac84 !important; text-shadow: 0 2px 4px rgba(0,0,0,.9); margin: 0; order: 2; }
.post-category { font-size: 10px; font-weight: 800; color: rgba(255,255,255,.9) !important; text-transform: uppercase; letter-spacing: 1px; order: 0; margin-bottom: 4px; display: none; }
.post-card p { display: none; }

.post-footer { padding: 0; margin-top: 10px; background: 0 0; backdrop-filter: none; display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.9) !important; position: relative; z-index: 2; border: none; box-sizing: border-box; order: 2; width: 100%; }
[data-theme="dark"] .post-footer { background: 0 0; }
.author-info { display: none; }

@media (min-width: 640px) {
    .post-card { aspect-ratio: 4/5; }
    .post-content { padding: 25px; }
    .post-card h4 { font-size: 16px; }
    .post-price { font-size: 24px; }
    .post-footer { order: 10; }
    .author-info { display: block; }
}

.badge-container { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 1500; }
.badge { font-size: 10px; font-weight: 800; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); letter-spacing: .5px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.badge-icon { padding: 0; width: 32px; height: 32px; border-radius: 50%; }
.badge-gold { background: var(--vip-gold); color: #000; }
.badge-auction { background: var(--auction); }
.badge-sold { background: var(--danger); }

.card-actions { position: absolute; top: 10px; left: 10px; z-index: 2000; display: flex; gap: 6px; }
.action-btn-card { background: var(--surface); border: 1px solid var(--border); border-radius: 50%; width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.1); transition: all .3s cubic-bezier(.25,.8,.25,1); font-size: 15px; color: var(--text); }
.btn-delete:hover { background: #fee2e2; color: #ef4444; transform: scale(1.1); border-color: #fca5a5; }

.post-card.is-featured { border: 1px solid transparent !important; }
.post-card.is-featured::before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border: 3px solid var(--vip-gold); box-sizing: border-box; box-shadow: 0 0 20px rgba(255,159,67,.4); border-radius: var(--radius-lg); z-index: 10; pointer-events: none; }
.post-card.is-auction { border: 1px solid transparent !important; }
.post-card.is-auction::before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; box-shadow: inset 0 0 0 3px var(--auction); border-radius: var(--radius-lg); z-index: 10; pointer-events: none; }
.post-card.is-sold { opacity: .7; filter: grayscale(1); }

.auction-data { background: rgba(95,39,205,.8); padding: 6px 10px; border-radius: 8px; margin-top: 6px; font-size: 11px; color: #fff; font-weight: 700; width: 100%; box-sizing: border-box; border: 1px solid rgba(255,255,255,.2); }

.location-tag { margin-left: auto; display: flex; align-items: center; gap: 4px; color: rgba(255,255,255,.8); font-size: 10px; font-weight: 600; margin-top: 4px; line-height: 1; }
.location-tag svg { width: 10px; height: 10px; }
@media (min-width: 640px) { .location-tag { font-size: 12px; margin-top: 6px; } .location-tag svg { width: 14px; height: 14px; } }

.skeleton-card { min-height: 320px; background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); aspect-ratio: 4/5; }
.skeleton-img { width: 100%; height: 100%; background: var(--bg); position: absolute; top: 0; left: 0; }
.skeleton-content { padding: 15px; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; margin-top: auto; background: linear-gradient(to top, rgba(0,0,0,.15) 0, transparent 100%); }
.skeleton-line { height: 12px; background: var(--bg); border-radius: 6px; position: relative; overflow: hidden; }
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 90%; }
.skeleton-pulse::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(90deg, transparent 0, var(--border) 50%, transparent 100%); opacity: .6; transform: translateX(-100%); animation: shimmer 1.5s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* --- 7. GALERÍA Y LIGHTBOX --- */
.gallery-wrapper { position: relative; border-radius: 16px; overflow: hidden; background: #000; margin-bottom: 15px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); border: 1px solid var(--border); }
.gallery-main-container { position: relative; width: 100%; height: 0; padding-bottom: 100%; background: #1a1a1a; overflow: hidden; cursor: zoom-in; }
@media (min-width: 768px) { .gallery-main-container { padding-bottom: 80%; } }
.gallery-main-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; z-index: 2; transition: opacity 0.2s ease; }
.gallery-bg-blur { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; filter: blur(20px) brightness(0.6); z-index: 1; transform: scale(1.1); }
.gallery-counter { position: absolute; bottom: 15px; right: 15px; background: rgba(0, 0, 0, 0.6); color: white; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: bold; z-index: 3; backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.2); }
.gallery-thumbs-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 5px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-bottom: 20px; }
.gallery-thumbs-scroll::-webkit-scrollbar { display: none; }
.gallery-thumb-item { width: 70px; height: 70px; flex-shrink: 0; border-radius: 12px; overflow: hidden; border: 2px solid transparent; cursor: pointer; transition: all 0.2s; position: relative; background: var(--surface); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.gallery-thumb-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb-item.active { border-color: var(--primary); transform: scale(0.95); box-shadow: 0 0 0 2px var(--primary-light); }

#lightbox { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15,23,42,.95); z-index: 3000; justify-content: center; align-items: center; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); cursor: zoom-out; }
#lightbox.active { display: flex; }
#lightbox img { max-width: 98%; max-height: 95%; border-radius: 8px; box-shadow: 0 0 40px rgba(0,0,0,.6); object-fit: contain; }
.close-lightbox { position: absolute; top: 20px; right: 20px; color: #fff; font-size: 40px; cursor: pointer; font-weight: 300; z-index: 3010; transition: transform .2s; }
.close-lightbox:hover { transform: scale(1.1); }
.lb-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, 0.6); border: 2px solid rgba(255,255,255,0.1); color: white; width: 56px; height: 56px; border-radius: 50%; display: none; align-items: center; justify-content: center; cursor: pointer; z-index: 5010; transition: all 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.lb-nav-btn:hover { background: rgba(0, 0, 0, 0.8); transform: translateY(-50%) scale(1.05); }
.lb-nav-btn svg { width: 32px; height: 32px; stroke-width: 3; }
#lb-prev { left: 20px; }
#lb-next { right: 20px; }
@media (max-width: 768px) {
    .lb-nav-btn { width: 40px; height: 40px; }
    .lb-nav-btn svg { width: 24px; height: 24px; }
    #lb-prev { left: 10px; } #lb-next { right: 10px; }
}

/* --- 8. MODALES & COMPONENTES --- */
#confirm-modal, #shop-modal, #snake-modal, #simon-modal, #store-modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 4000; justify-content: center; align-items: center;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
#confirm-modal { background: rgba(15,23,42,.7); }
#shop-modal, #store-modal { background: rgba(0,0,0,0.8); z-index: 3000; }
#snake-modal, #simon-modal { background: rgba(0,0,0,0.9); z-index: 5000; }

#confirm-modal.active, #shop-modal.active, #snake-modal.active, #simon-modal.active, #store-modal.active { display: flex; }

.modal-card { background: var(--surface); padding: 30px; border-radius: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.3); max-width: 90%; width: 350px; text-align: center; border: 1px solid var(--border); animation: popIn .3s cubic-bezier(.25,.8,.25,1); }
@keyframes popIn { from { transform: scale(.95) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-actions { display: flex; gap: 12px; margin-top: 25px; justify-content: center; }

#global-toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 2000; width: auto; min-width: 250px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); font-weight:600; padding: 12px 20px; }
#global-toast.show { animation: toastIn .4s cubic-bezier(.25,.8,.25,1); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%,20px); } to { opacity: 1; transform: translate(-50%,0); } }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; margin-bottom: 8px; color: var(--secondary); letter-spacing: .5px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; box-sizing: border-box; font-family: inherit; background: var(--surface); color: var(--text); transition: all .3s ease; font-size: 14px; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px var(--primary-light); transform: translateY(-1px); }
input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px var(--surface) inset; -webkit-text-fill-color: var(--text); transition: background-color 5000s ease-in-out 0s; }

.btn-main { background: var(--primary); color: #fff; border: none; width: 100%; padding: 16px; border-radius: 14px; font-weight: 800; font-size: 15px; cursor: pointer; margin-top: 15px; box-shadow: 0 4px 15px rgba(255,107,107,.3); transition: all .3s cubic-bezier(.25,.8,.25,1); text-transform: uppercase; letter-spacing: .5px; }
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255,107,107,.4); }
.btn-main:disabled { background: var(--secondary); box-shadow: none; cursor: not-allowed; transform: none; }
.btn-cancel { background: var(--bg); color: var(--text); border: 2px solid var(--border); padding: 12px 24px; border-radius: 12px; cursor: pointer; font-weight: 700; transition: all .2s; }
.btn-cancel:hover { background: var(--surface); border-color: var(--text-light); }
.btn-confirm { background: var(--danger); color: #fff; border: none; padding: 12px 24px; border-radius: 12px; cursor: pointer; font-weight: 700; box-shadow: 0 4px 12px rgba(238,82,83,.3); transition: all .2s; }
.btn-confirm:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(238,82,83,.4); }
.btn-action-img { flex: 1; background: var(--bg); border: 2px dashed var(--primary); color: var(--primary); padding: 14px; border-radius: 12px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; transition: all .2s; }
.btn-action-img:hover { background: var(--primary-light); transform: translateY(-2px); }
.btn-tool { flex: 1; padding: 14px; border-radius: 12px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--shadow-sm); transition: all .2s cubic-bezier(.25,.8,.25,1); }
.btn-tool:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.empty-state { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: var(--secondary); display: flex; flex-direction: column; align-items: center; gap: 15px; }
.status-msg { margin-top: 15px; padding: 14px; border-radius: 12px; text-align: center; font-size: 14px; display: none; font-weight: 600; }
.status-msg.show { display: block; }
.error { background: #fee2e2; color: #ef4444; border: 1px solid #fca5a5; }
.success { background: #dcfce7; color: #10ac84; border: 1px solid #6ee7b7; }
.warning-box { background: #fffbeb; border: 1px solid #fcd34d; color: #d97706; padding: 14px; border-radius: 12px; font-size: 13px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; font-weight: 600; }

/* --- 9. LAYOUTS DETALLES, JUEGOS Y EXTRAS --- */
.detail-layout { display: block; }
@media (min-width: 900px) {
    .detail-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
    .detail-gallery-column { position: sticky; top: 100px; }
}
.view-constrained { max-width: 800px; margin: 0 auto; width: 100%; }
.view-constrained-wide { max-width: 1200px; margin: 0 auto; width: 100%; }

.simon-btn { width: 100px; height: 100px; border-radius: 16px; border: none; cursor: pointer; transition: all 0.1s; opacity: 0.6; }
.simon-btn.active { opacity: 1; transform: scale(0.95); box-shadow: 0 0 20px currentColor; }
.simon-btn-green { background: #4ade80; color: #4ade80; }
.simon-btn-red { background: #f87171; color: #f87171; }
.simon-btn-yellow { background: #facc15; color: #facc15; }
.simon-btn-blue { background: #60a5fa; color: #60a5fa; }

/* Planes Selector */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 10px; }
.plan-card { background: var(--bg); border: 2px solid var(--border); border-radius: 16px; padding: 20px 10px; cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.plan-card:hover { border-color: var(--primary-light); transform: translateY(-2px); }
.plan-card.selected { border-color: var(--primary); background: var(--surface); box-shadow: 0 8px 24px var(--shadow-primary); transform: translateY(-4px); }
.plan-card.selected::after { content: "✔"; position: absolute; top: -10px; right: -10px; background: var(--primary); color: white; width: 24px; height: 24px; border-radius: 50%; font-size: 14px; font-weight: bold; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.plan-name { font-weight: 800; font-size: 15px; margin-bottom: 5px; color: var(--text); text-transform: uppercase; letter-spacing: 0.5px; }
.plan-price { font-size: 20px; font-weight: 900; color: var(--primary); margin-bottom: 2px; }
.plan-period { font-size: 11px; color: var(--text-light); font-weight: 500; }
.plan-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--success); color: white; font-size: 10px; font-weight: 800; padding: 4px 10px; border-radius: 20px; white-space: nowrap; box-shadow: 0 2px 5px rgba(0,0,0,0.1); letter-spacing: 0.5px; }
.plan-badge.vip { background: var(--vip-gold); color: black; }
.plan-toggle { display: flex; background: var(--bg); padding: 4px; border-radius: 14px; border: 1px solid var(--border); margin-bottom: 20px; position: relative; }
.plan-toggle-btn { flex: 1; border: none; background: transparent; color: var(--text-light); padding: 10px; border-radius: 10px; font-weight: 700; cursor: pointer; transition: all 0.2s; font-size: 13px; }
.plan-toggle-btn.active { background: var(--surface); color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* Utilidades */
.hidden { display: none !important; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.inline-block { display: inline-block; }
.mobile-hidden { display: block; }
.mobile-only { display: inline-block !important; }
@media (max-width: 639px) { .mobile-hidden { display: none !important; } }
@media (min-width: 640px) { .mobile-only { display: none !important; } }

/* Fix para Webkit Autofill y Safari Selects */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) {
        .form-group select, .filter-select {
            -webkit-appearance: none; appearance: none;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat; background-position: right 1rem center; background-size: 1em; padding-right: 2.5rem;
        }
    }
}

/* --- 10. COMPONENTES EXTRA Y FIXES (Subida, Redes, Layouts especiales) --- */
.featured-carousel { display: flex; overflow-x: auto; gap: 20px; max-width: 100%; flex-wrap: nowrap; padding: 10px 10px 25px 10px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-bottom: 15px; }
.featured-carousel::-webkit-scrollbar { display: none; }
.featured-carousel .post-card { min-width: 300px; max-width: 300px; scroll-snap-align: start; flex-shrink: 0; }
@media (max-width: 640px) { .featured-carousel .post-card { min-width: 240px; max-width: 240px; } }

.image-upload-area { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.img-preview { width: 70px; height: 70px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); cursor: pointer; transition: transform .2s; }
.img-preview:hover { transform: scale(1.05); }
.btn-add-img { width: 70px; height: 70px; border-radius: 12px; border: 2px dashed var(--secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--secondary); font-size: 28px; transition: all .2s; }
.btn-add-img:hover { background: var(--bg); color: var(--primary); border-color: var(--primary); }

.btn-fb { background: #1877F2; color: #fff; border: none; padding: 14px; border-radius: 12px; font-weight: 800; cursor: pointer; width: 100%; box-shadow: 0 4px 12px rgba(24,119,242,.3); transition: all .2s; }
.btn-fb:hover { background: #166fe5; transform: translateY(-2px); }

.cost-pill { background: var(--surface); padding: 14px 18px; border-radius: 14px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.cost-pill span:last-child { font-weight: 900; color: var(--primary); font-size: 16px; }

#recaptcha-container { margin: 20px 0; display: flex; justify-content: center; }

.floating-cart-btn { position: fixed; bottom: 100px; right: 24px; background: var(--success); color: #fff; border: none; border-radius: 30px; padding: 12px 24px; font-weight: 900; box-shadow: 0 8px 25px rgba(16,172,132,.4); z-index: 1900; align-items: center; gap: 10px; transition: transform .3s cubic-bezier(.25,.8,.25,1); animation: popIn .4s cubic-bezier(.25,.8,.25,1); display: none; font-size: 15px; }
.floating-cart-btn:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(16,172,132,.5); }
.floating-cart-btn:active { transform: scale(.95); }
.floating-cart-btn.hidden { display: none !important; }
@media (max-width: 640px) and (orientation: portrait) { .floating-cart-btn:not(.hidden) { display: flex; } }

/* Fix para visualización horizontal en móviles */
@media (orientation: landscape) and (max-height: 600px) {
    #view-wall:not(.hidden), #view-stores:not(.hidden), .container:not(.hidden) { display: block !important; grid-template-columns: none !important; width: 100% !important; max-width: 100% !important; padding: 0 !important; box-sizing: border-box !important; }
    .sidebar, #sidebar, aside, .desktop-only, .col-sidebar { display: none !important; }
    .feed-container { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 12px !important; padding: 12px 12px 80px 12px !important; position: relative !important; box-sizing: border-box !important; z-index: 0 !important; width: 100% !important; margin: 0 !important; }
    .post-card { aspect-ratio: 1/1 !important; }
    .post-card h4 { font-size: 12px !important; -webkit-line-clamp: 1 !important; }
    .post-price { font-size: 15px !important; }
    .post-content { padding: 10px !important; }
    .post-footer { display: none !important; }
    .app-header { position: static !important; z-index: 1; padding: 8px 20px !important; }
    .logo { font-size: 20px !important; }
    .category-bar, #cat-bar { position: sticky !important; top: 0; z-index: 20000 !important; background: var(--bg); padding: 8px 12px !important; margin-bottom: 12px !important; border-bottom: 1px solid var(--border); border-right: none !important; display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; overflow-x: auto !important; width: 100% !important; margin: 0 !important; float: none !important; box-shadow: 0 4px 12px rgba(0,0,0,.05); flex: none !important; }
    .search-container { position: static !important; padding: 0 !important; margin-top: 0 !important; }
    .cat-chip { flex-shrink: 0; padding: 6px 14px !important; font-size: 12px !important; }
    .modal-card { max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; padding: 20px; width: 500px; }
    #lightbox img { max-height: 90vh; }
}