/* public_html/assets/themes/libreria/custom-premium.css */

/* ==========================================================================
   1. TOKENS & DESIGN SYSTEM (LIBRERÍA THEME)
   ========================================================================== */
:root {
    --bg-main: var(--color-paper, #ffffff);
    --bg-alt: var(--color-soft, #f8fafc);
    --text-main: var(--color-ink, #0f172a);
    --text-muted: var(--color-muted, #475569);
    --color-accent: var(--color-accent, #0f172a);
    --border-color: var(--color-line, #e2e8f0);
    --hero-overlay: linear-gradient(to bottom, rgba(255,255,255,0.4), rgba(255,255,255,1));
    --card-bg: var(--color-paper, #ffffff);
    --card-hover: var(--color-soft, #f8fafc);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 16px 36px rgba(15, 23, 42, 0.12);
    --btn-primary-bg: #0f172a;
    --btn-primary-text: #ffffff;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 980px;

    /* Theme Compatibility Aliases */
    --la-aurora-bg: var(--card-bg);
    --la-aurora-bg-alt: var(--bg-alt);
    --la-aurora-border: var(--border-color);
    --la-aurora-text: var(--text-main);
    --la-aurora-text-muted: var(--text-muted);
    --la-aurora-primary: var(--btn-primary-bg);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #090d16;
        --bg-alt: #111827;
        --text-main: #f8fafc;
        --text-muted: #cbd5e1;
        --color-accent: #38bdf8;
        --border-color: rgba(255,255,255,0.14);
        --hero-overlay: linear-gradient(to bottom, rgba(9,13,22,0.4), rgba(9,13,22,1));
        --card-bg: #111827;
        --card-hover: #1f2937;
        --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
        --shadow-hover: 0 16px 36px rgba(0,0,0,0.5);
        --btn-primary-bg: #ffffff;
        --btn-primary-text: #090d16;

        --la-aurora-bg: var(--card-bg);
        --la-aurora-bg-alt: var(--bg-alt);
        --la-aurora-border: var(--border-color);
        --la-aurora-text: var(--text-main);
        --la-aurora-text-muted: var(--text-muted);
        --la-aurora-primary: var(--btn-primary-bg);
    }
}

.dark-theme, body.dark-theme, [data-theme="dark"] {
    --bg-main: #090d16;
    --bg-alt: #111827;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --color-accent: #38bdf8;
    --border-color: rgba(255,255,255,0.14);
    --hero-overlay: linear-gradient(to bottom, rgba(9,13,22,0.4), rgba(9,13,22,1));
    --card-bg: #111827;
    --card-hover: #1f2937;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-hover: 0 16px 36px rgba(0,0,0,0.5);
    --btn-primary-bg: #ffffff;
    --btn-primary-text: #090d16;

    --la-aurora-bg: var(--card-bg);
    --la-aurora-bg-alt: var(--bg-alt);
    --la-aurora-border: var(--border-color);
    --la-aurora-text: var(--text-main);
    --la-aurora-text-muted: var(--text-muted);
    --la-aurora-primary: var(--btn-primary-bg);
}

body.libreria-theme {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container, .libreria-container, .block-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    box-sizing: border-box;
}

.theme-block-section, .block-section, .la-aurora-section {
    padding: 60px 0;
    width: 100%;
    box-sizing: border-box;
}

.theme-block-section.bg-alt, .block-section.bg-alt, .la-aurora-section.bg-alt {
    background-color: var(--bg-alt);
}

.section-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 36px auto;
}

/* ==========================================================================
   2. HEADER & NAVEGACIÓN STICKY
   ========================================================================== */
.libreria-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: background 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .libreria-header {
        background: rgba(9, 13, 22, 0.88);
    }
}
.dark-theme .libreria-header, body.dark-theme .libreria-header {
    background: rgba(9, 13, 22, 0.88);
}

.libreria-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.libreria-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.libreria-logo-img {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

.libreria-logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.libreria-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.libreria-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.libreria-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.libreria-nav a:hover {
    color: var(--text-main);
}

.libreria-btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-alt);
    color: var(--text-main) !important;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    transition: background 0.2s ease, transform 0.2s ease;
}

.libreria-btn-nav:hover {
    background: var(--card-hover);
    transform: translateY(-1px);
}

/* ==========================================================================
   3. HERO BANNER & SLIDER
   ========================================================================== */
.libreria-hero, .hero-banner, .la-aurora-hero {
    position: relative;
    padding: 80px 0 60px;
    text-align: center;
    background: var(--bg-main);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--hero-overlay);
    z-index: 1;
    pointer-events: none;
}

.hero-slide {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 20px;
}

.libreria-hero-title, .hero-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.2px;
    margin: 0 0 16px 0;
    color: var(--text-main) !important;
}

.libreria-hero-subtitle, .hero-subtitle {
    font-size: clamp(1.05rem, 2.2vw, 1.28rem);
    color: var(--text-muted) !important;
    opacity: 0.95;
    max-width: 680px;
    margin: 0 auto 36px;
    line-height: 1.6;
    font-weight: 500;
}

.libreria-btn, .btn-hero, .btn-primary, .hero-actions a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--btn-primary-bg) !important;
    color: var(--btn-primary-text) !important;
    padding: 14px 34px;
    border-radius: var(--radius-pill);
    font-weight: 700 !important;
    font-size: 1.02rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    opacity: 1 !important;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    .libreria-btn, .btn-hero, .btn-primary, .hero-actions a.btn {
        background: #ffffff !important;
        color: #090d16 !important;
        box-shadow: 0 6px 20px rgba(255, 255, 255, 0.22) !important;
    }
}
.dark-theme .libreria-btn, .dark-theme .btn-hero, .dark-theme .btn-primary, .dark-theme .hero-actions a.btn {
    background: #ffffff !important;
    color: #090d16 !important;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.22) !important;
}

