/* ============================================
   SISTEMA HÍBRIDO: AUTOMÁTICO 
   ============================================ */
/* BASE: asumimos claro por defecto */
:root {
    --bg-main: #f5f5f7;
    --bg-card: #ffffff;
    --bg-card-border: rgba(0,0,0,0.08);

    --text-main: #111111;
    --text-secondary: #444444;

    /* HEADER SÓLIDO EN MODO CLARO AUTOMÁTICO */
    --header-bg: #ffffff;      /* ← antes rgba(255,255,255,0.65) */
    --header-text: #000000;

    --hover-bg: rgba(0,0,0,0.06);

    color-scheme: light dark;
}

/* AUTOMÁTICO — oscuro (cuando el sistema está en dark) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #212429;
        --bg-card: #1A1A1C;
        --bg-card-border: rgba(255,255,255,0.08);

        --text-main: #f5f5f7;
        --text-secondary: #cccccc;

        /* HEADER SÓLIDO EN MODO OSCURO AUTOMÁTICO */
        --header-bg: #14171B;
        --header-text: #ffffff;

        --hover-bg: rgba(255,255,255,0.12);
    }
}

/* ============================================
   FIX GLOBAL: QUITAR BLUR DEL HEADER
   ============================================ */
.edge-header {
    background-color: var(--header-bg) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}


.edge-header {
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 10000;

    background-color: var(--header-bg);
    color: var(--header-text);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    border-bottom: 1px solid var(--bg-card-border);
    display: flex;
    align-items: center;

    height: 70px;
    transition: none;
}

@media (min-width: 1024px) {
    .edge-header {
        height: 100px;
    }
}



/* ============================================
   RESET GLOBAL
============================================ */

html {
    margin: 0;
    padding: 0;
    background-color: var(--bg-main) !important;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    width: 100%; 
    min-height: 100vh;
    background: var(--bg-main) !important;
    color: var(--text-main) !important;
    font-family: 'Comfortaa', 'Montserrat', system-ui, sans-serif;
    overflow-x: clip; 
}

::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* ============================================================
   ESTILO DE TABS DEL HEADER
   ============================================================ */

