/* ============================= */
/* 0. VARIABLES Y RESET BÁSICO */
/* ============================= */

/* Paleta de Colores de Gerson Serna */
:root {
    --color-principal: #4A4A4A;      /* Gris Oscuro (Texto) */
    --color-acento: #FFFF00;         /* Amarillo Brillante (CTA) */
    --color-cta-muy-claro: #dadada;      /* Verde suave para CTA tipo "Add to cart" */
    --color-acento-hover: #E6E600;   /* Amarillo un poco más oscuro */
    --color-fondo-claro: #FFFFFF;    /* Blanco */
    --color-fondo-oscuro: #313131;   /* Gris Carbón (Header/Footer) */
    --color-secundario: #A1A1A1;     /* Gris Principal (Líneas/Bordes) */
}

/* Base y Tipografía: usando Montserrat desde Google Fonts */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--color-principal);
    background-color: var(--color-fondo-claro);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Utility: Screen-reader only (accessible labels) */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* Focus styles for keyboard users: show only lateral (left/right) yellow bars */
a:focus, button:focus, input:focus, textarea:focus {
    outline: none; /* remove default outline */
    /* two inset shadows to create left and right vertical bars */
    box-shadow: inset 1px 0 0 var(--color-acento), inset -1px 0 0 var(--color-acento);
    padding: 0px var(--focus-h, 20px) 0px var(--focus-h, 20px); /* horizontal padding follows active section */
    transition: box-shadow 160ms ease;
}

/* Remove focus outline from favorite button */
.favorite:focus {
    outline: none;
    box-shadow: none;
}

/* Slightly stronger bars for keyboard focus-visible (modern browsers) */
:focus-visible {
    box-shadow: inset 5px 0 0 var(--color-acento), inset -5px 0 0 var(--color-acento);
}


/* Placeholder text: ensure it uses Montserrat like the rest of the site */
input::placeholder,
textarea::placeholder,
select::placeholder,
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
select::-webkit-input-placeholder,
input:-ms-input-placeholder,
textarea:-ms-input-placeholder,
select:-ms-input-placeholder {
    font-family: 'Montserrat', sans-serif;
    color: rgba(0,0,0,0.45); /* subtle default color, overridden by theme where needed */
}

h1, h2, h3 {
    font-weight: 700; 
    color: var(--color-fondo-oscuro);
}

section {
    padding: 80px 5%;
}

/* ============================= */
/* 1. HEADER Y NAVEGACIÓN */
/* ============================= */

.main-header {
    background-color: var(--color-fondo-oscuro);
    color: var(--color-fondo-claro);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Línea amarilla inferior en el header */
.main-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: var(--color-acento);
    z-index: 100;
}

/* Header theme: when a section requires a yellow header (ej. upcoming) */
.main-header.theme-yellow {
    background-color: var(--color-acento);
    color: var(--color-fondo-oscuro);
    transition: background-color 240ms ease, color 240ms ease;
}
.main-header.theme-yellow::after {
    /* make the thin line darker to keep contrast */
    background: rgba(0,0,0,0.06);
}
.main-header.theme-yellow .main-nav a {
    color: var(--color-fondo-oscuro) !important;
}
.main-header.theme-yellow .main-nav a.active {
    color: var(--color-fondo-oscuro) !important;
    font-weight: 800 !important;
}

.brand {
    color: var(--color-fondo-claro);
    font-size: 1.3rem;
    font-weight: 700;
}

/* Logo centrado y superpuesto */
.logo-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -75px; /* ajusta para empotrar sobre la línea del header */
    color: rgba(255,255,255,0.92);
    padding: 56px 5% 28px;
    border-top: 1px solid rgba(255,255,255,0.03);
    z-index: 1100;
}

.logo-center-img {
        width: 100px;
        height: 100px;
        margin: 0 auto;
        display: grid;
        /* Map | Contact form | Contact & Social */
        grid-template-columns: 1.4fr 1fr 1fr;
        gap: 32px;
        align-items: start;
        align-content: start;
    color: var(--color-secundario);
    margin-left: 20px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.main-nav {
    display: flex;
    gap: 40px;
    height: 80px;
    align-items: center;
    position: relative; /* para posicionar el logo respecto al menú */
}

.main-header .logo-img {
    height: auto;
    display: block;
    transform: scale(2);
}

/* Hamburger menu button (hidden on desktop) */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
    color: var(--color-fondo-claro);
}
.menu-toggle .hamburger { display: inline-block; width: 28px; height: 18px; position: relative; }
.menu-toggle .bar { display: block; height: 2px; background: var(--color-fondo-claro); margin: 5px 0; border-radius: 2px; }

