/*
Theme Name: LibrosGratis Pro
Theme URI: https://librosgratis.es
Author: LibrosGratis Team
Author URI: https://librosgratis.es
Description: Tema profesional para biblioteca digital de libros en dominio público. Sistema completo de descargas, favoritos, reseñas, colecciones temáticas y monetización con afiliados.
Version: 4.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: librosgratis
Tags: books, library, digital-library, education, literature, affiliates

LibrosGratis Pro WordPress Theme
Copyright 2024 LibrosGratis.es
*/

/* ==========================================================================
   Variables CSS - Paleta Profesional
   ========================================================================== */
:root {
    /* Colores principales - Tonos tierra elegantes */
    --lg-primary: #8B4513;
    --lg-primary-dark: #5D2E0C;
    --lg-primary-light: #A0522D;
    --lg-primary-rgb: 139, 69, 19;
    
    /* Secundarios */
    --lg-secondary: #1E2A38;
    --lg-secondary-light: #2C3E50;
    --lg-accent: #C9A227;
    --lg-accent-light: #E8C547;
    
    /* Colores semánticos */
    --lg-success: #059669;
    --lg-warning: #D97706;
    --lg-error: #DC2626;
    --lg-info: #0284C7;
    
    /* Fondos */
    --lg-bg-cream: #FDFBF7;
    --lg-bg-paper: #F8F5F0;
    --lg-bg-white: #FFFFFF;
    --lg-bg-dark: #0F172A;
    --lg-bg-card: #FFFFFF;
    
    /* Textos */
    --lg-text-dark: #1F2937;
    --lg-text-medium: #4B5563;
    --lg-text-light: #6B7280;
    --lg-text-muted: #9CA3AF;
    --lg-text-white: #FFFFFF;
    
    /* Bordes y sombras */
    --lg-border: #E5E7EB;
    --lg-border-dark: #D1D5DB;
    --lg-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --lg-shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --lg-shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --lg-shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --lg-shadow-hover: 0 8px 25px rgba(0,0,0,0.15);
    --lg-shadow-glow: 0 0 20px rgba(139, 69, 19, 0.15);
    
    /* Tipografía premium */
    --lg-font-heading: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --lg-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --lg-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Espaciado */
    --lg-spacing-xs: 0.5rem;
    --lg-spacing-sm: 1rem;
    --lg-spacing-md: 1.5rem;
    --lg-spacing-lg: 2rem;
    --lg-spacing-xl: 3rem;
    --lg-spacing-2xl: 4rem;
    
    /* Bordes redondeados */
    --lg-radius-sm: 6px;
    --lg-radius-md: 10px;
    --lg-radius-lg: 16px;
    --lg-radius-xl: 24px;
    --lg-radius-full: 9999px;
    
    /* Transiciones */
    --lg-transition-fast: 150ms ease;
    --lg-transition: 250ms ease;
    --lg-transition-slow: 400ms ease;
    
    /* Colores de afiliados */
    --lg-amazon: #FF9900;
    --lg-amazon-dark: #E88800;
    --lg-casadellibro: #E31837;
    --lg-casadellibro-dark: #C41530;
    --lg-fnac: #E4A800;
    --lg-fnac-dark: #C89200;
}

/* ==========================================================================
   Reset y Base
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--lg-font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--lg-text-dark);
    background-color: var(--lg-bg-cream);
}

/* ==========================================================================
   Tipografía Premium
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--lg-font-heading);
    font-weight: 600;
    line-height: 1.25;
    margin-top: 0;
    color: var(--lg-secondary);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 1rem 0;
}

a {
    color: var(--lg-primary);
    text-decoration: none;
    transition: color var(--lg-transition-fast);
}

a:hover {
    color: var(--lg-primary-dark);
}

/* ==========================================================================
   Layout Principal
   ========================================================================== */
.lg-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--lg-spacing-md);
}

