/* ============================================================
   Los XII del Quijote - CSS Público
   ============================================================ */

/* --- Reset y base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Lato', 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    background: #faf9f6;
    line-height: 1.7;
}

a { color: #8B6914; text-decoration: none; transition: color 0.2s; }
a:hover { color: #c9a84c; }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }

/* --- Header --- */
.site-header {
    background: #1a1a1a;
    padding: 15px 0;
    border-bottom: 3px solid #8B6914;
}

.site-header .container { display: flex; align-items: center; justify-content: center; }

.logo {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #c9a84c;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.logo:hover { color: #e0c068; }

/* --- Hero --- */
.hero { padding: 60px 0; background: #fff; }

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 50px;
    align-items: center;
}

.hero-image { text-align: center; }

.book-cover {
    max-width: 320px;
    margin: 0 auto;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    border-radius: 2px;
    transition: transform 0.3s;
}
.book-cover:hover { transform: scale(1.02); }

.book-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.8rem;
    color: #1a1a1a;
    line-height: 1.2;
    margin-bottom: 8px;
}

.book-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.3rem;
    color: #8B6914;
    font-style: italic;
    margin-bottom: 5px;
}

.book-author {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 25px;
}

.book-price {
    margin-bottom: 25px;
}

.price-amount {
    font-size: 2.2rem;
    font-weight: 700;
    color: #8B6914;
}

.price-note {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-top: 4px;
}

.book-details {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.book-details p { font-size: 0.9rem; color: #666; margin-bottom: 3px; }

/* --- Sinopsis --- */
.sinopsis { padding: 60px 0; background: #faf9f6; }

.sinopsis h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 20px;
    text-align: center;
}

.sinopsis-contenido {
    max-width: 800px;
    margin: 0 auto;
}

.sinopsis-contenido p {
    margin-bottom: 15px;
    font-size: 1.05rem;
    color: #444;
    text-align: justify;
}

/* --- Sobre el autor --- */
.sobre-autor { padding: 60px 0; background: #fff; }

.autor-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    align-items: center;
    max-width: 850px;
    margin: 0 auto;
}

.autor-foto { text-align: center; }

.autor-imagen {
    max-width: 200px;
    margin: 0 auto;
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 4px solid #c9a84c;
}

.sobre-autor h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 30px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.autor-bio p {
    margin-bottom: 12px;
    font-size: 1.05rem;
    color: #444;
    line-height: 1.7;
}

/* --- Los doce genios --- */
.capitulos { padding: 60px 0; background: #faf9f6; }

.capitulos h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 35px;
    color: #1a1a1a;
}

.capitulos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.genio-card {
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    border: 2px solid #e8e2d0;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.genio-card:hover {
    border-color: #c9a84c;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}

.genio-imagen {
    width: 100%;
    background: #f5f0e8;
}

.genio-imagen img {
    width: 100%;
    height: auto;
    display: block;
}

.genio-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
}

.genio-num {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #8B6914;
    min-width: 28px;
}

.genio-nombre {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
}

.genio-banda {
    background: #1a1a1a;
    padding: 8px 14px;
    text-align: center;
}

.genio-lugar {
    display: block;
    font-size: 0.78rem;
    color: #c9a84c;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.genio-fechas {
    display: block;
    font-size: 0.72rem;
    color: #ccc;
    margin-top: 2px;
}

/* --- CTA Final --- */
.cta-final {
    padding: 60px 0;
    background: #1a1a1a;
    text-align: center;
}

.cta-final h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    color: #c9a84c;
    margin-bottom: 10px;
}

.cta-final p {
    color: #ccc;
    margin-bottom: 25px;
    font-size: 1.05rem;
}

/* --- Botones --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #8B6914;
    color: #fff;
}
.btn-primary:hover { background: #a07a1a; color: #fff; }

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}
.btn-secondary:hover { background: #d0d0d0; }

.btn-large { padding: 15px 40px; font-size: 1.1rem; }
.btn-block { display: block; width: 100%; }

/* --- Checkout --- */
.checkout { padding: 50px 0; }

.checkout h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    margin-bottom: 30px;
    color: #1a1a1a;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 40px;
    align-items: start;
}