/* Responsive: switch to hamburger at tablet/mobile widths */
@media (max-width: 1024px) {
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .main-nav { 
        position: fixed;
        right: 0;
        top: 64px;
        height: calc(100% - 64px);
        width: 260px;
        background: var(--color-fondo-oscuro);
        flex-direction: column;
        gap: 0;
        padding: 20px;
        transform: translateX(100%);
        transition: transform 240ms ease;
        align-items: start;
        z-index: 1200;
    }
    .main-nav.open { transform: translateX(0); }
    .main-nav a { display: block; width: 100%; padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,0.03); }
}

/* Active nav link: always use accent color unless header theme overrides it */

    /* Make header logo smaller (50%) when hamburger menu is active on smaller screens */
    .main-header .logo-img,
    .main-header .logo img {
        width: 100%;
        max-width: 100px;
        height: auto;
        display: block;
        margin-left: 50px;
    }
.main-nav a.active {
    color: var(--color-acento) !important;
    transition: color 180ms ease;
}

@media (max-width: 800px){
    .main-header .logo-img,
    .main-header .logo img {
        max-width: 60px;
        margin-left: 30px;
    }
}

/* Nav: ensure no underlines and Montserrat font */
.main-nav a,
.main-nav a:link,
.main-nav a:visited,
.main-nav a:hover,
.main-nav a:focus {
    font-family: 'Montserrat', sans-serif;
    text-decoration: none !important;
    color: inherit; /* keep color flow, .active overrides */
}

/* Ensure hover/focus don't reintroduce underlines */
.main-nav a:hover,
.main-nav a:focus {
    text-decoration: none !important;
}

.hero {
    background-color: var(--color-fondo-oscuro); /* Gris Principal de fondo */
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 40px 5%;
}

.hero-image {
    max-width: 800px;
    width: 100%;
    padding-right: 25px;
}


.hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--color-cta-muy-claro);
}

.hero h5 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--color-acento);
}

.hero h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--color-cta-muy-claro);
}

.hero h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--color-acento);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--color-cta-muy-claro);
}

/* Botones de CTA */
.btn-primary, .btn-secondary, .btn-whatsapp {
    text-decoration: none;
    font-weight: 700;
    padding: 12px 25px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: inline-block;
    border: 2px solid transparent;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-acento);
    color: var(--color-fondo-oscuro);
}

.btn-primary:hover {
    background-color: var(--color-acento-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-fondo-oscuro);
    border-color: var(--color-fondo-oscuro);
}

.btn-secondary:hover {
    background-color: var(--color-fondo-oscuro);
    color: var(--color-fondo-claro);
}

/* ============================= */
/* 3. SECCIÓN AUTOR (FLEXBOX) */
/* ============================= */

.autor-section {
    flex-direction: row-reverse;
    background-color: var(--color-cta-muy-claro);
    display: flex;
    gap: 20px; /* reducir espacio entre foto y texto */
    align-items: center;
}

    .autor-photo {
        order: -1; /* force image to render first (left) */
        flex: 0 0 320px; /* tamaño fijo más razonable para equilibrio */
        width: 320px;
        max-width: 100%;
        height: auto;
        object-fit: cover;
        margin: 0; /* eliminamos márgenes grandes, usamos gap/padding en su lugar */
        border-radius: 12px;
        transform-origin: left center;
        transform: none; /* no extreme scaling to keep balance */
        transition: transform .28s ease;
    }

.autor-content{
    font-size: 1rem;
    margin-bottom: 16px;
    margin-left: 24px; /* reducir separación con la foto */
    margin-right: 24px;
    color: var(--color-fondo-oscuro);
}

/* Desktop: place author photo on the left and text on the right */
@media (min-width: 769px) {
    .autor-section {
        flex-direction: row-reverse; /* image appears visually first (left) */
        text-align: left;
    }
    .autor-photo {
        order: 0;
        max-width: 400px;
        width: 100%;
    }
    .autor-content { order: 1; }
}

.autor-content {
    flex-grow: 1;
    overflow: hidden;
}