.lg-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.lg-col {
    padding: 0 15px;
}

.lg-col-12 { width: 100%; }
.lg-col-9 { width: 75%; }
.lg-col-8 { width: 66.666%; }
.lg-col-6 { width: 50%; }
.lg-col-4 { width: 33.333%; }
.lg-col-3 { width: 25%; }

/* ==========================================================================
   Componentes: Botones
   ========================================================================== */
.lg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--lg-font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: var(--lg-radius-md);
    cursor: pointer;
    transition: all var(--lg-transition);
    text-decoration: none;
    white-space: nowrap;
}

.lg-btn:focus {
    outline: 2px solid var(--lg-primary);
    outline-offset: 2px;
}

.lg-btn-primary {
    background: linear-gradient(135deg, var(--lg-primary) 0%, var(--lg-primary-dark) 100%);
    color: var(--lg-text-white);
    border-color: var(--lg-primary);
}

.lg-btn-primary:hover {
    background: linear-gradient(135deg, var(--lg-primary-dark) 0%, var(--lg-primary) 100%);
    transform: translateY(-2px);
    box-shadow: var(--lg-shadow-md);
    color: var(--lg-text-white);
}

.lg-btn-outline {
    background: transparent;
    color: var(--lg-primary);
    border-color: var(--lg-primary);
}

.lg-btn-outline:hover {
    background: var(--lg-primary);
    color: var(--lg-text-white);
}

.lg-btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.lg-btn-favorite-active {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    border-color: #EF4444;
}

/* ==========================================================================
   Header
   ========================================================================== */
.lg-header {
    background: var(--lg-bg-white);
    box-shadow: var(--lg-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.lg-header-top {
    background: var(--lg-secondary);
    color: var(--lg-text-white);
    padding: var(--lg-spacing-xs) 0;
    font-size: 0.8125rem;
}

.lg-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--lg-spacing-sm) 0;
}

.lg-logo {
    display: flex;
    align-items: center;
    gap: var(--lg-spacing-sm);
}

.lg-logo img {
    max-height: 50px;
    width: auto;
}

.lg-logo-text {
    font-family: var(--lg-font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--lg-primary);
}

.lg-logo-text span {
    color: var(--lg-secondary);
}

/* ==========================================================================
   Breadcrumbs Mejorados
   ========================================================================== */
.lg-breadcrumbs {
    padding: var(--lg-spacing-md) 0;
    font-size: 0.875rem;
    background: var(--lg-bg-paper);
    border-bottom: 1px solid var(--lg-border);
}

.lg-breadcrumbs .lg-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.lg-breadcrumbs a {
    color: var(--lg-text-medium);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lg-breadcrumbs a:hover {
    color: var(--lg-primary);
}

.lg-breadcrumb-sep {
    color: var(--lg-text-muted);
    font-size: 0.75rem;
    margin: 0 4px;
}

.lg-breadcrumb-current {
    color: var(--lg-text-dark);
    font-weight: 500;
}

/* ==========================================================================
   Single Libro - Header Principal
   ========================================================================== */
.lg-single-libro {
    padding: var(--lg-spacing-xl) 0;
}

.lg-single-libro-header {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--lg-spacing-xl);
    margin-bottom: var(--lg-spacing-xl);
}

/* Portada con efecto libro */
.lg-single-libro-cover {
    position: relative;
}

.lg-cover-wrapper {
    position: relative;
    border-radius: var(--lg-radius-md);
    overflow: hidden;
    box-shadow: 
        var(--lg-shadow-lg),
        0 0 40px rgba(0,0,0,0.12);
    transform: perspective(1000px) rotateY(-3deg);
    transition: transform var(--lg-transition);
}

.lg-cover-wrapper:hover {
    transform: perspective(1000px) rotateY(0deg);
}