/* CONTENEDOR — MÁS CUERPO Y SOMBRA */
.header-tabs {
    display: flex;
    gap: 6px; /* Aumentado de 4px para que respiren mejor */
    padding: 6px; /* Más espacio interno */
    border-radius: 999px;
    flex-shrink: 0;
    justify-content: center;
    margin: 0 auto;

    /* ⭐ Modo claro: Cristal más definido */
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Añadimos una sombra sutil para despegarlo del header */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* ⭐ Modo oscuro: Más profundidad */
@media (prefers-color-scheme: dark) {
    .header-tabs {
        background: rgba(20, 20, 20, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }
}

/* BOTONES — MAYOR LEGIBILIDAD */
.tab-btn {
    padding: 8px 18px; /* Subimos de 6px a 8px vertical */
    border-radius: 999px;
    background: transparent;
    border: none;
    color: var(--header-text);
    font-weight: 600; /* Subimos de 500 a 600 para que destaquen */
    cursor: pointer;
    font-size: 14px; /* Un punto más grande para evitar fatiga visual */

    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

/* HOVER SUTIL */
.tab-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* PÍLDORA ACTIVA — AZUL FONDITOS + BRILLO */
.tab-btn.active {
    background: #1b73e8;
    color: #ffffff;
    font-weight: 700; /* Más gruesa cuando está seleccionada */
    box-shadow: 0 6px 16px rgba(27, 115, 232, 0.4); /* Sombra azulada, no negra */
    transform: scale(1.05); /* Efecto pop sutil */
}

/* DESKTOP (ESCRITORIO) — AQUÍ ES DONDE SE VEÍAN PEQUEÑAS */
@media (min-width: 1024px) {
    .header-tabs {
        padding: 7px; /* Más robusto */
        gap: 10px;
    }
    .tab-btn {
        padding: 10px 26px; /* Botones más largos y elegantes */
        font-size: 16px; /* Tamaño estándar de escritorio */
        letter-spacing: 0.3px;
    }
}

/* AJUSTE PARA MÓVIL (EVITAR QUE SE VEAN DIMINUTAS) */
@media (max-width: 768px) {
    .tab-btn {
        padding: 7px 15px;
        font-size: 13.5px;
    }
}


/* ============================================
   HEADER — FIX DE ALINEACIÓN DEFINITIVO
============================================ */

/* Contenedor exterior */
.header-inner {
    width: 100%;
    padding: 0 24px;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}


/* Contenedor interior REAL */
.header-content {
    width: 100%;
    max-width: 1500px;
    display: flex;
    align-items: center;
    justify-content: center; /* ⭐ CAMBIO CLAVE: centramos el contenido */
    gap: 24px;
    position: relative; /* necesario para tabs absolutas */
}

.header-left,
.header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-right {
    justify-content: flex-end;
}

.header-tabs {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    /* ⭐ IMPORTANTE: SIN position:absolute aquí */
}



/* ============================================
Ajuste universal para TODOS los teléfonos
=============================================== */


@media (max-width: 480px) {
    .header-logo img {
        max-height: 28px;
    }

    .header-left,
    .header-tabs {
        flex-shrink: 1;
    }

    .header-right {
        flex-shrink: 0;
    }
}

/* Afinado extra para pantallas aún más estrechas (iPhone 15 Pro Max y similares) */
@media (max-width: 430px) {
    .header-logo img {
        max-height: 30px;
    }

    .header-tabs .tab-btn {
        font-size: 13px;
        padding: 6px 10px;
    }
}


/* Por defecto (modo claro automático del sistema) → usar DARK */
@media (prefers-color-scheme: light) {
    .logo-light { display: none; }
    .logo-dark { display: inline; }
}

/* Por defecto (modo oscuro automático del sistema) → usar LIGHT */
@media (prefers-color-scheme: dark) {
    .logo-light { display: inline; }
    .logo-dark { display: none; }
}




/* ============================
   FIX HEADER EN MÓVIL
   ============================ */

@media (max-width: 480px) {

    /* Logo estable */
    .header-logo img {
        max-height: 32px;
    }

    /* NO permitir que tabs o logo se compriman */
    .header-left,
    .header-tabs,
    .header-right {
        flex-shrink: 0;
    }

    /* Tabs centradas visualmente */
    .header-inner > .header-content {
        justify-content: center;
    }

    /* Asegurar que los lados empujen */
    .header-left,
    .header-right {
        flex: 1;
    }

    /* Iconos a la derecha */
    .header-right {
        display: flex;
        justify-content: flex-end;
    }
}

/* ============================================================
   LOGO: TAMAÑO FLUIDO + CAMBIO DE TEMA - CENTRAR EL TAB EN HEADER MOVIL
   ============================================================ */

.header-inner {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important; 
    padding: 0 25px !important;
    min-height: 100px; /* Subimos un poco el min-height para que el logo respire */
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 1. CAJAS LATERALES: SIMETRÍA ABSOLUTA */
.header-left, 
.header-right {
    flex: 1 1 0% !important; 
    display: flex !important;
    align-items: center !important;
    min-width: 0;
}

.header-left {
    justify-content: flex-start !important;
}

.header-right {
    justify-content: flex-end !important;
}

/* 2. TABS: CENTRADO MATEMÁTICO */
.header-tabs {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: flex !important;
    gap: 12px;
    z-index: 10;
    margin: 0 !important;
}

/* 3. LOGO: TAMAÑO REALZADO */
.header-logo {
    display: flex !important;
    /* Subimos el tope de 60px a 75px para darle más tamaño en pantallas grandes */
    height: clamp(34px, 6vw, 75px) !important;
}

.header-logo img {
    height: 100% !important;
    width: auto !important;
    object-fit: contain !important;
    /* Mejora de nitidez para logos más grandes */
    image-rendering: -webkit-optimize-contrast;
}

/* 4. LÓGICA DE TEMAS */
.logo-dark { display: block !important; }
.logo-light { display: none !important; }

@media (prefers-color-scheme: dark) {
    .logo-light { display: block !important; }
    .logo-dark { display: none !important; }
}

/* 5. AJUSTE PARA MÓVIL (Mantenemos tus medidas que funcionan) */
@media (max-width: 768px) {
    .header-inner {
        min-height: 65px !important;
        padding: 0 15px !important;
    }
    .header-logo {
        height: 34px !important;
    }
}



/* ============================
 BUSQUEDA POR COLORES
============================ */

/* Bloque general */
.color-explore-title {
    font-size: 14px;
    font-weight: 700;
    max-width: 1000px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-main);
    opacity: 0.7;

    margin: 0 0 14px 40px; /* igual que POPULAR TAGS */

}

.color-explore-block {
    margin: 30px auto;
    max-width: 1000px;
    text-align: center;
    padding: 0 20px;
}


/* Contenedor de chips */
.color-explore-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* CHIP INDIVIDUAL (Estilo Cristal) */
.color-chip {
    padding: 10px 22px;
    border-radius: 100px; /* Cápsula perfecta */
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    
    /* Color dinámico basado en tu variable --chip-color */
    color: var(--text-main); 
    background: rgba(128, 128, 128, 0.05); /* Fondo base muy suave */
    border: 1px solid rgba(128, 128, 128, 0.1);
    
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Rebote premium */
    backdrop-filter: blur(8px);
}

/* EFECTO AL TOCAR / HOVER */
.color-chip:hover, .color-chip:active {
    transform: translateY(-5px) scale(1.08);
    background: var(--chip-color) !important; /* Se llena de color */
    border-color: var(--chip-color);
    color: #fff !important; /* Texto siempre blanco al resaltar */
    
    /* Resplandor dinámico del color del chip */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 
                0 0 20px 0 var(--chip-color);
    opacity: 1;
}

/* Ajuste específico para el chip "Claros" en hover si el fondo es blanco */
.color-chip[style*="#e0e0e0"]:hover {
    color: #111 !important; /* Texto negro solo en el chip claro */
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .color-explore-chips {
        gap: 10px;
    }
    
    .color-chip {
        padding: 12px 20px; /* Más fáciles de tocar en móvil */
        font-size: 0.85rem;
        flex: 1 1 auto; /* Se ajustan para llenar filas si es necesario */
        min-width: 100px;
    }
}


/* ============================
 AJAX CARGAR MAS
============================ */

/* --- ESTILO BASE (estructura, spacing, tipografía) --- */
.btn-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 10px 22px;
    margin: 25px auto;

    border: 1px solid transparent;
    border-radius: 10px;

    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.2px;

    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.18s ease;

    /* centrado horizontal */
    display: flex;
    margin-left: auto;
    margin-right: auto;

    /* colores base ligados al sistema */
    background: var(--bg-card);
    color: var(--text-main);
    border-color: var(--bg-card-border);
}

/* Icono base */
.btn-load-more .icon {
    font-size: 16px;
    transition: color 0.25s ease;
    color: #1b73e8; /* acento editorial fijo */
}

/* Hover / active — mismo comportamiento en claro y oscuro */
.btn-load-more:hover,
.btn-load-more:active {
    background: #1b73e8;
    border-color: #1b73e8;
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-load-more:hover .icon,
.btn-load-more:active .icon {
    color: #ffffff;
}


/* ============================================================
   Lazy load
   ============================================================ */


.lazy-img {
    width: 100%;
    height: 100%;
    object-fit: cover;

    filter: blur(20px);
    transform: scale(1.05);
    opacity: 0;

    transition: filter .6s ease, transform .6s ease, opacity .6s ease;
}

.lazy-img.loaded {
    filter: blur(0);
    transform: scale(1);
    opacity: 1;
}

/* =========================================
   ANCHO DE GRILL HOME
========================================= */
html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
    margin: 0; 
    padding: 0; 
    width: 100%;
    background-color: var(--bg-main);
    font-family: system-ui, -apple-system, sans-serif;
}

:root {
    --active-color: #1a73e8; 
    --active-bg: #1a73e8;
    --active-glow: rgba(26, 115, 232, 0.5);
}

/* Contenedor de contenido principal */
.edge-content { 
    /* Antes tenías 110px, ahora súbelo para compensar el absolute */
    padding: 80px 5% 40px 5% !important; 
}

/* Grid de Wallpapers */
.edge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
    gap: 25px;
    width: 100%;
}

.edge-thumb, [data-block*="pc"] .edge-thumb {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: cover !important;
    border-radius: 20px;
}

/* Responsive del Grid */
@media (max-width: 649px) {
    .edge-grid { grid-template-columns: 1fr !important; }
    [data-block*="phone"] .edge-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 8px !important; 
    }
    [data-block*="phone"] .edge-thumb { 
        aspect-ratio: 11 / 16 !important; 
    }
}