/* Versión móvil: apilar elementos */
@media (max-width: 768px) {
    .autor-section {
        flex-direction: column;
        text-align: center;
    }

    /* En pantallas pequeñas apilamos hero: imagen encima del texto y centrado */
    .hero-inner {
        grid-template-columns: 1fr;
        padding: 24px 5%;
    }

    .hero-text {
        text-align: center;
        align-items: center;
        margin: 0 auto;
    }
    /* Autor: limitar foto en móvil y centrarla */
    .autor-photo {
        width: 220px;
        max-width: 80%;
        height: auto;
        margin: 12px auto 8px auto;
        order: -1; /* mantener imagen por encima del texto en móvil */
    }

    .autor-content { margin-left: 12px; margin-right: 12px; padding: 8px 6px; }

    /* For small screens ensure autor content can take full width and text scales down */
    .autor-content {
        max-width: 100% !important;
        width: auto !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .autor-content h2 { font-size: 1.4rem; }
    .autor-content p { font-size: 0.98rem; line-height: 1.5; }
}

/* ============================= */
/* 4. SECCIÓN LIBROS (CSS GRID - RESPONSIVE) */
/* ============================= */

#libros {
    text-align: center;
    background-color: var(--color-acento);
}

.libros-grid {
    display: grid;
    gap: 30px;
    max-width: 1200px;
    margin: 80px auto 0;
    grid-template-columns: 1fr; /* Móvil: una columna */
    align-items: start; /* permitir que elementos dentro de la grid se superpongan hacia arriba */
    justify-items: center; /* centrar las cards dentro de la grid */
}

.libro-card {
    background-color: var(--color-fondo-claro);
    border: 1px solid var(--color-secundario);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.libro-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.libro-portada {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
    border-radius: 4px;
}

/* ============================= */
/* Tarjeta de libro (estilo tarjeta de producto) */
/* ============================= */
.book-card {
    background: #ffffff;
    border-radius: 12px;
    /* dejar más espacio arriba para la portada que sobresale */
    padding: 22px 22px 22px;
    box-shadow: 0 10px 30px rgba(27, 37, 36, 0.06);
    max-width: 360px; /* ancho máximo razonable para cada card */
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    position: relative;
    overflow: visible; /* permitir que la portada sobresalga */
}

.card-media {
    position: relative;
    display: flex;
    justify-content: center;
    margin-top: -72px; /* desplazar el contenedor hacia arriba para que la portada sobresalga */
    pointer-events: none; /* evita que el área sobresaliente capture clicks no deseados */
}

.card-cover {
    width: 140px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.12);
    transform: translateY(-8px);
    z-index: 20;
    position: relative; /* permitir z-index */
    pointer-events: auto; /* permitir clicks sobre la imagen si es necesario */
}

.favorite {
    position: absolute;
    right: 6px;
    top: 6px;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: #d1d1d1;
    cursor: pointer;
    transition: color 200ms ease;
    outline: none;
}

.favorite:hover {
    color: #ff6b6b;
}

.favorite.liked {
    color: #ff6b6b;
}

.favorite.liked i {
    font-weight: 900;
}

.favorite:focus {
    outline: none;
    box-shadow: none;
}

.card-body {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px; /* más espacio entre elementos del cuerpo de la card */
}

.card-title {
    font-size: 1.05rem;
    margin: 0 0 6px 0;
    color: var(--color-fondo-oscuro);
}

.card-author {
    margin: 0 0 10px 0;
    color: var(--color-secundario);
    font-size: 0.9rem;
}

.card-price {
    font-weight: 700;
    margin: 0 0 14px 0;
}

.card-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center; /* centrar botones dentro de la card */
    margin-top: 16px; /* aumentar separación entre el contenido y las acciones */
}

.btn-cta {
    background-color: var(--color-fondo-oscuro);
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-width: 180px; /* mantener botones consistentes */
}

.btn-cta:hover {
    opacity: 0.95;
}

/* Botón WhatsApp */
.btn-whatsapp {
    background-color: var(--color-acento);
    color: var(--color-fondo-oscuro);
    margin-top: auto; 
    width: 100%;
    text-align: center;
    margin-top: 20px;
}

.btn-whatsapp:hover {
    background-color: var(--color-acento-hover);
}

