@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@400;500;600&display=swap');

:root {
    --primary:#1648B9;
    --primary-dark:#143d9e;
    --primary-light: #fff3e8;
    --star-gold:#2a65ec;
    --text:#1a1a1a;
    --text-muted:#6b7280;
    --bg:#ffffff;
    --border:#e5e7eb;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }

.notifications-container {
    display: none !important;
}

/* ── HERO ── */
.hero {
    position: relative;
    padding: 6rem 2rem;
    background: linear-gradient(135deg, #fffcf9 0%, #ffffff 100%);
    overflow: hidden;
    min-height: 85vh;
    display: flex;
    align-items: center;
}

.hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(235,126,37,0.08) 0%, transparent 50%);
}

.hero-container {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-title .accent { color: var(--primary); font-style: italic; }

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 2.5rem;
}

/* BUSCADOR HERO */
.hero-search {
    display: flex;
    background: white;
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    max-width: 550px;
    margin-bottom: 3rem;
    border: 1px solid var(--border);
}

.hero-search input {
    flex: 1;
    border: none;
    padding: 0.8rem 1rem;
    outline: none;
    font-size: 1rem;
}

.hero-search button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.hero-search button:hover { background: var(--primary-dark); }

/* ESTILOS Y ANIMACIÓN DE ESTRELLAS REALES EN EL HERO */
.cosmic-hero {
    background: radial-gradient(circle at 50% 30%, rgba(22, 72, 185, 0.05) 0%, transparent 70%);
}

.cosmic-star {
    position: absolute;
    color: var(--primary);
    opacity: 0.45;
    pointer-events: none;
    z-index: 1;
    animation: twinkleRealStars 3.5s ease-in-out infinite alternate;
}

/* Posiciones y tamaños variados para cada estrella */
.cosmic-star.s1 { top: 12%; left: 8%; font-size: 0.9rem; animation-delay: 0s; }
.cosmic-star.s2 { top: 20%; right: 10%; font-size: 0.7rem; animation-delay: 1.2s; }
.cosmic-star.s3 { top: 65%; left: 6%; font-size: 0.8rem; animation-delay: 0.6s; }
.cosmic-star.s4 { top: 75%; right: 12%; font-size: 1rem; animation-delay: 1.8s; }
.cosmic-star.s5 { top: 35%; left: 4%; font-size: 0.6rem; animation-delay: 2.4s; }
.cosmic-star.s6 { top: 45%; right: 6%; font-size: 0.85rem; animation-delay: 0.9s; }
.cosmic-star.s7 { top: 8%; left: 42%; font-size: 0.75rem; animation-delay: 1.5s; }
.cosmic-star.s8 { top: 82%; left: 38%; font-size: 0.9rem; animation-delay: 2.1s; }
.cosmic-star.s9 { top: 30%; left: 18%; font-size: 0.5rem; animation-delay: 0.3s; }

@keyframes twinkleRealStars {
    0% { 
        opacity: 0.2; 
        transform: scale(0.8) rotate(0deg); 
    }
    50% { 
        opacity: 0.85; 
        transform: scale(1.15) rotate(10deg); 
    }
    100% { 
        opacity: 0.3; 
        transform: scale(0.9) rotate(-10deg); 
    }
}

/* STATS */
.hero-stats { display: flex; gap: 3rem; }
.stat .num { display: block; font-size: 2rem; font-weight: 700; color: var(--primary); font-family: 'Playfair Display', serif; }
.stat .lab { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }

/* BOOK STACK ANIMATION */
.hero-visual-side { position: relative; }
.book-stack { position: relative; height: 400px; }

.floating-book {
    position: absolute;
    width: 180px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    animation: float 6s ease-in-out infinite;
    animation-delay: calc(var(--i) * -1.5s);
}

.floating-book img { width: 100%; display: block; }

.floating-book:nth-child(1) { top: 10%; left: 0; z-index: 3; }
.floating-book:nth-child(2) { top: 30%; left: 40%; z-index: 2; width: 160px; }
.floating-book:nth-child(3) { top: 0%; left: 60%; z-index: 1; width: 140px; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

/* ── CONTENT SECTION ── */
.content-section { max-width: 1300px; margin: 4rem auto; padding: 0 2rem; }

.section-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
}

