/* Contenedor principal de escritorio */
.desktop-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Navbar superior de escritorio */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 10px;
}
.brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}
.header-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}
#search-input {
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    outline: none;
    width: 250px;
}
#category-filter {
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    outline: none;
}
#theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
}

/* Hero Section */
.hero-section {
    width: 100%;
    height: 350px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 20px;
    margin: 20px 0 40px 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.5);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
}
.hero-content h1 {
    font-size: 3rem;
    color: white;
    text-shadow: 0 5px 15px rgba(0,0,0,0.9);
    letter-spacing: -1px;
}

/* Grid de Libros estilo Kindle */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    padding: 20px 0;
}
.book-card {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    aspect-ratio: 2 / 3;
    position: relative;
}
.book-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.book-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}

/* Efecto de resplandor sutil en hover (Premium) */
.book-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 50%, rgba(0,0,0,0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}
.book-card:hover::after {
    opacity: 1;
}

/* Pop-up (Modal) para Escritorio genérico */
.modal, #book-modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--modal-bg);
    backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.modal.active, #book-modal.active {
    display: flex;
    opacity: 1;
}
.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    display: flex;
    gap: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.modal.active .modal-content, #book-modal.active .modal-content {
    transform: scale(1);
}
.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-cover {
    flex: 0 0 300px;
    width: 300px;
    height: 450px; /* Fijar alto para mantener proporción 2:3 */
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
.modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.modal-category {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}
.modal-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.1;
}
.modal-desc {
    color: #aaa;
    margin-bottom: 30px;
    font-size: 1.1rem;
}
[data-theme="light"] .modal-desc { color: #555; }