/* Tabletas: Dos columnas */
@media (min-width: 600px) {
    .libros-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Más separación entre cards en pantallas pequeñas y tablets */
@media (max-width: 900px) {
    .libros-grid { gap: 80px; }
}

@media (max-width: 600px) {
    .libros-grid { gap: 80px; padding-left: 6%; padding-right: 6%; }
    .book-card { max-width: 420px; }
}


/* Normalizamos las reglas duplicadas de .autor-content para evitar márgenes enormes */
.autor-content { order: 0; flex: 1; padding-left: 12px; max-width: calc(100% - 360px); }
    .autor-content h2 { font-size: 1.6rem; margin-top: 0; color: var(--color-fondo-oscuro); }
    .autor-content p { color: rgba(0,0,0,0.75); font-size: 1rem; line-height: 1.6; }

/* Escritorio: Tres columnas */
@media (min-width: 1024px) {
    @media (min-width: 1024px) {
        .libros-grid {
            grid-template-columns: repeat(3, 1fr);
        }
    }
    .autor-content { order: 0; flex: 1; }
}

/* Próximo lanzamiento section styling (fixed syntax) */
.upcoming-section {
    background-color: var(--color-secundario); /* Amarillo brillante */
    color: var(--color-fondo-oscuro);
    text-align: center;
    padding-top: 40px;
    padding-bottom: 200px;
}

/* Estructura interna: preview del libro + contador */
.upcoming-inner {
    display: grid;
    grid-template-columns: 1fr; /* single column, centered */
    gap: 12px;
    align-items: start;
    justify-items: center; /* center the preview card */
    max-width: 900px;
    margin: 60px auto 0;
    padding: 0 5%;
}

/* Header del bloque de próximo lanzamiento: título a la izquierda, contador a la derecha */
.upcoming-header {
    display: flex;
    flex-direction: column; /* Título arriba y contador debajo */
    align-items: center;
    text-align: center;
    max-width: 1100px;
    margin: 24px auto 2px;
    padding: 0 5%;

}

.upcoming-title { text-align: center; }
.upcoming-title h2 { margin: 0; font-size: 1.6rem; color: var(--color-fondo-oscuro); }
.upcoming-title p { margin: 0px 0 0 0; color: rgba(0,0,0,0.65); }

.upcoming-countdown { display: flex; align-items: center; justify-content: center; }

@media (max-width: 900px) {
    .upcoming-header { gap: 10px; }
    .upcoming-inner { margin-top: 18px; }
}

.upcoming-preview {
    background: #d1d1d121; /* fondo blanco sólido (sin transparencia) */
    border-radius: 12px;
    /* centered single-column card */
    width: 100%;
    max-width: 820px;
    padding: 90px 52px 52px; /* espacio superior para portada sobresaliente (móvil/pequeñas) */
    position: relative;
    text-align: left;
    border: 1px solid var(--color-acento);
    margin-top: 50px;
    margin-right: -200px;
}

.preview-media {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.preview-cover {
    width: 500px;
    border-radius: 0; /* remover border-radius para imagen rectangular */
    display: block;
    background-color: transparent; /* permitir que la portada mantenga transparencia */
}

/* Desktop: mostrar la preview en dos columnas (imagen izquierda, texto derecha) */
@media (min-width: 900px) {
    .upcoming-inner { /* mantener centrado pero permitir card más ancha */
        max-width: 1100px;
        margin: 40px auto 0;
        padding: 0 5%;
    }

    .upcoming-preview {
        /* eliminar el espacio superior reservado para la portada sobresaliente */
        padding: 32px 32px;
        position: static; /* permitir que el contenido fluya en grid */
        display: grid;
        grid-template-columns: 320px 1fr; /* imagen a la izquierda, textos a la derecha */
        gap: 28px;
        align-items: center;
        max-width: 1000px;
        margin-top: 24px;
    }

    /* In desktop keep the image in the left column but let it overlap upward
       so it visually sits over the preview while leaving the text column unobstructed */
    .preview-media {
        position: relative;
        left: auto;
        left: -280px; /* overlapping effect without covering the text column */
        transform: none;
        justify-self: start;
        align-self: start;
        display: block;
        z-index: 20;
    }

    .preview-cover {
        width: 300%;
        max-width: 600px;
        height: auto;
        background-color: transparent; /* mantener la transparencia del PNG */
    }

    .preview-info {
        margin-top: 0; /* eliminar margen superior que existía por el overlay */
    }

    .preview-actions { text-align: left; }
}

.preview-info {
    margin-top: 14px;
}

.preview-title {
    margin-top: 18px;
    font-size: 1.4rem;
}

.preview-excerpt {
    margin: 10px 0 14px 0;
}

.preview-actions { text-align: center; margin-top: 8px; }

.upcoming-countdown { display:flex; align-items:center; justify-content:center; }

/* Re-color del contador sobre fondo amarillo */
.countdown .count-item .num { color: var(--color-fondo-oscuro); }
.countdown .count-item .label { color: rgba(0,0,0,0.65); }

/* Ajustes del botón en preview */
.preview-actions .btn-cta { min-width: 220px; }

@media (max-width: 900px) {
    .upcoming-inner { grid-template-columns: 1fr; gap: 20px; margin-top: 200px; }
    /* give the preview more top padding so the cover doesn't overlap the header/countdown */
    .upcoming-preview { padding: 110px 18px 24px; max-width: 100%; margin-right: 0; margin-bottom: -100px;}
    /* reduce the upward overlap of the cover so it doesn't touch the countdown */
    .preview-media { position: absolute; left: 50%; transform: translateX(-50%); top: -40px; z-index: 30; }
    .preview-cover { max-width: 360px; width: auto; display: block; margin-top: -200px; }
    .preview-cover img { display: block; }
    /* ensure the text block is fully below the cover and has breathing room */
    .preview-info { padding-top: 18px; width: 100%; margin: 0 auto; }
    /* ensure the countdown stays visually above any accidental overlap */
    .upcoming-countdown { position: relative; z-index: 40; }
    .preview-title { font-size: 1.15rem; }
    .preview-excerpt { font-size: 0.95rem; line-height: 1.5; }
    .preview-actions .btn-cta { width: 100%; justify-content: center; }
    .upcoming-section { padding-top: 24px; }
}

/* ============================= */
/* Contador de lanzamiento */
/* ============================= */
.countdown-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin: 20px auto 0;
}

.countdown {
    display: flex;
    gap: 18px;
    justify-content: center;
    align-items: center;
    background: #E6E600;
    padding: 18px 22px;
    border-radius: 12px;
}

.count-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 68px;
}

