/* --- CSS OPTIMIZADO (BIBLIOTECA) --- */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Poppins', sans-serif;
            cursor: none !important;
        }

        /* EFECTO DE SELECCIÓN MÁGICA */
        ::selection {
            background: rgba(106, 15, 15, 0.8);
            /* Fondo rojo oscuro Starmark (semi-transparente) */
            color: #ffffff;
            /* Texto blanco */
            /* Esto crea el efecto de "estrellitas" o luz mágica alrededor de las letras */
            text-shadow:
                0 0 5px #d4af37,
                0 0 10px #d4af37,
                0 0 20px #ffecb3;
        }

        ::-moz-selection {
            /* Para Firefox */
            background: rgba(106, 15, 15, 0.8);
            color: #ffffff;
            text-shadow: 0 0 5px #d4af37, 0 0 10px #d4af37;
        }


        /* CORRECCIÓN DE FONDO: Negro arriba, #6a0f0f abajo, fijo al scrollear */
        html {
      color-scheme: dark;
            scroll-behavior: smooth;
        }

        body {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            /* Degradado lineal de Negro a Rojo Específico (#6a0f0f), fijo */
            background: linear-gradient(to bottom, #000000 50%, #6a0f0f);
            background-attachment: fixed;
            color: #fff;
            overflow-x: hidden;
            cursor: none;
        }

        canvas {
            position: fixed;
            inset: 0;
            width: 100%;
            height: 100%;
            z-index: 0;
            pointer-events: none
        }

        /* Header */
        header {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            background: rgba(0, 0, 0, .9);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 50px;
            z-index: 3002;
            box-shadow: 0 2px 8px rgba(255, 255, 255, .05)
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 10px
        }

        .logo img {
            width: 40px;
            height: 40px;
            border-radius: 50%
        }

        .logo span {
            font-size: 1.3rem;
            font-weight: 700;
            color: #fff
        }

        

        nav ul {
            list-style: none;
            display: flex;
            gap: 20px;
            align-items: center
        }

        nav ul li {
            position: relative
        }

        nav ul li a {
            color: #fff;
            text-decoration: none;
            font-weight: 500;
            position: relative;
            padding: 5px;
            transition: .3s
        }

        nav ul li a:hover {
            color: #ff3c3c
        }

        nav ul li a::after {
            content: "";
            position: absolute;
            left: 0;
            bottom: -5px;
            width: 0;
            height: 2px;
            background: #ff3c3c;
            transition: width .3s
        }

        nav ul li a:hover::after {
            width: 100%
        }

        .submenu {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            background: rgba(0, 0, 0, .95);
            padding: 10px 0;
            border-radius: 8px;
            min-width: 200px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
            z-index: 25
        }

        nav ul li:hover .submenu {
            display: block
        }

        .submenu li {
            padding: 5px 20px
        }

        .submenu li a {
            display: block;
            color: #fff;
            padding: 8px 10px;
            transition: .3s;
            position: relative;
            white-space: nowrap;
        }

        .submenu li a:hover {
            background: rgba(65, 11, 11, 0.8);
            color: #fff;
            border-radius: 5px;
            transform: translateX(3px)
        }

        /* ESTADOS ACTIVOS */
        /* Padre Activo (Servicios) */
        nav ul li.parent-active>a {
            color: #d4af37 !important;
            font-weight: 700;
        }

        nav ul li.parent-active>a::after {
            content: "";
            width: 100%;
            background: #ff3c3c;
            height: 2px;
            position: absolute;
            left: 0;
            bottom: -5px;
            transition: none;
        }

        /* Hijo Activo (Marketing) */
        /* Hijo Activo (Marketing) */
        .submenu li a.active-page {
            background: #5c0c0c;
            color: #fff !important;
            border-radius: 10px;
            border-left: 5px solid #d4af37;
            border-bottom: none;
            margin: 5px 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        }

        /* Botón Alquilar (Header) */
        .btn-alquilar-nav {
            background: linear-gradient(135deg, #d4af37, #b8860b);
            color: #000 !important;
            padding: 8px 20px;
            border-radius: 20px;
            font-weight: 700 !important;
            box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
            transition: transform 0.3s !important;
        }

        .btn-alquilar-nav:hover {
            transform: scale(1.05);
            box-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
            color: #000 !important;
        }

        .btn-alquilar-nav::after {
            display: none !important;
        }

        /* Móvil */
        

        

        

        

        

        

        


        

        

        /* --- LAYOUT BIBLIOTECA --- */
        section {
            padding: 130px 40px 80px;
            max-width: 1300px;
            margin: auto;
            position: relative;
            z-index: 5
        }

        h2 {
            color: #d4af37;
            text-align: center;
            margin-bottom: 30px;
            font-size: 2.5rem;
            letter-spacing: 2px;
            text-shadow: 0 0 10px rgba(212, 175, 55, .5)
        }

        /* BARRA DE BÚSQUEDA */
        .search-container {
            max-width: 600px;
            margin: 0 auto 50px;
            position: relative;
            display: flex;
            align-items: center
        }

        .search-input {
            width: 100%;
            padding: 15px 20px 15px 50px;
            background: rgba(255, 255, 255, .05);
            border: 2px solid rgba(212, 175, 55, .5);
            border-radius: 30px;
            color: #fff;
            font-size: 1.1rem;
            outline: none;
            transition: .3s
        }

        .search-input:focus {
            background: rgba(255, 255, 255, .1);
            border-color: #d4af37;
            box-shadow: 0 0 15px rgba(212, 175, 55, .3)
        }

        .search-icon {
            position: absolute;
            left: 20px;
            color: #d4af37;
            font-size: 1.2rem
        }

        .highlight {
            background-color: rgba(212, 175, 55, 0.4);
            color: #fff;
            padding: 0 4px;
            border-radius: 4px;
            text-shadow: 0 0 5px #d4af37;
            box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
        }

        .no-results {
            text-align: center;
            color: #aaa;
            font-style: italic;
            display: none;
            grid-column: 1/-1;
            padding: 20px
        }

        /* GRID Y CARTAS */
        .library-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            justify-items: center;
            counter-reset: book-counter;
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .book-card {
            background: rgba(255, 255, 255, .05);
            border: 1px solid rgba(212, 175, 55, .2);
            border-radius: 10px;
            width: 100%;
            overflow: hidden;
            transition: .3s;
            display: flex;
            flex-direction: column;
            position: relative;
            animation: fadeInUp 0.6s ease forwards;
            counter-increment: book-counter;
        }

        .book-card::before {
            content: "#" counter(book-counter);
            position: absolute;
            top: 10px;
            left: 10px;
            background: rgba(0, 0, 0, 0.8);
            color: #ffecb3;
            padding: 4px 10px;
            border-radius: 6px;
            font-weight: 700;
            font-size: 0.85rem;
            border: 1px solid rgba(212, 175, 55, 0.5);
            z-index: 2;
            pointer-events: none;
            backdrop-filter: blur(4px);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
        }

        .book-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 10px 25px rgba(212, 175, 55, .25);
            border-color: #d4af37;
        }

        .age-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            background: #d4af37;
            color: #000;
            padding: 3px 10px;
            border-radius: 20px;
            font-weight: 800;
            font-size: 0.8rem;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
            z-index: 2;
            pointer-events: none;
        }

        .book-cover-container {
            width: 100%;
            height: 380px;
            overflow: hidden;
            position: relative;
            cursor: pointer
        }

        .book-cover {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: .4s
        }

        .book-card:hover .book-cover {
            transform: scale(1.05)
        }

        .book-info {
            padding: 20px;
            flex-grow: 1;
            display: flex;
            flex-direction: column
        }

        .book-title {
            font-size: 1.1rem;
            color: #d4af37;
            font-weight: 700;
            margin-bottom: 8px;
            line-height: 1.3
        }

        .book-meta {
            font-size: .85rem;
            color: #aaa;
            margin-bottom: 12px
        }

        .book-meta span {
            color: #ff3c3c;
            font-weight: 600
        }

        .book-synopsis {
            font-size: .9rem;
            color: #ddd;
            line-height: 1.5;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden
        }

        /* Modal Zoom */
        .zoom-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, .95);
            justify-content: center;
            align-items: center;
            z-index: 5000;
            /* Fix: Above Everything */
            backdrop-filter: blur(5px);
            opacity: 0;
            transition: opacity .3s ease-in-out
        }

        .zoom-modal.active {
            display: flex;
            opacity: 1
        }

        .zoom-content {
            max-width: 90%;
            max-height: 90%;
            /* Increased slightly */
            object-fit: contain;
            /* Ensure image isn't cropped */
            border-radius: 10px;
            box-shadow: 0 0 35px rgba(212, 175, 55, .8);
            border: 3px solid #d4af37;
            transform: scale(.8);
            transition: transform .4s cubic-bezier(.25, .46, .45, .94)
        }

        .zoom-modal.active .zoom-content {
            transform: scale(1)
        }

        .close-zoom {
            position: absolute;
            top: 30px;
            right: 40px;
            color: #fff;
            font-size: 3rem;
            cursor: pointer;
            transition: .3s;
            z-index: 5001
                /* Fix: Above zoom modal */
        }

        .close-zoom:hover {
            color: #d4af37
        }

        /* Modal Alquiler */
        .rent-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, .9);
            justify-content: center;
            align-items: center;
            z-index: 4000;
            /* Fix: Above Header (1001) */
            backdrop-filter: blur(3px);
            opacity: 0;
            transition: opacity .3s
        }

        .rent-modal.active {
            display: flex;
            opacity: 1
        }

        .rent-content {
            background: linear-gradient(145deg, #1a0505, #000);
            border: 2px solid #d4af37;
            padding: 30px;
            /* Reduced padding */
            border-radius: 15px;
            max-width: 600px;
            width: 90%;
            text-align: center;
            box-shadow: 0 0 30px rgba(212, 175, 55, .3);
            position: relative;
            /* Scroll handling */
            max-height: 95vh;
            overflow-y: auto;
            scrollbar-width: none;
            /* Firefox */
        }

        .rent-content::-webkit-scrollbar {
            display: none;
            /* Chrome/Safari */
        }

        .rent-content h3 {
            color: #d4af37;
            font-size: 1.6rem;
            /* Slightly smaller */
            margin-bottom: 15px;
            text-transform: uppercase
        }

        .rent-content p {
            color: #ccc;
            margin-bottom: 12px;
            font-size: 0.95rem;
            line-height: 1.5
        }

        .rent-content .price-box {
            background: rgba(255, 255, 255, .05);
            padding: 12px;
            /* Compact padding */
            border-radius: 10px;
            margin-bottom: 15px;
            text-align: left
        }

        .rent-content .price-box strong {
            color: #ffffff;
            display: block;
            margin-bottom: 10px;
            font-size: 1.1rem
        }

        .rent-content ul {
            list-style: none;
            padding: 0
        }

        .rent-content li {
            color: #ff3c3c;
            margin-bottom: 5px;
            display: flex;
            justify-content: space-between
        }

        .btn-yape {
            display: inline-block;
            background: #742774;
            color: #fff;
            padding: 12px 30px;
            border-radius: 25px;
            text-decoration: none;
            font-weight: 700;
            margin-top: 20px;
            transition: .3s;
            box-shadow: 0 0 15px rgba(116, 39, 116, .5)
        }

        .btn-yape:hover {
            background: #9b349b;
            transform: scale(1.05);
            box-shadow: 0 0 25px rgba(116, 39, 116, .8)
        }

        .close-rent {
            position: absolute;
            top: 15px;
            right: 20px;
            font-size: 2rem;
            color: #aaa;
            cursor: pointer;
            transition: .3s
        }

        .close-rent:hover {
            color: #ffffff
        }

        /* Botones Flotantes */
        .floating-controls {
            position: fixed;
            bottom: 30px;
            right: 30px;
            display: flex;
            flex-direction: column;
            gap: 20px;
            z-index: 2000
        }

        /* Z-Index alto para estar siempre visible */
        .ctrl-btn {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.4rem;
            cursor: pointer;
            transition: .3s;
            border: none;
            outline: none;
            box-shadow: 0 0 15px rgba(0, 0, 0, .7)
        }

        /* Botón Música */
        .music-btn {
            background: transparent;
            color: #d4af37;
            border: 3px solid #d4af37
        }

        .music-btn:hover {
            background: #d4af37;
            color: #000
        }

        .music-btn.playing {
            animation: pulse-music 2s infinite
        }

        @keyframes pulse-music {
            0% {
                box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7)
            }

            70% {
                box-shadow: 0 0 0 15px rgba(212, 175, 55, 0)
            }
        }

        /* Botón Volver Arriba */
        .top-btn {
            background: #ff3c3c;
            color: #fff;
            opacity: 0;
            pointer-events: none;
            transform: translateY(20px);
            transition: all 0.4s ease;
        }

        /* Esta clase se añade con JS para mostrar el botón */
        .top-btn.visible {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
        }

        .top-btn:hover {
            background: #ff5555;
            transform: translateY(-5px);
            box-shadow: 0 0 20px #ff3c3c
        }

        /* Social Left */
        .social-links {
            position: fixed;
            bottom: 30px;
            left: 30px;
            display: flex;
            flex-direction: column;
            gap: 15px;
            z-index: 100
        }

        .social-links a {
            width: 45px;
            height: 45px;
            background: rgba(255, 255, 255, .15);
            color: #fff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            font-size: 22px;
            transition: .3s;
            backdrop-filter: blur(5px)
        }

        .social-links a:hover {
            background: linear-gradient(135deg, #d4af37, #ffecb3);
            color: #000;
            transform: scale(1.1);
            box-shadow: 0 0 15px #d4af37, 0 0 30px #ffecb3
        }

        footer {
            text-align: center;
            padding: 25px 10px;
            color: #d4af37;
            font-size: .95rem;
            width: 100%;
            margin-top: 50px
        }

        @media(max-width:1200px) {
            .library-grid {
                grid-template-columns: repeat(3, 1fr);
                gap: 20px;
            }
        }

        @media(max-width:900px) {
            nav {
                display: none
            }

            

            header {
                padding: 15px 20px
            }

            section {
                padding: 100px 20px 60px
            }

            .library-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 15px;
            }

            .book-cover-container {
                height: 300px;
            }

            .rent-content {
                padding: 20px;
            }
        }

        @media(max-width:600px) {
            .library-grid {
                grid-template-columns: 1fr;
            }

            .book-cover-container {
                height: 400px;
            }
        }

        /* EFECTO DE SELECCIÓN MÁGICA */
        ::selection {
            background: rgba(106, 15, 15, 0.8);
            color: #ffffff;
            text-shadow: 0 0 5px #d4af37, 0 0 10px #d4af37, 0 0 20px #ffecb3;
        }

        ::-moz-selection {
            background: rgba(106, 15, 15, 0.8);
            color: #ffffff;
            text-shadow: 0 0 5px #d4af37, 0 0 10px #d4af37;
        }

        /* Estilo de la partícula mágica */
        .magic-star {
            position: fixed;
            pointer-events: none;
            background: #d4af37;
            width: 4px;
            height: 4px;
            border-radius: 50%;
            box-shadow: 0 0 10px #ffecb3;
            animation: fadeOut 1s linear forwards;
            z-index: 9999;
        }

        @keyframes fadeOut {
            0% {
                opacity: 1;
                transform: scale(1) translateY(0);
            }

            100% {
                opacity: 0;
                transform: scale(0) translateY(20px);
            }
        }

        

        

        /* Important: Override nav display for mobile */
        @media (max-width: 900px) {
            nav {
                display: none;
                /* Hide default nav */
            }

            

            .logo img {
                width: 35px;
                height: 35px
            }

            .logo span {
                font-size: 1.1rem
            }

            header {
                padding: 15px 20px;
                z-index: 3002;
                /* Ensure header is above menu */
            }
        }

        

        

        

        

        


        

        

        

        /* Submenu item active style */
        
    
/* SALVAGED CSS FROM HTML */
        /* Fix for Modal Overflow on small screens */
        .rent-content {
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            /* Ensure X button positioning is relative to this if inside, or keep separate */
        }
    

    

    


    

    

    