/* EMET DIGITAL LIBRARY - VERSIÓN ORO REFINADA FINAL 2026
   Ecosistema: Sensorial, Editorial y Legal-Safe
   Update: Advanced Cookie UX & Consent Architecture
   Responsable Legal: Edgar Francisco Ayala Herrera
*/

:root {
    --negro: #0C0C0C;
    --oro: #D4C6A8;
    --arena: #D8CDBB;
    --perla: #F8F5EF;
    --bronce: #8A6B4F;
    --fuente-titulos: 'Cinzel', serif;
    --fuente-editorial: 'Playfair Display', serif;
    --fuente-base: 'Montserrat', sans-serif;
    --transicion: 0.5s cubic-bezier(0.2, 0, 0.2, 1);
}

/* 1. CORE & RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    background-color: var(--negro); 
    color: var(--perla); 
    font-family: var(--fuente-base); 
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* 2. ESPACIADO EDITORIAL */
section { padding: 180px 0; }
@media (max-width: 850px) { section { padding: 100px 0; } }

.container { max-width: 1100px; margin: 0 auto; padding: 0 30px; }
.container-small { max-width: 700px; margin: 0 auto; padding: 0 30px; }

/* 3. TIPOGRAFÍA Y MICROCOPY EMOCIONAL */
h1, h2, h3, h4, .badge, .btn-primary, .ebook-number { 
    font-family: var(--fuente-titulos); 
    text-transform: uppercase; 
    letter-spacing: 5px; 
}

.quote, .book-name, .editorial-italic, .microcopy-emocional { 
    font-family: var(--fuente-editorial); 
    font-style: italic; 
    font-weight: 400;
}

.microcopy-emocional {
    display: block;
    font-size: 0.85rem;
    color: var(--arena);
    opacity: 0.6;
    margin-top: 10px;
}

.badge {
    font-size: 0.65rem;
    color: var(--bronce);
    margin-bottom: 30px;
    display: block;
    letter-spacing: 8px;
}

/* 4. GRID Y CARDS EDITORIALES */
.grid-editorial {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 120px 80px;
    margin-top: 80px;
}
@media (max-width: 850px) { .grid-editorial { grid-template-columns: 1fr; gap: 80px; } }

.ebook-visual-wrapper {
    width: 100%; aspect-ratio: 4 / 5;
    background: #121212; overflow: hidden;
    border: 1px solid rgba(212, 198, 168, 0.08);
    margin-bottom: 25px;
}

.ebook-visual-wrapper img {
    width: 100%; height: 100%; object-fit: cover;
    filter: grayscale(0.4) contrast(1.1);
    transition: 1.2s ease;
}
.ebook-card:hover img { transform: scale(1.05); filter: grayscale(0); }

/* 5. SISTEMA DE BOTONES Y CONSENTIMIENTO */
.btn-primary {
    background: var(--bronce);
    color: var(--negro);
    padding: 22px 60px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transicion);
    display: inline-block;
    text-align: center;
}
.btn-primary:hover:not(:disabled) { background: var(--oro); letter-spacing: 7px; transform: translateY(-3px); }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; filter: grayscale(1); }

.cta-suave {
    font-family: var(--fuente-titulos);
    font-size: 0.7rem;
    color: var(--bronce);
    text-decoration: none;
    border-bottom: 1px solid rgba(138, 107, 79, 0.3);
    padding-bottom: 5px;
    transition: var(--transicion);
}

/* CHECKBOX DE CHECKOUT */
.consent-wrapper {
    display: flex; align-items: flex-start; gap: 15px;
    margin-bottom: 30px; cursor: pointer;
}
.checkbox-custom {
    width: 18px; height: 18px; border: 1px solid var(--bronce);
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s; margin-top: 4px;
}
.consent-wrapper.active .checkbox-custom { background: var(--oro); border-color: var(--oro); }

/* 6. UX DE CONFIGURACIÓN DE COOKIES (ACTUALIZADA) */
#cookie-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%; max-width: 500px;
    background: #0F0F0F; border: 1px solid var(--bronce);
    padding: 50px; z-index: 10001; display: none;
    box-shadow: 0 40px 100px rgba(0,0,0,0.9);
}

.cookie-category {
    background: rgba(255,255,255,0.03);
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(212, 198, 168, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-info h5 {
    font-family: var(--fuente-titulos);
    font-size: 0.75rem;
    color: var(--oro);
    letter-spacing: 2px;
}

.cookie-info p {
    font-size: 0.65rem;
    color: var(--arena);
    opacity: 0.6;
    margin-top: 5px;
}

/* TOGGLE SWITCH EDITORIAL */
.toggle-switch {
    width: 40px; height: 20px;
    background: #222;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: 0.4s;
}
.toggle-switch.on { background: var(--bronce); }
.toggle-switch::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 14px; height: 14px; background: #fff;
    border-radius: 50%; transition: 0.3s;
}
.toggle-switch.on::after { left: 23px; }
.toggle-switch.disabled { cursor: not-allowed; opacity: 0.3; }

/* 7. FOOTER Y LEGAL */
.footer-legal {
    padding: 100px 0 50px;
    background: #050505;
    border-top: 1px solid rgba(212, 198, 168, 0.05);
    text-align: center;
    font-size: 0.7rem; color: rgba(216, 205, 187, 0.5);
}
.legal-links a { color: inherit; text-decoration: none; margin: 0 15px; }

/* 8. BARRA DE TOTAL Y BÓVEDA */
.summary-bar {
    position: fixed; bottom: 0; width: 100%;
    background: #080808; border-top: 1px solid var(--bronce);
    padding: 30px 0; z-index: 1000;
}

.download-card {
    display: grid; grid-template-columns: 50px 1fr 100px;
    align-items: center; padding: 25px 15px;
    border-bottom: 1px solid rgba(212, 198, 168, 0.1);
}