.count-item .num {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-fondo-claro);
    display: block;
}

.count-item .label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
}

.preorder-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #1f1f1f; /* alternativa para contraste sobre el gris */
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
}

.preorder-btn[aria-disabled="true"] {
    opacity: 0.6;
    pointer-events: none;
}

@media (max-width: 600px) {
    .countdown {
        gap: 12px;
        padding: 12px;
    }
    .count-item .num {
        font-size: 1.6rem;
    }
}

/* ============================= */
/* SECCIÓN ASESORÍA – DARK MODE */
/* ============================= */

.asesoria-section {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 24px;
    background-color: var(--color-principal);
    padding: 56px 5%;
}

/* Imagen */
.asesoria-photo {
    order: -1;
    flex: 0 0 320px;
    width: 320px;
    max-width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 14px;
    margin: 0;
}

/* Contenido */
.asesoria-content {
    flex-grow: 1;
    color: #ffffff;
    font-size: 1rem;
    margin-left: 24px;
    margin-right: 24px;
}

/* Títulos */
.asesoria-content h2 {
    color: #ffffff;
    margin-bottom: 14px;
    font-size: 2.6rem;
}

.asesoria-content p {
    color: #e5e5e5;
    margin-bottom: 18px;
    line-height: 1.65;
}

/* ============================= */
/* GRID INTERNO */
/* ============================= */

.asesoria-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 28px;
}

/* Cards */
/* ============================= */
/* AJUSTES INTERNOS DE LAS CARDS */
/* ============================= */

.asesoria-box {
    display: flex;
    flex-direction: column;
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 24px;
}

/* Título centrado */
.asesoria-box h3 {
    text-align: center;
    color: #ffffff;
}

.asesoria-box ul {
    margin-left: 4px;
    margin-right: 4px;
}

/* CTA centrado */
.asesoria-box .cta-button {
    align-self: center;
    margin-top: auto;
}

/* Opcional: separación visual */
.asesoria-box .cta-button {
    margin-top: 20px;
}


/* Firma */
.asesoria-firma {
    margin-top: 28px;
    font-size: 0.95rem;
    color: #cccccc;
}

/* ============================= */
/* DESKTOP */
/* ============================= */

@media (min-width: 769px) {
    .asesoria-section {
        flex-direction: row-reverse;
        text-align: center;
    }

    .asesoria-photo {
        order: 0;
        max-width: 560px;
        width: 100%;
    }

    .asesoria-content {
        order: 1;
    }
}

/* ============================= */
/* MOBILE */
/* ============================= */