.lg-cover-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.lg-cover-shine {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        110deg,
        transparent 35%,
        rgba(255,255,255,0.15) 45%,
        rgba(255,255,255,0.25) 50%,
        rgba(255,255,255,0.15) 55%,
        transparent 65%
    );
    pointer-events: none;
}

.lg-public-domain-badge {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--lg-success) 0%, #047857 100%);
    color: white;
    padding: 6px 16px;
    border-radius: var(--lg-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--lg-shadow-md);
    white-space: nowrap;
}

/* Detalles del libro */
.lg-single-libro-details {
    padding-top: var(--lg-spacing-sm);
}

.lg-libro-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--lg-spacing-sm);
}

.lg-libro-badge {
    background: var(--lg-bg-paper);
    color: var(--lg-text-medium);
    padding: 4px 12px;
    border-radius: var(--lg-radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid var(--lg-border);
    transition: all var(--lg-transition-fast);
}

.lg-libro-badge:hover {
    background: var(--lg-primary);
    color: white;
    border-color: var(--lg-primary);
}

.lg-libro-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: var(--lg-spacing-sm);
    color: var(--lg-secondary);
    line-height: 1.2;
}

.lg-single-libro-author {
    font-size: 1.125rem;
    margin-bottom: var(--lg-spacing-md);
}

.lg-author-label {
    color: var(--lg-text-light);
}

.lg-author-name {
    color: var(--lg-primary);
    font-weight: 500;
}

.lg-author-name:hover {
    text-decoration: underline;
}

/* Stats */
.lg-single-libro-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lg-spacing-md);
    margin-bottom: var(--lg-spacing-md);
}

.lg-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--lg-text-medium);
}

.lg-stars {
    color: var(--lg-accent);
}

.lg-rating-value {
    font-weight: 700;
    color: var(--lg-text-dark);
}

.lg-rating-count {
    color: var(--lg-text-light);
    font-size: 0.875rem;
}

/* Meta pills */
.lg-single-libro-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: var(--lg-spacing-lg);
}

.lg-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--lg-bg-paper);
    padding: 8px 14px;
    border-radius: var(--lg-radius-full);
    font-size: 0.875rem;
    color: var(--lg-text-medium);
    border: 1px solid var(--lg-border);
}

.lg-meta-pill i {
    color: var(--lg-primary);
    font-size: 0.8125rem;
}

/* ==========================================================================
   Sección de Descarga
   ========================================================================== */
.lg-download-section {
    background: linear-gradient(135deg, var(--lg-bg-paper) 0%, var(--lg-bg-white) 100%);
    border: 2px solid var(--lg-border);
    border-radius: var(--lg-radius-lg);
    padding: var(--lg-spacing-lg);
    margin-bottom: var(--lg-spacing-lg);
}

.lg-download-title {
    font-size: 1.125rem;
    margin-bottom: var(--lg-spacing-md);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--lg-secondary);
}

.lg-download-title i {
    color: var(--lg-success);
}

.lg-download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.lg-download-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: var(--lg-radius-md);
    font-weight: 600;
    color: white;
    transition: all var(--lg-transition);
    text-decoration: none;
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

.lg-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--lg-shadow-md);
    color: white;
}

.lg-download-btn i {
    font-size: 1.25rem;
}

.lg-download-format {
    font-weight: 700;
}

.lg-download-action {
    font-size: 0.8125rem;
    opacity: 0.9;
}

.lg-download-pdf {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}

.lg-download-epub {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.lg-download-mobi {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
}

/* ==========================================================================
   Acciones del libro
   ========================================================================== */
.lg-libro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ==========================================================================
   Contenido Principal
   ========================================================================== */
.lg-single-libro-content {
    margin-top: var(--lg-spacing-lg);
}

.lg-content-card {
    background: var(--lg-bg-white);
    border-radius: var(--lg-radius-lg);
    padding: var(--lg-spacing-xl);
    margin-bottom: var(--lg-spacing-lg);
    box-shadow: var(--lg-shadow);
}

.lg-content-card h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--lg-spacing-lg);
    padding-bottom: var(--lg-spacing-md);
    border-bottom: 2px solid var(--lg-border);
}