.section-top h2 { font-family: 'Playfair Display', serif; font-size: 2rem; }
.tag { color: var(--primary); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; display: block; margin-bottom: 0.5rem; }

.view-all { color: var(--primary); text-decoration: none; font-weight: 600; transition: 0.3s; }
.view-all:hover { margin-right: -5px; padding-right: 5px; }

/* BOOKS GRID */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2rem;
}

.home-book-card { transition: 0.3s; }
.card-img {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.card-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }

.card-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.3s;
}

.home-book-card:hover .card-overlay { opacity: 1; }
.home-book-card:hover .card-img img { transform: scale(1.1); }

.btn-quick {
    background: white; color: var(--text); padding: 0.6rem 1.2rem;
    border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 0.85rem;
}

.card-info .genre { font-size: 0.7rem; color: var(--primary); font-weight: 700; text-transform: uppercase; }
.card-info h3 { font-size: 1rem; margin: 0.3rem 0; font-weight: 600; }
.card-info .author { font-size: 0.85rem; color: var(--text-muted); }

/* GENRES STRIP */
.genres-section { background: var(--primary-light); padding: 4rem 0; }
.genres-pills { display: flex; flex-wrap: wrap; gap: 1rem; }

.genre-item {
    background: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    transition: 0.3s;
    border: 1px solid var(--border);
}

.genre-item:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(235,126,37,0.1);
}

/* FOOTER */
.main-footer { text-align: center; padding: 3rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.9rem; }

.editorial-marquee-container {
    overflow: hidden;
    white-space: nowrap;
    background: var(--primary);
    border-top: 1px solid var(--primary-dark);
    border-bottom: 1px solid var(--primary-dark);
    padding: 1.2rem 0;
    position: relative;
    margin: 3rem 0;
    box-shadow: 0 4px 12px rgba(22, 72, 185, 0.15);
}

.marquee-track {
    display: inline-flex;
    gap: 3rem;
    animation: scrollMarquee 25s linear infinite;
}

.marquee-item {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brand-icon {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

@keyframes scrollMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (max-width: 900px) {
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-search, .hero-subtitle { margin-left: auto; margin-right: auto; }
    .hero-visual-side { display: none; }
    .hero-stats { justify-content: center; }
}

@media (max-width: 768px) {

    .hero {
        padding: 3rem 1rem;
        min-height: auto;
        text-align: center;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-badge {
        font-size: 0.7rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }

    .hero-search {
        margin: 0 auto 2rem auto;
        width: 100%;
    }

    .hero-stats {
        justify-content: center;
        gap: 1.5rem;
    }

    .stat .num {
        font-size: 1.6rem;
    }

    .stat .lab {
        font-size: 0.7rem;
    }

    .hero-visual-side {
        display: none !important;
    }

    .content-section {
        margin: 2rem auto;
        padding: 0 0 0 1rem; 
        overflow: hidden;
    }

    .section-top {
        padding-right: 1rem;
        margin-bottom: 1.5rem;
    }

    .section-top h2 {
        font-size: 1.6rem;
    }

    .view-all {
        font-size: 0.85rem;
    }

    .books-grid {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important; 
        scroll-snap-type: x mandatory !important; 
        gap: 1.2rem !important;
        padding: 10px 0 !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch; 
    }

    .books-grid::-webkit-scrollbar {
        display: none !important;
    }

    .book-card-link {
        flex: 0 0 85% !important; 
        scroll-snap-align: start !important;
        box-sizing: border-box;
    }

    .home-book-card {
        width: 100% !important;
        margin: 0 !important;
    }

    .card-img {
        box-shadow: 0 6px 16px rgba(0,0,0,0.08);
        margin-bottom: 0.8rem;
    }

    .card-overlay {
        display: none !important;
    }

    .card-info h3 {
        font-size: 1.05rem;
    }

    .genres-section {
        padding: 2.5rem 0;
    }

    .genres-pills {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 0.8rem !important;
        padding: 5px 0 15px 0 !important;
        -webkit-overflow-scrolling: touch;
    }

    .genres-pills::-webkit-scrollbar {
        display: none !important;
    }

    .genre-item {
        flex: 0 0 auto !important;
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .main-footer {
        padding: 2rem 1rem;
        font-size: 0.85rem;
    }
}