@media (max-width: 768px) {
    .asesoria-section {
        flex-direction: column;
        text-align: center;
        padding: 40px 6%;
    }

    .asesoria-photo {
        width: 240px;
        max-width: 85%;
        margin: 0 auto 16px auto;
        order: -1;
    }

    .asesoria-content {
        margin: 0;
        max-width: 100%;
        overflow-wrap: break-word;
    }

    .asesoria-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .asesoria-content h2 {
        font-size: 1.45rem;
    }

    .asesoria-content p {
        font-size: 1rem;
    }

    .asesoria-box {
        max-width: 100%;
        box-sizing: border-box;
        word-break: break-word;
    }

    .asesoria-box ul li {
        margin-bottom: 10px;
        word-break: break-word;
    }

    .asesoria-box .btn-primary {
        display: block;
        width: 100%;
        text-align: center;
    }
}





/* ============================= */
/* SUSCRIPCION */
/* ============================= */

.launch-details {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 30px;
    padding: 30px;
    background-color: #FFFF00;
    border-radius: 8px;
    gap: 80px;
}

.launch-details-section {
    color: #fff;
    padding: 48px 5%;
}
.launch-details-inner {
    background: var(--color-acento-);
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 84px;
}

.subscribe-form {
    display: flex;
    gap: 10px;
    max-width: 400px;
    width: 100%;
    background-color: #FFFF00;
}

.subscribe-form input {
    padding: 10px;
    border: 1px solid var(--color-secundario);
    border-radius: 4px;
    flex-grow: 1;
}

.subscribe-form .btn-whatsapp {
    width: auto;
    margin: 0;
}

@media (max-width: 768px) {
    .launch-details {
        flex-direction: column;
    }
    .subscribe-form {
        flex-direction: column;
    }
}

/* ============================= */
/* FOOTER */
/* ============================= */

.main-footer {
    background: linear-gradient(180deg, var(--color-fondo-oscuro) 0%, #1f1f1f 100%);
    color: rgba(255,255,255,0.88);
    padding: 48px 5% 24px;

    /* CLAVE: estructura vertical sólida */
    display: flex;
    flex-direction: column;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.footer-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.footer-logo-center {
    width: 360px;
    max-width: 100%;
}

.footer-logo-secondary {
    max-width: 160px;
    width: 100%;
    margin-top: 10px;
}

.footer-contact p {
    margin: 6px 0;
}

.footer-contact a {
    color: #fff;
    text-decoration: none;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.footer-social a {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    color: #fff;
    transition: transform .15s ease, background .15s ease;
}

.footer-social a:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.08);
}

/* ============================= */
/* FOOTER BOTTOM (SIEMPRE ABAJO) */
/* ============================= */

.footer-bottom {
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.06);

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
}

.footer-bottom .credits a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
}

.footer-bottom .credits a:hover {
    color: var(--color-acento);
}

/* ============================= */
/* MOBILE */
/* ============================= */

@media (max-width: 640px) {

    .footer-logo-center {
        width: 240px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}



/* ============================= */
/* Launch-details section (newsletter) */
/* ============================= */
.launch-details-section {
    background: var(--color-acento); /* fondo amarillo */
    color: var(--color-fondo-oscuro);
    padding: 0;
    min-height: 500px;
}

.launch-details-inner {
    max-width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    height: 100%;
    min-height: 500px;
}

.launch-image {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: 100%;
}

.newsletter-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.launch-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 5%;
    gap: 30px;
}