.lg-content-card h2 i {
    color: var(--lg-primary);
}

.lg-prose {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--lg-text-medium);
}

.lg-prose p:first-child::first-letter {
    font-family: var(--lg-font-heading);
    font-size: 3.5rem;
    float: left;
    line-height: 0.8;
    margin-right: 12px;
    margin-top: 8px;
    color: var(--lg-primary);
}

/* ==========================================================================
   ⭐ SECCIÓN DE AFILIADOS - ESTILOS PRINCIPALES
   ========================================================================== */
.lg-affiliate-section {
    background: linear-gradient(135deg, #FEF7ED 0%, #FFF7ED 50%, #FFFBF5 100%);
    border: 2px solid #FDE68A;
    border-radius: var(--lg-radius-lg);
    padding: var(--lg-spacing-xl);
    margin: var(--lg-spacing-xl) 0;
    position: relative;
    overflow: hidden;
}

.lg-affiliate-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(201, 162, 39, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.lg-affiliate-header {
    display: flex;
    align-items: flex-start;
    gap: var(--lg-spacing-md);
    margin-bottom: var(--lg-spacing-lg);
}

.lg-affiliate-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--lg-accent) 0%, var(--lg-accent-light) 100%);
    border-radius: var(--lg-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: var(--lg-shadow);
}

.lg-affiliate-header-text h3 {
    margin: 0 0 4px 0;
    font-size: 1.375rem;
    color: var(--lg-secondary);
}

.lg-affiliate-header-text p {
    margin: 0;
    color: var(--lg-text-medium);
    font-size: 0.9375rem;
}

/* Grid de tarjetas de afiliados */
.lg-affiliate-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--lg-spacing-md);
    margin-bottom: var(--lg-spacing-lg);
}

.lg-affiliate-card {
    background: var(--lg-bg-white);
    border-radius: var(--lg-radius-md);
    padding: var(--lg-spacing-md);
    display: flex;
    align-items: center;
    gap: var(--lg-spacing-md);
    text-decoration: none;
    transition: all var(--lg-transition);
    border: 2px solid var(--lg-border);
    position: relative;
    overflow: hidden;
}

.lg-affiliate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    transition: width var(--lg-transition);
}

.lg-affiliate-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--lg-shadow-lg);
    border-color: transparent;
}

.lg-affiliate-card:hover::before {
    width: 100%;
    opacity: 0.08;
}

/* Colores por plataforma */
.lg-affiliate-amazon::before { background: var(--lg-amazon); }
.lg-affiliate-amazon:hover { border-color: var(--lg-amazon); }
.lg-affiliate-amazon .lg-affiliate-card-logo { color: var(--lg-amazon); }

.lg-affiliate-casadellibro::before { background: var(--lg-casadellibro); }
.lg-affiliate-casadellibro:hover { border-color: var(--lg-casadellibro); }
.lg-affiliate-casadellibro .lg-affiliate-card-logo { color: var(--lg-casadellibro); }

.lg-affiliate-fnac::before { background: var(--lg-fnac); }
.lg-affiliate-fnac:hover { border-color: var(--lg-fnac); }
.lg-affiliate-fnac .lg-affiliate-card-logo { color: var(--lg-fnac); }

.lg-affiliate-card-logo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.lg-affiliate-card-info {
    flex: 1;
}

.lg-affiliate-card-name {
    display: block;
    font-weight: 600;
    color: var(--lg-text-dark);
    font-size: 1rem;
    margin-bottom: 2px;
}

.lg-affiliate-card-action {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--lg-text-light);
}

.lg-affiliate-card:hover .lg-affiliate-card-action {
    color: var(--lg-primary);
}