.libreria-btn:hover, .btn-hero:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    opacity: 1 !important;
}

/* ==========================================================================
   4. GRILLA Y CARROUSEL DE LIBROS (ZERO-DB CARDS)
   ========================================================================== */
.libreria-section-title, .section-header h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 800;
    margin: 48px 0 24px;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.section-header p {
    color: var(--text-muted) !important;
    font-size: 1.05rem;
}

.carousel-slider-wrapper {
    position: relative;
    margin-bottom: 48px;
}

.carousel-slider-wrapper .slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg, #1e293b);
    color: var(--text-main, #ffffff);
    border: 1px solid var(--border-color, rgba(255,255,255,0.15));
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.9;
    padding: 0;
}

.carousel-slider-wrapper .slider-arrow:hover {
    opacity: 1;
    background: var(--accent, #3b82f6);
    color: #ffffff;
    border-color: var(--accent, #3b82f6);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(59,130,246,0.4);
}

.carousel-slider-wrapper .slider-arrow.prev {
    left: -22px;
}

.carousel-slider-wrapper .slider-arrow.next {
    right: -22px;
}

@media (max-width: 768px) {
    .carousel-slider-wrapper .slider-arrow {
        display: none !important;
    }
}

.as-slider, .books-grid, .libreria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 28px;
}

.carousel-slider-wrapper .as-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 24px;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.carousel-slider-wrapper .as-slider::-webkit-scrollbar {
    display: none;
}

/* Tarjeta Estilo Apple Books Card */
.libreria-card, .book-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.carousel-slider-wrapper .book-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
}

.libreria-card:hover, .book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(255,255,255,0.25);
    background: var(--card-hover);
}

.libreria-card-cover-wrapper, .book-cover-wrapper {
    position: relative;
    width: 100%;
    max-width: 160px;
    margin: 0 auto 16px;
}

.libreria-cover, .book-cover {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.2), -2px 0 4px inset rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.libreria-card:hover .libreria-cover, .book-card:hover .book-cover {
    transform: scale(1.03);
}

