/* ============================================================
   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-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    align-items: center;
}

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

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

.book-back {
    max-width: 350px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 2px;
}

/* --- Capítulos --- */
.capitulos { padding: 60px 0; background: #fff; }

.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(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.capitulo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #faf9f6;
    border-left: 3px solid #8B6914;
    border-radius: 2px;
    transition: background 0.2s;
}
.capitulo-item:hover { background: #f0ece0; }

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

.capitulo-nombre { font-size: 0.95rem; color: #333; }

/* --- 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; }
    .sinopsis-grid { grid-template-columns: 1fr; }
    .checkout-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .capitulos-grid { grid-template-columns: 1fr 1fr; }
}

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