:root {
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.8);
    --accent: #6366f1; 
    --text-main: #1a1a1e;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, sans-serif;
    margin: 0;
    overflow-x: hidden;
}

.fluid-background {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 0% 0%, #ffffff 0%, #f1f5f9 100%);
}

.fluid-background::before {
    content: '';
    position: absolute;
    width: 150%; height: 150%;
    background: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(244, 63, 94, 0.05) 0%, transparent 50%);
    animation: moveFluids 25s infinite alternate linear;
    will-change: transform; 
}

@keyframes moveFluids {
    from { transform: rotate(0deg) translate(-5%, -5%); }
    to { transform: rotate(5deg) translate(5%, 5%); }
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, box-shadow; 
}

.card-glass:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.8);
}

.map-container-glass {
    border-radius: 40px;
    overflow: hidden;
    border: 8px solid white;
    box-shadow: 0 20px 40px rgba(0,0,0,0.03);
    background: #eee;
    height: 650px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease;
}

.map-container-glass:hover {
    transform: scale(1.01);
}

.titulo-reveal {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    text-align: center;
    animation: fadeInUp 1.2s ease forwards;
}

.text-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text; 
}

.categoria-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.posts-destacados {
    padding: 80px 20px;
    max-width: 1300px;
    margin: 0 auto;
}

.grid-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px;
    align-items: stretch;
}

.card-img {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 20px;
    margin-bottom: 20px;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(0.8) brightness(0.9);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-glass:hover .card-img img {
    filter: saturate(1.1) brightness(1);
}

.map-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 5%;
}

#map svg {
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.05));
}

#map path {
    transition: fill 0.4s cubic-bezier(0.23, 1, 0.32, 1), 
                stroke 0.4s ease, 
                filter 0.4s ease !important;
}

#map path:hover {
    filter: brightness(0.95) saturate(1.2);
    cursor: crosshair;
}

.sm-tooltip {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 12px !important;
    border: 1px solid var(--accent) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    color: var(--text-main) !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    padding: 10px 15px !important;
}

.hero-header {
    text-align: center;
    padding: 60px 20px;
}

.btn-minimal {
    text-decoration: none;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-block; 
}

.btn-minimal:hover {
    letter-spacing: 3px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); filter: blur(10px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@media (max-width: 1024px) {
    .grid-posts { grid-template-columns: repeat(2, 1fr); }
}

/* --- OPTIMIZACIÓN MÓVIL Y SCROLL INVISIBLE --- */
@media (max-width: 768px) {
    .grid-posts { grid-template-columns: 1fr; }
    
    .map-wrapper { padding: 0 15px; }

    .map-container-glass {
        height: 450px; 
        border-radius: 24px;
        border-width: 4px;
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        
        /* Ocultar scroll en Firefox y Edge */
        -ms-overflow-style: none;  
        scrollbar-width: none;  
    }

    /* Ocultar scroll en Chrome, Safari y Móviles */
    .map-container-glass::-webkit-scrollbar {
        display: none;
    }

    #map svg {
        min-width: 700px; 
        height: auto;
        padding: 0 20px; 
    }

    .titulo-reveal {
        font-size: 1.8rem;
        line-height: 1.2;
    }
}

@media (pointer: coarse) {
    .sm-tooltip {
        font-size: 14px !important;
        padding: 12px 20px !important;
        margin-top: -50px !important; 
    }
}

.sm-map-link, 
text[style*="cursor: pointer"], 
a[href*="simplemaps.com"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

svg text { user-select: none; }
#map a { pointer-events: auto; }

/* =========================================
   === ESTILOS SECCIÓN PROMOCIÓN LIBRO ===
   ========================================= */

.promocion-libro {
    padding: 80px 20px;
    position: relative;
    z-index: 1; /* Asegura que esté sobre el fondo fluido */
}

.container-libro {
    max-width: 1200px;
    margin: 0 auto;
}

.card-libro-glass {
    /* Reutilizamos y refinamos la base glassmorphism */
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 40px;
    padding: 60px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.05);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden; /* Importante para el efecto de luz */
    position: relative;
}

/* Efecto de luz AI-First al hover */
.card-libro-glass::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: all 0.8s ease;
}

.card-libro-glass:hover::before {
    left: 100%;
}

.card-libro-glass:hover {
    transform: translateY(-5px) scale(1.005);
    background: rgba(255, 255, 255, 0.6);
}

.libro-layout {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Portada pequeña, texto grande */
    gap: 50px;
    align-items: center;
}

.libro-portada {
    position: relative;
    perspective: 1000px; /* Para efecto 3D sutil */
}

.libro-portada img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    transition: transform 0.6s ease;
    display: block;
}

/* Efecto 3D sutil al hover de la tarjeta */
.card-libro-glass:hover .libro-portada img {
    transform: rotateY(-10deg) rotateX(5deg);
}

.badget-novedad {
    display: inline-block;
    padding: 6px 15px;
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    color: white;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.libro-info h2 {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.libro-descripcion {
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 600px;
}

.libro-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
}

.btn-cta-libro {
    text-decoration: none;
    display: inline-block;
    padding: 18px 35px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border-radius: 15px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
    will-change: transform, box-shadow;
}

.btn-cta-libro:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.3);
    filter: brightness(1.1);
}

.libro-plataforma {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-left: 5px;
}

/* --- OPTIMIZACIÓN MÓVIL PARA LA SECCIÓN LIBRO --- */
@media (max-width: 768px) {
    .promocion-libro {
        padding: 60px 15px;
    }

    .card-libro-glass {
        padding: 40px 25px;
        border-radius: 24px;
    }

    .libro-layout {
        grid-template-columns: 1fr; /* Una columna en móvil */
        gap: 30px;
        text-align: center;
    }

    .libro-portada {
        max-width: 250px;
        margin: 0 auto; /* Centrar portada */
    }

    /* Anular efecto 3D en móvil para mejor rendimiento */
    .card-libro-glass:hover .libro-portada img {
        transform: none;
    }

    .libro-descripcion {
        margin: 0 auto 30px auto;
    }

    .libro-actions {
        align-items: center; /* Centrar botón */
    }

    .btn-cta-libro {
        padding: 15px 30px;
        font-size: 1rem;
        width: 100%; /* Botón ancho completo en móvil */
        box-sizing: border-box;
    }
}