.libreria-card-title, .book-title {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--text-main, #ffffff);
    line-height: 1.35;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.libreria-card-title a, .book-title a {
    color: var(--text-main, #ffffff) !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.libreria-card-title a:hover, .book-title a:hover {
    color: var(--accent, #3b82f6) !important;
}

.libreria-card-author, .book-author {
    font-size: 0.88rem;
    color: var(--text-muted, #94a3b8) !important;
    margin: 0 0 10px 0;
}

.libreria-card-price, .book-price {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-main, #ffffff) !important;
    margin-top: auto;
}

/* ==========================================================================
   5. BARRA DE FILTROS Y BUSCADOR (CATÁLOGO) & QUIÉNES SOMOS
   ========================================================================== */
.libreria-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.libreria-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 10px 18px;
    flex: 1 1 280px;
}

.libreria-search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.libreria-search-box input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 0.95rem;
    width: 100%;
}

.libreria-pills-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.libreria-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.libreria-pill:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}

.libreria-pill.active {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-color: var(--btn-primary-bg);
}

.libreria-select-box select {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

/* Forzar legibilidad de párrafos en Quienes Somos y Rich Text */
.quienes-somos p, .custom-page-body p, .about-content p {
    color: var(--text-muted) !important;
    line-height: 1.6;
}
.quienes-somos h3, .custom-page-body h3, .about-content h3 {
    color: var(--text-main) !important;
}

/* ==========================================================================
   6. FICHA DE LIBRO SINGLE-BOOK
   ========================================================================== */
.libreria-single-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    align-items: flex-start;
}

.libreria-single-cover {
    flex: 1 1 300px;
    max-width: 380px;
}

.libreria-single-img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3), -3px 0 6px inset rgba(0,0,0,0.2);
    aspect-ratio: 2/3;
    object-fit: cover;
}

.libreria-single-details {
    flex: 2 1 400px;
}

.libreria-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.libreria-badge {
    display: inline-flex;
    align-items: center;
    background: var(--bg-alt);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.libreria-badge-accent {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
}

.libreria-single-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: -1px;
    line-height: 1.1;
    color: var(--text-main);
}

.libreria-single-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 400;
    margin: 0 0 16px;
    font-style: italic;
}

.libreria-single-author {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0 0 24px;
}

.libreria-single-author span {
    color: var(--text-main);
}

.libreria-single-price-box {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 24px;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--text-main);
}

.libreria-price-local {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.libreria-single-synopsis {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-main);
    margin-bottom: 32px;
}

.libreria-action-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.libreria-btn-lg {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.libreria-btn-secondary {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-main);
    padding: 14px 28px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.libreria-btn-secondary:hover {
    background: var(--bg-alt);
    border-color: var(--text-muted);
}

.libreria-share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.libreria-share-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.libreria-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-alt);
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.libreria-share-btn:hover {
    transform: scale(1.1);
    background: var(--card-hover);
}

/* Sticky Buy Bar Mobile */
.libreria-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    padding: 12px 0;
    z-index: 1100;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .libreria-sticky-bar {
        background: rgba(9, 13, 22, 0.95);
    }
}
.dark-theme .libreria-sticky-bar, body.dark-theme .libreria-sticky-bar {
    background: rgba(9, 13, 22, 0.95);
}

.libreria-sticky-bar.active {
    transform: translateY(0);
}

.libreria-sticky-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.libreria-sticky-title {
    font-weight: 700;
    font-size: 0.95rem;
    display: block;
    color: var(--text-main);

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.libreria-sticky-price {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.libreria-btn-sm {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* ==========================================================================
   7. FOOTER & MEDIA QUERIES
   ========================================================================== */
.libreria-footer {
    border-top: 1px solid var(--border-color);
    padding: 60px 0 40px;
    margin-top: 80px;
    background: var(--bg-alt);
}

.libreria-footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
    margin-bottom: 40px;
}

.libreria-footer-brand h4 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--text-main);
}

.libreria-footer-brand p {
    color: var(--text-muted);
    font-size: 0.92rem;
    max-width: 400px;
    line-height: 1.6;
    margin: 0;
}

.libreria-footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.libreria-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: color 0.2s ease;
}

.libreria-footer-links a:hover {
    color: var(--text-main);
}

.libreria-footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.libreria-footer-bottom a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
}

/* Micro-interacción Animación Scroll */
.fade-in-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Media Queries Responsivas Mobile-First */
@media (max-width: 768px) {
    .libreria-nav-toggle {
        display: block;
    }

    .libreria-nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-main);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 20px 24px;
        gap: 16px;
        align-items: flex-start;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }

    .libreria-nav.active {
        display: flex;
    }

    .libreria-single-wrapper {
        flex-direction: column;
        gap: 32px;
    }

    .libreria-single-cover {
        max-width: 100%;
        text-align: center;
    }

    .libreria-single-img {
        max-width: 260px;
        margin: 0 auto;
    }

    .as-slider, .books-grid, .libreria-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .libreria-card, .book-card {
        padding: 14px;
    }

    .libreria-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .libreria-search-box {
        width: 100%;
    }
}