.launch-text {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.launch-text h2 { 
    margin: 0 0 16px 0; 
    color: var(--color-fondo-oscuro);
    font-size: 28px;
}

.launch-text p { 
    margin: 0; 
    color: rgba(0,0,0,0.75);
    max-width: 400px;
    line-height: 1.6;
}

.launch-subscribe { 
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 350px;
}

.launch-subscribe input[type="email"]{ 
    padding: 12px 16px; 
    border-radius: 6px; 
    border: 1px solid rgba(0,0,0,0.08); 
    background: #ffffff; 
    color: var(--color-fondo-oscuro); 
    font-family: 'Montserrat', sans-serif;
    width: 100%;
}

.launch-subscribe .btn-primary { 
    padding: 12px 24px; 
    border-radius: 6px; 
    background: var(--color-fondo-oscuro); 
    color: #fff; 
    border: none;
    width: 100%;
}

/* Montserrat font for subscribe input placeholder */
.launch-subscribe input[type="email"]::placeholder,
.launch-subscribe input[type="email"]::-webkit-input-placeholder,
.launch-subscribe input[type="email"]::-moz-placeholder,
.launch-subscribe input[type="email"]:-ms-input-placeholder {
    font-family: 'Montserrat', sans-serif;
    color: rgba(0,0,0,0.45);
}

@media (max-width: 900px){
    .launch-details-section {
        min-height: auto;
    }
    
    .launch-details-inner{ 
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .launch-image {
        height: 300px;
    }
    
    .launch-content {
        padding: 40px 5%;
    }
    
    .launch-text h2 {
        font-size: 24px;
    }
    
    .launch-subscribe{ 
        width: 100%;
        max-width: 100%;
    }
    
    .launch-subscribe input{ 
        width: 100%;
    }
}

/* ============================= */
/* BOOK MODAL STYLES */
/* ============================= */

/* Card overlay hover effect */
.card-media {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 300ms ease;
}

.card-media:hover .card-overlay {
    opacity: 1;
}

.read-synopsis {
    background: var(--color-acento);
    color: var(--color-fondo-oscuro);
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 200ms ease;
}

.read-synopsis:hover {
    background: var(--color-acento-hover);
}

.read-synopsis i {
    font-size: 16px;
}

/* Modal Styles */
.book-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.book-modal.active {
    display: flex;
    animation: fadeIn 300ms ease;
}

.book-modal.closing {
    animation: fadeOut 300ms ease;
}

.book-modal.closing .modal-content {
    animation: fadeOut 300ms ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 300ms ease;
    z-index: 2001;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, -50%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%);
    }
}

.modal-close {
    all: unset; /* 🔥 resetea completamente el botón */
    
    position: absolute;
    top: 16px;
    right: 16px;

    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;

    box-sizing: border-box;

    background: var(--color-acento);
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;
    line-height: 1;
    font-weight: bold;

    color: var(--color-fondo-oscuro);
    cursor: pointer;

    user-select: none;
    -webkit-tap-highlight-color: transparent;

    z-index: 2002;
}

.modal-close:active {
    transform: scale(0.92);
}



.modal-close:hover {
    background: var(--color-acento-hover);
}

.modal-close:focus {
    outline: none;
    box-shadow: none;
}

.modal-body {
    display: flex;
    gap: 24px;
    padding: 24px;
}