/* ============================================================
   MENU POPULAR HEADER
   ============================================================ */

:root {
    color-scheme: light dark;
    --menu-bg: rgba(128, 128, 128, 0.08);
    --menu-border: rgba(0, 0, 0, 0.08);
    --accent-fonditos: #1b73e8; /* Tu azul de títulos */
}

@media (prefers-color-scheme: dark) {
    :root {
        --menu-bg: rgba(255, 255, 255, 0.05);
        --menu-border: rgba(255, 255, 255, 0.08);
    }
}

html {
    margin: 0;
    padding: 0;
    background-color: var(--bg-main) !important;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    width: 100%; 
    min-height: 100vh;
    background: var(--bg-main) !important;
    color: var(--text-main) !important;
    font-family: 'Comfortaa', 'Montserrat', system-ui, sans-serif;
    overflow-x: clip;
}

::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.bottom-menu-wrapper {
    width: 100%;
    padding: 0 !important; 
    display: flex;
    justify-content: center;
    perspective: 1000px; 
    margin-top: 20px;
}

.bottom-menu {
    display: flex;
    gap: 15px;
    padding: 10px;
    align-items: center;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--menu-bg);
    border: 1px solid var(--menu-border);
    border-radius: 100px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.menu-item i { 
    font-size: 20px; 
    opacity: 0.8; 
}

