:root {
    /* Paleta de Colores Natural y Calmada */
    --primary-green: #5D8C68;
    /* Verde Bambú */
    --deep-teal: #2A4F4F;
    /* Texto y fondos oscuros */
    --soft-cream: #FDFBF7;
    /* Fondo principal */
    --warm-sand: #F2E8DC;
    /* Fondos secundarios */
    --accent-clay: #2cbbc6;
    /* Botones y acentos (Tierra) */
    --light-blue: #E8F1F2;
    /* Detalles sutiles */
    --brown: #D97C56;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--soft-cream);
    color: var(--deep-teal);
    line-height: 1.6;
}

body.modal-open {
    overflow: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3 {
    font-family: 'Lora', serif;
    color: var(--deep-teal);
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- HEADER & NAV --- */
header {
    background-color: #fff;
    padding: 1rem 5%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    max-height: 45px;
    overflow: visible;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-green);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    font-weight: 600;
}

.nav-links a:hover {
    color: var(--accent-clay);
}

.cta-button,
.cta-button-brown {
    color: white;
    height: fit-content;
    padding: 5px 20px;
    border-radius: 30px;
    font-weight: bold;
    transition: transform 0.2s, background-color 0.2s;
}

.cta-button {
    background-color: var(--accent-clay);
}

.cta-button-brown {
    background-color: var(--brown);
}

.cta-button:hover {
    background-color: var(--brown);
    transform: translateY(-2px);
}

/* --- HERO SECTION --- */
.hero {
    padding: 5rem 5%;
    display: flex;
    align-items: center;
    gap: 4rem;
    background: linear-gradient(135deg, var(--soft-cream) 0%, var(--warm-sand) 100%);
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #4a6363;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
    max-width: 100%;
}

/* --- CUSTOM BANNER --- */
.custom-banner {
    padding: 3rem 5%;
    background: linear-gradient(135deg, #5D8C68 0%, #2A4F4F 100%);
    text-align: center;
    color: white;
}

.custom-banner-content {
    max-width: 900px;
    margin: 0 auto;
}

.custom-banner h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: white;
    line-height: 1.3;
}

.custom-banner p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

strong {
    color: var(--brown);
    font-weight: 800;
}

.custom-banner .cta-button {
    margin-top: 1.5rem;
    display: inline-block;
    background-color: white;
    color: #2A4F4F;
    font-weight: bold;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.custom-banner .cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background-color: #F2E8DC;
}

.cta-button-brown:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background-color: var(--accent-clay);
}

/* --- PHILOSOPHY SECTION (LOS 3 PILARES) --- */
#filosofia {
    position: relative;
    overflow: hidden;
    background-color: #fefefe;
}

#video-ayla {
    position: absolute;
    bottom: 0;
    right: 0;
    object-fit: contain;
    z-index: 0;
    overflow: hidden;
}

#video-ayla>video {
    margin-left: -10px;
}

#filosofia >*:not(#video-ayla) {
    position: relative;
    z-index: 1;
}

.philosophy {
    padding: 4rem 5%;
    text-align: center;
}

.philosophy h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.subtitle {
    max-width: 700px;
    margin: 0 auto 3rem;
    color: #666;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.pillar-card {
    padding: 2rem;
    background-color: var(--soft-cream);
    border-radius: 15px;
    transition: transform 0.3s;
}

.pillar-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 2.5rem;
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    margin-bottom: 1rem;
    /* Support for all WebKit browsers. */
    -webkit-font-smoothing: antialiased;
    /* Support for Safari and Chrome. */
    text-rendering: optimizeLegibility;
    /* Support for Firefox. */
    -moz-osx-font-smoothing: grayscale;
    /* Support for IE. */
    font-feature-settings: 'liga';
}

/* --- FEATURED BOOK (AYLA) --- */
.featured-book {
    padding: 5rem 5%;
    background-color: var(--light-blue);
    display: flex;
    align-items: center;
    gap: 4rem;
}

.book-cover-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.book-cover {
    width: 300px;
    height: fit-content;
    /* Proporción portada */
    background-color: #fff;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    transform: rotate(-3deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-green);
    border: 1px solid #eee;
}

.book-cover img {
    max-width: 100%;
    height: auto;
}

.book-info {
    flex: 1.5;
}

.badge {
    background-color: var(--primary-green);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- UPCOMING / CATALOG --- */
.catalog {
    padding: 5rem 5%;
    background-color: var(--soft-cream);
}

.catalog h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.book-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    opacity: 0.7;
    /* Visualmente indica que aún no están disponibles, salvo que se active */
}

.book-card.active {
    opacity: 1;
    border: 2px solid var(--primary-green);
}

.book-card-img {
    height: 200px;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    height: fit-content;
    min-height: 285px;
}

.book-card-body {
    padding: 1.5rem;
}

.book-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.status {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--brown);
}

.slider-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px;
}

.books-slider-wrapper {
    overflow: hidden;
    width: 100%;
}

.books-slider {
    display: flex;
    gap: 2rem;
    transition: transform 0.5s ease-in-out;
}

.books-slider .book-card {
    min-width: calc(33.333% - 1.35rem);
    opacity: 1 !important;
    border: none !important;
}

.books-slider .book-card-img {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    min-height: auto !important;
    height: auto !important;
}

.books-slider .book-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--primary-green);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.slider-btn:hover:not(:disabled) {
    background-color: var(--brown);
}

.slider-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background-color: #ccc;
}

.slider-btn.prev {
    left: 0;
}

.slider-btn.next {
    right: 0;
}

@media (max-width: 1024px) {
    .books-slider .book-card {
        min-width: calc(50% - 1rem);
    }
}

@media (max-width: 768px) {
    .books-slider .book-card {
        min-width: 100%;
    }

    .slider-container {
        padding: 0 50px;
    }

    .slider-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    #filosofia {
        padding-bottom: 180px;
    }
}

/* --- FOOTER --- */
footer {
    background-color: var(--deep-teal);
    color: #ccc;
    padding: 3rem 5%;
    text-align: center;
}

/* --- MODAL CONTACTO --- */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
}

.modal.is-open {
    display: block;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.modal__dialog {
    position: relative;
    width: min(560px, calc(100% - 2rem));
    margin: 8vh auto;
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #2A4F4F;
}

.modal__subtitle {
    margin: 0.5rem 0 1.2rem;
    color: #4a6363;
}

.modal__form {
    display: grid;
    gap: 0.9rem;
}

.modal__form label {
    display: grid;
    gap: 0.35rem;
    font-weight: 700;
    color: var(--deep-teal);
}

.modal__form input,
.modal__form textarea {
    width: 100%;
    border: 1px solid #d8e0e0;
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    outline: none;
}

.modal__form input:focus,
.modal__form textarea:focus {
    border-color: var(--accent-clay);
    box-shadow: 0 0 0 4px rgba(44, 187, 198, 0.15);
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.3rem;
}

.modal__status {
    min-height: 1.2rem;
    font-weight: 700;
    margin-top: 0.2rem;
}

.modal__status.is-ok {
    color: var(--primary-green);
}

.modal__status.is-error {
    color: #b00020;
}

footer h3 {
    color: white;
    margin-bottom: 1rem;
}

.social-links {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {

    .hero,
    .featured-book {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .nav-links {
        display: none;
        /* En producción se usaría un menú hamburguesa */
    }

    .book-cover {
        width: 200px;
        height: 280px;
    }
}