/* Aviso de afiliación */
.lg-affiliate-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(139, 69, 19, 0.06);
    border-radius: var(--lg-radius-md);
    font-size: 0.8125rem;
    color: var(--lg-text-medium);
}

.lg-affiliate-notice i {
    color: var(--lg-primary);
}

/* Versión compacta de afiliados */
.lg-affiliate-compact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--lg-spacing-sm);
}

.lg-affiliate-compact-label {
    font-weight: 600;
    color: var(--lg-text-medium);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lg-affiliate-compact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lg-affiliate-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--lg-radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--lg-text-dark);
    background: var(--lg-bg-paper);
    border: 1px solid var(--lg-border);
    transition: all var(--lg-transition-fast);
}

.lg-affiliate-link:hover {
    background: var(--affiliate-color, var(--lg-primary));
    color: white;
    border-color: var(--affiliate-color, var(--lg-primary));
}

/* Botones de afiliados */
.lg-affiliate-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lg-btn-affiliate {
    padding: 10px 20px;
}

.lg-btn-amazon {
    background: var(--lg-amazon);
    border-color: var(--lg-amazon);
    color: #111;
}

.lg-btn-amazon:hover {
    background: var(--lg-amazon-dark);
}

.lg-btn-casadellibro {
    background: var(--lg-casadellibro);
    border-color: var(--lg-casadellibro);
    color: white;
}

.lg-btn-fnac {
    background: var(--lg-fnac);
    border-color: var(--lg-fnac);
    color: #111;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.lg-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--lg-spacing-lg);
}

.lg-sticky-sidebar {
    position: sticky;
    top: 100px;
}

.lg-widget {
    background: var(--lg-bg-white);
    border-radius: var(--lg-radius-lg);
    padding: var(--lg-spacing-lg);
    box-shadow: var(--lg-shadow);
}

.lg-widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    margin: 0 0 var(--lg-spacing-md) 0;
    padding-bottom: var(--lg-spacing-sm);
    border-bottom: 2px solid var(--lg-border);
    color: var(--lg-secondary);
}

.lg-widget-title i {
    color: var(--lg-primary);
}

/* Widget compra */
.lg-widget-buy {
    background: linear-gradient(135deg, #FEF7ED 0%, #FFFFFF 100%);
    border: 2px solid #FDE68A;
}

/* Widget autor */
.lg-autor-card {
    text-align: center;
}

.lg-autor-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: var(--lg-spacing-sm);
    border: 3px solid var(--lg-border);
}

.lg-autor-name {
    margin: 0 0 8px 0;
    font-size: 1.125rem;
}

.lg-autor-bio {
    font-size: 0.875rem;
    color: var(--lg-text-medium);
    margin-bottom: var(--lg-spacing-md);
}

/* Widget técnico */
.lg-tech-list {
    margin: 0;
}

.lg-tech-list dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--lg-text-light);
    margin-bottom: 4px;
}

.lg-tech-list dd {
    margin: 0 0 var(--lg-spacing-sm) 0;
    font-weight: 500;
    color: var(--lg-text-dark);
}

/* Libros relacionados */
.lg-related-books {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lg-related-book {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: var(--lg-radius-md);
    transition: background var(--lg-transition-fast);
}

.lg-related-book:hover {
    background: var(--lg-bg-paper);
}

.lg-related-book img {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: var(--lg-radius-sm);
    box-shadow: var(--lg-shadow-sm);
}

.lg-related-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lg-related-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--lg-text-dark);
    line-height: 1.3;
    margin-bottom: 4px;
}

.lg-related-author {
    font-size: 0.8125rem;
    color: var(--lg-text-light);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.lg-footer {
    background: var(--lg-secondary);
    color: var(--lg-text-white);
    margin-top: var(--lg-spacing-2xl);
}

.lg-footer-main {
    padding: var(--lg-spacing-2xl) 0;
}

.lg-footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--lg-spacing-xl);
}