@media (hover: hover) {
    .menu-item:hover {
        transform: translateY(-4px) scale(1.03);
        background: rgba(128, 128, 128, 0.12);
        border-color: rgba(27, 115, 232, 0.3);
    }
}

.menu-item.active {
    backdrop-filter: blur(20px) saturation(180%);
    -webkit-backdrop-filter: blur(20px) saturation(180%);
    transform: translateY(-2px) scale(1.05);
}

.menu-item.active i { 
    color: var(--accent-fonditos) !important; 
    opacity: 1 !important;
    /* Resplandor más definido con el nuevo azul */
    text-shadow: 0 0 15px rgba(27, 115, 232, 0.5);
}

@media (prefers-color-scheme: dark) {
    .menu-item.active {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.3) !important; 
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 10px rgba(27, 115, 232, 0.2) !important;
    }
}

@media (prefers-color-scheme: light) {
    .menu-item.active {
        /* Fondo azul sutil para que el círculo se note en modo claro */
        background: rgba(27, 115, 232, 0.12) !important; 
        border: 1px solid rgba(27, 115, 232, 0.4) !important;
        box-shadow: 0 8px 20px rgba(27, 115, 232, 0.2) !important;
    }
    .menu-item.active .menu-text { 
        color: var(--accent-fonditos) !important; 
    }
}

@media (max-width: 1024px) {
    .bottom-menu {
        gap: 10px;
        width: 100%;
        justify-content: center;
        padding: 0 10px;
    }

    .menu-item {
        padding: 0 !important;
        width: 50px !important;
        height: 50px !important;
        justify-content: center;
        border-radius: 50% !important;
    }

    .menu-item .menu-text, 
    .menu-item.active .menu-text { 
        display: none !important; 
    }

    .menu-item.active {
        width: 50px !important;
        transform: scale(1.1);
    }
}

.edge-content .bottom-menu-wrapper {
    margin-top: 10px !important; 
    margin-bottom: 30px;
}

.page-wrapper .bottom-menu-wrapper {
    margin-top: -10px !important; 
    margin-bottom: 20px;
}

.featured-wrapper .bottom-menu-wrapper {
    margin-top: 0px !important;
    padding-top: 10px !important; 
    margin-bottom: 10px !important; 
}


/* ============================================================
   4. TAGS / CHIPS (Mantenemos tu estilo original de tags)
   ============================================================ */
.tag-cloud-item {
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    padding: 8px 16px;    
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    color: var(--text-main);
    opacity: 0.6;
}