.checkout-form h2, .checkout-summary h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.form-group { margin-bottom: 15px; }
.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #444;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #8B6914;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-note {
    font-size: 0.85rem;
    color: #888;
    margin-top: 15px;
    text-align: center;
}

/* --- Summary card --- */
.summary-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 25px;
    position: sticky;
    top: 20px;
}

.summary-cover {
    width: 100px;
    margin: 0 auto 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.summary-card h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 3px;
}

.summary-author {
    text-align: center;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 20px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid #f0f0f0;
}

.summary-total {
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: none;
    padding-top: 12px;
    color: #8B6914;
}

.summary-iva {
    text-align: right;
    font-size: 0.8rem;
    color: #999;
    margin-top: 5px;
}

/* --- Pago resultado --- */
.pago-resultado { padding: 80px 0; }

.resultado-icon {
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    font-size: 2.5rem;
    margin: 0 auto 20px;
    font-weight: bold;
}

.resultado-ok { background: #e8f5e9; color: #2e7d32; }
.resultado-error { background: #fce4ec; color: #c62828; }

.pago-resultado h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    margin-bottom: 15px;
}

.resultado-detalle {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin: 20px auto;
    max-width: 500px;
    text-align: left;
}
.resultado-detalle p { margin-bottom: 5px; font-size: 0.95rem; }

.resultado-acciones { margin-top: 25px; }
.resultado-acciones .btn { margin: 0 8px; }

/* --- Redirect spinner --- */
.pago-redirect { padding: 80px 0; }
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #8B6914;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Alert --- */
.alert {
    padding: 12px 18px;
    border-radius: 3px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.alert-error { background: #fce4ec; color: #c62828; border: 1px solid #f8bbd0; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }

/* --- Footer --- */
.site-footer {
    background: #1a1a1a;
    color: #999;
    text-align: center;
    padding: 25px 0;
    font-size: 0.85rem;
    border-top: 3px solid #8B6914;
}
.site-footer p { margin-bottom: 3px; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-image { order: -1; }
    .book-cover { max-width: 250px; }
    .book-title { font-size: 2rem; }
    .autor-grid { grid-template-columns: 1fr; text-align: center; }
    .checkout-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .capitulos-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .capitulos-grid { grid-template-columns: repeat(2, 1fr); }
    .book-title { font-size: 1.6rem; }
    .price-amount { font-size: 1.8rem; }
}

/* --- Cuenta atrás / Lanzamiento --- */
.lanzamiento-box {
    margin: 20px 0;
    text-align: center;
}

.lanzamiento-texto {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.3rem;
    color: #8B6914;
    font-weight: 700;
    margin-bottom: 15px;
}

.cuenta-atras {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.cuenta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1a1a1a;
    color: #c9a84c;
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 60px;
}

.cuenta-valor {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.cuenta-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-top: 4px;
}

.cuenta-sep {
    font-size: 1.5rem;
    font-weight: 700;
    color: #8B6914;
    padding: 0 2px;
}

/* --- Dedicatoria en formulario de compra --- */
.dedicatoria-group {
    margin-top: 20px;
    padding: 20px;
    border: 2px dashed #c9a84c;
    border-radius: 8px;
    background: #fdf8ee;
}

.dedicatoria-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dedicatoria-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8B6914;
    cursor: pointer;
    flex-shrink: 0;
}

.dedicatoria-check label {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    margin-bottom: 0;
}

.dedicatoria-gratis {
    font-weight: 400;
    color: #2e7d32;
    font-size: 0.9rem;
}

.dedicatoria-campos {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0d5b8;
}

.dedicatoria-campos .form-group {
    margin-bottom: 12px;
}

.dedicatoria-campos textarea {
    resize: vertical;
    min-height: 70px;
}

/* --- Cupón en formulario de compra --- */
.cupon-group {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.cupon-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cupon-input-row input {
    flex: 1;
}

.cupon-input-row .btn {
    white-space: nowrap;
    padding: 10px 20px;
}

.cupon-mensaje {
    display: block;
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.cupon-ok { color: #2e7d32; }
.cupon-error { color: #c62828; }

.cupon-descuento-line span:last-child {
    color: #2e7d32;
    font-weight: 700;
}

/* --- Responsive cuenta atrás --- */
@media (max-width: 600px) {
    .cuenta-item {
        padding: 8px 10px;
        min-width: 50px;
    }
    .cuenta-valor { font-size: 1.4rem; }
    .lanzamiento-texto { font-size: 1.1rem; }
}

/* --- Footer enlaces legales --- */
.footer-legal {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 12px;
}

.footer-legal a {
    color: #999;
    font-size: 0.82rem;
    transition: color 0.2s;
}

.footer-legal a:hover {
    color: #c9a84c;
}

/* --- Páginas legales --- */
.legal-page {
    padding: 50px 0 60px;
    background: #fff;
}

.legal-page .container {
    max-width: 850px;
}

.legal-page h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.2rem;
    color: #1a1a1a;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #8B6914;
}

.legal-page h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.4rem;
    color: #1a1a1a;
    margin-top: 30px;
    margin-bottom: 12px;
}

.legal-page p {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 12px;
    text-align: justify;
    line-height: 1.7;
}

.legal-page ul,
.legal-page ol {
    margin: 10px 0 15px 25px;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.7;
}

.legal-page li {
    margin-bottom: 6px;
}

.legal-page a {
    color: #8B6914;
    text-decoration: underline;
}
.legal-page a:hover {
    color: #c9a84c;
}

.legal-page .legal-date {
    margin-top: 35px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #999;
    text-align: right;
}

/* --- Tabla de cookies --- */
.cookies-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0 20px;
    font-size: 0.9rem;
}

.cookies-table th,
.cookies-table td {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: top;
}

.cookies-table th {
    background: #f5f0e8;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cookies-table td {
    color: #444;
}

/* --- Banner de cookies --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    color: #ccc;
    padding: 18px 25px;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    display: none;
}

.cookie-banner.visible {
    display: block;
}

.cookie-banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-banner p {
    font-size: 0.88rem;
    line-height: 1.5;
    flex: 1;
    margin: 0;
}

.cookie-banner a {
    color: #c9a84c;
    text-decoration: underline;
}

.cookie-banner-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn-accept {
    background: #8B6914;
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}

.cookie-btn-accept:hover {
    background: #a07a1a;
}

.cookie-btn-reject {
    background: transparent;
    color: #999;
    border: 1px solid #555;
    padding: 10px 24px;
    font-size: 0.9rem;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.cookie-btn-reject:hover {
    border-color: #999;
    color: #ccc;
}

/* --- Responsive páginas legales --- */
@media (max-width: 768px) {
    .legal-page h1 { font-size: 1.7rem; }
    .legal-page h2 { font-size: 1.2rem; }
    .cookies-table { font-size: 0.8rem; }
    .cookies-table th, .cookies-table td { padding: 7px 8px; }
    .cookie-banner-inner { flex-direction: column; text-align: center; }
    .footer-legal { gap: 6px 15px; }
}

/* --- Sección Librerías (formulario de contacto) --- */
.librerias {
    padding: 60px 0;
    background: #fff;
}

.librerias h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 15px;
    text-align: center;
}

.librerias-intro {
    max-width: 700px;
    margin: 0 auto 30px;
    font-size: 1.05rem;
    color: #444;
    text-align: center;
    line-height: 1.7;
}

.libreria-form {
    max-width: 650px;
    margin: 0 auto;
    background: #faf9f6;
    padding: 30px;
    border-radius: 6px;
    border: 1px solid #e8e2d0;
}

.libreria-form .form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #444;
}

.libreria-form .form-group input[type="text"],
.libreria-form .form-group input[type="tel"],
.libreria-form .form-group input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    font-family: inherit;
    transition: border-color 0.2s;
}

.libreria-form .form-group input:focus {
    outline: none;
    border-color: #8B6914;
}

.privacidad-check label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: #444;
    cursor: pointer;
    line-height: 1.5;
}

.privacidad-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8B6914;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.privacidad-check a {
    color: #8B6914;
    text-decoration: underline;
}

.privacidad-check a:hover {
    color: #c9a84c;
}

.librerias .alert {
    max-width: 650px;
    margin: 0 auto 20px;
}

/* --- Responsive librerías --- */
@media (max-width: 768px) {
    .libreria-form {
        padding: 20px;
    }
    .libreria-form .form-row {
        grid-template-columns: 1fr;
    }
}