.lg-footer-widget h4 {
    color: var(--lg-accent);
    margin-bottom: var(--lg-spacing-md);
    font-size: 1.1rem;
}

.lg-footer-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lg-footer-widget li {
    margin-bottom: var(--lg-spacing-xs);
}

.lg-footer-widget a {
    color: rgba(255,255,255,0.8);
}

.lg-footer-widget a:hover {
    color: var(--lg-accent);
}

.lg-footer-bottom {
    background: rgba(0,0,0,0.2);
    padding: var(--lg-spacing-md) 0;
    text-align: center;
    font-size: 0.875rem;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.lg-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.lg-modal.is-open {
    display: flex;
}

.lg-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.lg-modal-content {
    position: relative;
    background: var(--lg-bg-white);
    padding: var(--lg-spacing-xl);
    border-radius: var(--lg-radius-lg);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--lg-shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

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

.lg-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--lg-text-light);
    line-height: 1;
    transition: color var(--lg-transition-fast);
}

.lg-modal-close:hover {
    color: var(--lg-text-dark);
}

.lg-modal-content h3 {
    margin: 0 0 var(--lg-spacing-lg) 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Share buttons */
.lg-share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: var(--lg-spacing-lg);
}

.lg-share-btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--lg-radius-md);
    color: white;
    font-weight: 500;
    transition: all var(--lg-transition-fast);
}

.lg-share-btn-social:hover {
    transform: translateY(-2px);
    color: white;
}

.lg-share-facebook { background: #1877F2; }
.lg-share-twitter { background: #000; }
.lg-share-whatsapp { background: #25D366; }
.lg-share-telegram { background: #0088CC; }
.lg-share-email { background: var(--lg-text-medium); }

.lg-share-url {
    display: flex;
    gap: 10px;
}

.lg-share-url input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--lg-border);
    border-radius: var(--lg-radius-md);
    font-size: 0.875rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
    .lg-single-libro-header {
        grid-template-columns: 220px 1fr;
    }
    
    .lg-affiliate-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .lg-footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .lg-single-libro-header {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .lg-single-libro-cover {
        max-width: 220px;
        margin: 0 auto var(--lg-spacing-lg);
    }
    
    .lg-cover-wrapper {
        transform: none;
    }
    
    .lg-libro-genres,
    .lg-single-libro-stats,
    .lg-single-libro-meta,
    .lg-libro-actions {
        justify-content: center;
    }
    
    .lg-download-buttons {
        flex-direction: column;
    }
    
    .lg-download-btn {
        width: 100%;
    }
    
    .lg-affiliate-grid {
        grid-template-columns: 1fr;
    }
    
    .lg-row {
        flex-direction: column;
    }
    
    .lg-col-8,
    .lg-col-4 {
        width: 100%;
    }
    
    .lg-sidebar {
        margin-top: var(--lg-spacing-xl);
    }
    
    .lg-sticky-sidebar {
        position: static;
    }
    
    .lg-footer-widgets {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .lg-share-buttons {
        grid-template-columns: 1fr;
    }
    
    .lg-affiliate-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
}

/* ==========================================================================
   Utilidades
   ========================================================================== */
.lg-text-center { text-align: center; }
.lg-text-right { text-align: right; }
.lg-mt-1 { margin-top: var(--lg-spacing-sm); }
.lg-mt-2 { margin-top: var(--lg-spacing-md); }
.lg-mt-3 { margin-top: var(--lg-spacing-lg); }
.lg-mb-1 { margin-bottom: var(--lg-spacing-sm); }
.lg-mb-2 { margin-bottom: var(--lg-spacing-md); }
.lg-mb-3 { margin-bottom: var(--lg-spacing-lg); }
.lg-hidden { display: none !important; }

/* Print styles */
@media print {
    .lg-header,
    .lg-footer,
    .lg-sidebar,
    .lg-btn,
    .lg-download-buttons,
    .lg-affiliate-section,
    .lg-libro-actions {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}