/* Ciclo de colores original para los tags */
.tag-cloud-item:nth-child(6n+1) { color: #5567ff; }
.tag-cloud-item:nth-child(6n+2) { color: #ff4b5c; }
.tag-cloud-item:nth-child(6n+3) { color: #00c9b7; }
.tag-cloud-item:nth-child(6n+4) { color: #ffa348; }
.tag-cloud-item:nth-child(6n+5) { color: #ab47bc; }
.tag-cloud-item:nth-child(6n+6) { color: #778ca3; }

.tag-cloud-item:hover {
    transform: translateY(-2px);
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
    border-color: currentColor;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}


  /* ============================
   TAG CLOUD — FOOTER
============================ */

/* ============================
   CONTENEDOR (No tocar altura)
   ============================ */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-top: 40px;
    justify-content: center;
    padding-bottom: 20px; /* Pequeño espacio antes de la raya */
}

/* ============================
   TAG BASE (El que ya tienes)
   ============================ */
.tag {
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 12px;
    text-decoration: none;
    white-space: nowrap;
    display: inline-block;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.2s ease,
                box-shadow 0.25s ease,
                background 0.25s ease,
                border-color 0.25s ease,
                color 0.25s ease;
    opacity: 0.95;
    color: var(--text-main);
    border: 1px solid transparent;
    background: transparent;
}

.tag:hover {
    transform: translateY(-4px);
    opacity: 1;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

/* Tamaños */
.tag-sm { font-size: 13px; }
.tag-md { font-size: 15px; }
.tag-lg { font-size: 18px; }
.tag-xl { font-size: 22px; }

/* ============================
   COLORES MODO OSCURO (Vibrantes)
   ============================ */
body.theme-dark .tag.pink   { color: #ff85a2; }
body.theme-dark .tag.blue   { color: #85d6ff; }
body.theme-dark .tag.yellow { color: #ffd685; }
body.theme-dark .tag.purple { color: #d1b3ff; }
body.theme-dark .tag.green  { color: #66ffb3; }
body.theme-dark .tag.orange { color: #ffb385; }

/* Hover Oscuro (Burbuja) */
body.theme-dark .tag.pink:hover   { background: #b84d6a; border-color: rgba(255,255,255,0.12); color: #fff; }
body.theme-dark .tag.blue:hover   { background: #3d6fa8; border-color: rgba(255,255,255,0.12); color: #fff; }
body.theme-dark .tag.yellow:hover { background: #b89a3d; border-color: rgba(255,255,255,0.12); color: #fff; }
body.theme-dark .tag.purple:hover { background: #6f4fa8; border-color: rgba(255,255,255,0.12); color: #fff; }
body.theme-dark .tag.green:hover  { background: #3d8a63; border-color: rgba(255,255,255,0.12); color: #fff; }
body.theme-dark .tag.orange:hover { background: #b8743d; border-color: rgba(255,255,255,0.12); color: #fff; }

/* ============================
   LA BARRA IGUAL A LA IMAGEN (AQUÍ ESTÁ)
   ============================ */
.section-divider-line {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #00f0ff, #e000ff);
    margin: 0 !important; /* Forzamos para que se pegue al footer */
    padding: 0;
    display: block;
}

/* Pegar el footer a la raya */
footer {
    margin-top: 0 !important;
}

/* ============================
   MODO CLARO
   ============================ */
.tags-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-main);
    opacity: 0.7;

    margin: 0 0 14px 40px; /* ← antes 12px, ahora 40px */
    display: block;
}


/* ============================
   MODO CLARO
   ============================ */
body.theme-light .tag.pink   { color: #d6336c; }
body.theme-light .tag.blue   { color: #1971c2; }
body.theme-light .tag.yellow { color: #f08c00; }
body.theme-light .tag.purple { color: #6f42c1; }
body.theme-light .tag.green  { color: #099268; }
body.theme-light .tag.orange { color: #e8590c; }

body.theme-light .tag.pink:hover   { background: #ffd6e0; border-color: rgba(0,0,0,0.08); }
body.theme-light .tag.blue:hover   { background: #d7eaff; border-color: rgba(0,0,0,0.08); }
body.theme-light .tag.yellow:hover { background: #fff3c4; border-color: rgba(0,0,0,0.08); }
body.theme-light .tag.purple:hover { background: #e8d9ff; border-color: rgba(0,0,0,0.08); }
body.theme-light .tag.green:hover  { background: #d9ffe5; border-color: rgba(0,0,0,0.08); }
body.theme-light .tag.orange:hover { background: #ffe2c2; border-color: rgba(0,0,0,0.08); }

/* ============================
   TAGS — SCROLLER GLOBAL
============================ */


.tag-scroller {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tag-scroller::-webkit-scrollbar {
    display: none;
}

.tag-track {
    display: flex;
    gap: 12px;
    white-space: nowrap;
    animation: scrollTags 90s linear infinite;
}

@media (min-width: 1024px) {
    .tag-track {
        animation: scrollTags 90s linear infinite;
    }

    .tag-scroller:hover .tag-track {
        animation-play-state: paused;
    }
}

.tag-chip {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 18px;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.tag-chip:hover {
    background: var(--bg-card-border);
    border-color: rgba(255,255,255,0.25);
}

@keyframes scrollTags {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}


/* ============================================
   SUBIR ARRIBA GLOBAL
=============================================== */

.btn-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;

    display: flex;
    align-items: center;
    justify-content: center;

    /* 🔥 Azul Fonditos */
    background: #1b73e8;
    color: #fff;

    /* Sombra premium */
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);

    /* Glass suave */
    backdrop-filter: blur(10px);

    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all .35s ease;
    z-index: 9999;
}

/* Cuando aparece */
.btn-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Hover */
.btn-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
    background: #1c7df5; /* un toque más brillante */
}


/* ============================================================
   CONTROL DE ESPACIO UNIFICADO (HOME + PAGES)
   ============================================================ */


/* Aplicamos a .edge-content (Home) y .page-wrapper (Otras páginas) */
.edge-content,
.page-wrapper.page-search,
.page-wrapper.page-color,
.page-wrapper.page-category,
.page-wrapper.page-tags {
    /* MÓVIL: Ajuste fino para header de 70px */
    padding-top: 100px !important; 
    padding-bottom: 0px !important;
    box-sizing: border-box;
}

@media (min-width: 1024px) {
    /* Quitamos .page-home porque .edge-content ya lo cubre */
    .edge-content, 
    .page-wrapper.page-search,
    .page-wrapper.page-color,
    .page-wrapper.page-category,
    .page-wrapper.page-tags {
        /* CAMBIA 120px por 110px para tener esos 10px de margen perfectos */
        padding-top: 110px !important; 
    }
}

/* iPHONE SAFARI: El toque maestro para el Notch */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 1023px) {
        .edge-content,
        .page-wrapper.page-search,
        .page-wrapper.page-color,
        .page-wrapper.page-category,
        .page-wrapper.page-tags {
            /* Usamos la safe-area para que Safari pinte perfecto */
            padding-top: calc(85px + env(safe-area-inset-top, 0px)) !important;
        }
    }
}


/* =============================
  LUPA DE BUSQUEDA DEL HEADER
=============================== */

/* --- BOTÓN DISPARADOR (TRIGGER) --- */
.search-trigger-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-main);
}

.search-trigger-btn i {
    font-size: 26px;
    line-height: 1;
}

.search-trigger-btn:hover {
    background: var(--menu-bg);
    color: #1b73e8;
    transform: scale(1.05);
}

/* --- OVERLAY (FONDO INVISIBLE) --- */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent !important; 
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 2000000 !important;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5vh;
}

@media (min-width: 768px) {
    .search-overlay {
        padding-top: 10vh;
    }
}

/* --- CAJA DE BÚSQUEDA --- */
.search-modal-box {
    width: 92%;
    max-width: 480px; 
    background: var(--bg-main);
    border-radius: 100px; /* Tu estilo píldora original */
    border: 1px solid var(--menu-border);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    /* CAMBIO CLAVE: Quitamos overflow hidden para que los resultados no se corten */
    overflow: visible; 
    animation: spotlightEntrance 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: box-shadow 0.3s ease, border-color 0.3s ease, border-radius 0.3s ease;
}

/* Cuando aparecen resultados, suavizamos el radio inferior para que la lista encaje mejor */
.search-modal-box:has(.search-modal-results[style*="display: block"]),
.search-modal-box:has(.search-modal-results:not([style*="display: none"])) {
    border-radius: 24px; 
}

.search-modal-box:focus-within {
    border-color: rgba(27, 115, 232, 0.6);
    box-shadow: 0 0 15px rgba(27, 115, 232, 0.15), 0 20px 50px rgba(0,0,0,0.3);
}

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

/* --- ESTRUCTURA INTERNA --- */
.search-modal-top {
    display: flex;
    align-items: center;
    padding: 4px 12px;
    gap: 0;
}

.search-modal-form {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    gap: 12px;
}

.search-modal-form i {
    font-size: 20px;
    color: #1b73e8;
}

.search-modal-form input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none !important;
    font-size: 17px;
    color: var(--text-main);
    padding: 6px 0;
}

/* --- BOTÓN CERRAR COMPACTO --- */
.search-modal-close {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 20px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.search-modal-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* --- RESULTADOS --- */
.search-modal-results {
    max-height: 55vh;
    overflow-y: auto;
    border-top: 1px solid var(--menu-border);
    padding: 12px 20px;
    display: none;
    /* Redondeamos la base de los resultados para que no queden cuadrados */
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.search-modal-results::-webkit-scrollbar {
    width: 4px;
}

.search-modal-results::-webkit-scrollbar-thumb {
    background: var(--menu-border);
    border-radius: 10px;
}