.modal-cover {
    width: 250px;
    min-width: 250px;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

.modal-text {
    flex: 1;
}

.modal-text h2 {
    margin: 0 0 16px 0;
    color: var(--color-principal);
    font-size: 22px;
    font-weight: 700;
}

.modal-text p {
    margin: 0;
    color: var(--color-principal);
    line-height: 1.7;
    font-size: 14px;
}

/* Responsive Modal */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-body {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }

    .modal-cover {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
        max-height: 400px;
    }

    .modal-text h2 {
        font-size: 18px;
    }

    .modal-text p {
        font-size: 13px;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* ============================= */
/* WHATSAPP BUTTON CLICK EFFECT */
/* ============================= */

.fab.fa-whatsapp {
    transition: color 200ms ease;
}

.fab.fa-whatsapp.whatsapp-clicked {
    color: var(--color-acento);
    animation: whatsappPulse 600ms ease;
}

@keyframes whatsappPulse {
    0% {
        color: var(--color-acento);
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        color: var(--color-acento);
        transform: scale(1);
    }
}

/* ============================= */
/* TESTIMONIALS SECTION */
/* ============================= */

/* =============================
    TESTIMONIOS – LAYOUT GENERAL
============================== */

.testimonials-section {
    padding: 80px 0;
    overflow: hidden;
}

.testimonials-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.testimonials-section h2 {
    text-align: center;
    margin-bottom: 50px;
}


/* =============================
    CAROUSEL
============================== */

.testimonials-carousel {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 10px 10px;
}

.testimonials-wrapper {
    display: flex;
    gap: 30px;
    transition: transform 0.6s ease;
    will-change: transform;
}

/* =============================
    CARD
============================== */

.testimonial-card {
    flex: 0 0 calc(33.333% - 20px); /* 3 visibles */
    max-width: 420px;              /* ancho mínimo de lectura */
    width: 100%;
        align-items: center;

    background-color: #f9f9f9;
    border-radius: 12px;
    padding: 28px;
    border: 1px solid #4A4A4A;

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    transition: transform 300ms ease, box-shadow 300ms ease;
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

/* =============================
    TEXTO
============================== */

.testimonial-quote {
    font-size: 16px;
    line-height: 1.75;
    color: var(--color-principal);
    margin-bottom: 25px;
    font-style: italic;
    text-align: center;
}
.asesoria-box ul li {
    margin-bottom: 10px;
    word-break: break-word;
    text-align: left;
}

/* =============================
    AUTOR
============================== */

.testimonial-author {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: auto;
}

.author-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid var(--color-acento);
}

.author-name {
    font-weight: 600;
    color: var(--color-fondo-oscuro);
    font-size: 15px;
}

.testimonials-pagination-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
}

.testimonial-dot {
    width: 10px;
    height: 10px;
    background-color: #999;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.testimonial-dot.active {
    background-color: var(--color-acento);
    transform: scale(1.3);
}


/* =============================
    MOBILE
============================== */

@media (max-width: 768px) {

    .testimonials-section {
        padding: 60px 0;
    }

    .testimonials-inner {
        padding: 0 16px;
    }

    .testimonials-wrapper {
        gap: 0; /* remove gap for full width cards */
    }

    .testimonial-card {
        flex: 0 0 100%; /* 1 card per slide */
        width: 100%;
        margin: 0; /* no margin for full width */
        padding: 22px;
    }

    .testimonial-quote {
        font-size: 15px;
    }

    .author-photo {
        object-fit: contain; /* prevent cropping on mobile */
        border-radius: 8px; /* soften to rectangle instead of circle */
        width: 60px;
        height: 60px;
    }
}

/* =============================
    SMALL MOBILE
============================== */

@media (max-width: 480px) {

    .testimonials-section {
        padding: 40px 0;
    }

    .testimonial-card {
        padding: 20px;
    }

    .testimonial-quote {
        font-size: 14.5px;
    }
}


/* ============================= */
/* IMAGE GALLERY SECTION */
/* ============================= */

.gallery-section {
    background-color: var(--color-fondo-oscuro);
    padding: 60px 20px;
    text-align: center;
}

.gallery-section h2 {
    font-size: 32px;
    color: var(--color-fondo-claro);
    margin-bottom: 40px;
}

.gallery-inner {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.masonry-grid {
    column-count: 3;
    column-gap: 15px;
    margin-bottom: 30px;
    position: relative;
    min-height: 600px;
}

.gallery-page {
    display: none;
}

.gallery-page.active {
    display: block;
}

.masonry-grid img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    break-inside: avoid;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.masonry-grid img:hover {
    transform: scale(1.02);
}

/* Pagination Controls */
.pagination-controls {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.pagination-controls .pagination-btns {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Pagination Dots */
.pagination-dots {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    background-color: var(--color-acento);
    color: var(--color-fondo-oscuro);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    pointer-events: all;
}

.pagination-btn:hover {
    background-color: var(--color-acento-hover);
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    background-color: #555;
    color: #999;
    cursor: not-allowed;
}

.pagination-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.pagination-dots .dot {
    width: 10px;
    height: 10px;
    background-color: #888;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.pagination-dots .dot.active {
    background-color: var(--color-acento);
    transform: scale(1.2);
}

.pagination-dots .dot:hover:not(.active) {
    background-color: #aaa;
}


/* Responsive Styles for Gallery */
@media (max-width: 900px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .gallery-section {
        padding: 40px 15px;
    }

    .gallery-section h2 {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .masonry-grid {
        column-count: 1;
        column-gap: 10px;
    }

    .masonry-grid img {
        margin-bottom: 10px;
    }

    .pagination-controls {
        justify-content: center;
        gap: 15px;
    }

    .pagination-btn {
        padding: 8px 12px;
        font-size: 16px;
    }

    .pagination-dots .dot {
        width: 8px;
        height: 8px;
    }
}

/* ============================= */
/* AMAZON LINK – LIBROS */
/* ============================= */

.book-external-link {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.amazon-link {
    width: 100%;
    max-width: 280px; /* controla ancho respecto a la card */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    background-color: #f3f4f6;
    color: #111;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.amazon-link:hover {
    background-color: #e5e7eb;
    transform: translateY(-2px);
}

.amazon-logo {
    max-width: 60px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Responsive */
@media (max-width: 768px) {
    .amazon-link {
        max-width: 100%;
    }

    .amazon-logo {
        max-width: 50px;
    }
}
