/* =================================
   1. Configuración Base y Variables
   ================================= */
:root {
    --black: #1a1a1a;
    --white: #fdfdfd;
    --font-title: 'Playfair Display', serif;
    --font-text: 'Lato', sans-serif;
    --accent: #8a6fbf; /* Color lila utilizado */
    --star-color: #f39c12;
    --error-color: #f44336;
    --success-color: #4caf50;
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-text);
    line-height: 1.6;
    background-color: var(--white);
    color: var(--black);
    overflow-x: hidden;
}

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

/* Tipografía */
h1, h2, h3 {
    font-family: var(--font-title);
    line-height: 1.2;
    margin-bottom: 20px;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.5em; }

p { margin-bottom: 15px; }

/* =================================
   2. Componentes Utilitarios
   ================================= */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 0;
}

/* Compensa la altura del menú fijo al navegar a un ancla */
section[id], .container[id] {
    scroll-margin-top: 80px;
}

.shadow-box {
    background-color: var(--white);
    padding: 20px 40px 60px; 
    border-radius: 5px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Botones */
.read-more-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 16px;
    border: 1px solid var(--white);
    color: var(--white);
    text-decoration: none;
    font-size: 0.9em;
    border-radius: 5px;
    transition: background-color: 0.3s ease, color: 0.3s ease;
}

.read-more-btn:hover {
    background-color: var(--white);
    color: var(--black);
}

.btn-white {
    display: inline-block;
    background-color: var(--white);
    color: var(--black);
    padding: 15px 35px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 30px;
    border: 2px solid var(--white);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.btn-white:hover {
    transform: scale(1.05);
    background-color: #f0f0f0;
}

/* Animaciones */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =================================
   3. Navegación (Header)
   ================================= */
/* Logotipo */
.logo {
    position: fixed;
    top: 20px; 
    left: 20px;
    z-index: 1000; 
    width: 50px;
    height: 50px;
    display: block; 
    transition: transform 0.3s ease, top 0.3s ease;
}

.logo:hover { transform: scale(1.05); }
.logo img { width: 100%; height: 100%; object-fit: contain; }

/* Menú Escritorio (Oculto en móvil) */
.sticky-nav {
    display: none;
    position: fixed; 
    top: 0; left: 0;
    width: 100%;
    background-color: var(--black); 
    z-index: 999; 
    padding: 23px 0; 
}

.nav-container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sticky-nav ul {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    gap: 40px; 
}

.sticky-nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    text-align: center;
    transition: color 0.3s ease;
}

.sticky-nav a:hover { color: #cccccc; }

/* Menú Hamburguesa (Móvil) */
.mobile-menu-toggle {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 1002;
    background: var(--black);
    border: none;
    width: 45px; height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.mobile-menu-toggle span {
    display: block;
    width: 25px; height: 3px;
    background-color: var(--white);
    border-radius: 3px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.mobile-menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-nav-menu {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.mobile-nav-menu.is-open { transform: translateX(0%); }
.mobile-nav-menu ul { list-style: none; text-align: center; }
.mobile-nav-menu li { margin-bottom: 30px; }

.mobile-nav-menu a {
    color: var(--white);
    text-decoration: none;
    font-family: var(--font-title);
    font-size: 2.2em;
    font-weight: bold;
    transition: color 0.3s ease;
}
.mobile-nav-menu a:hover { color: #cccccc; }

/* =================================
   4. Secciones Principales
   ================================= */

/* --- Sección Héroe --- */
.hero {
    color: var(--white);
    text-align: center;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: color 0.5s ease-in-out;
}

.hero h2 { font-size: 2.8em; }
.hero.poster-visible { color: var(--black); }

.hero video {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    z-index: -1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%; 
    background-color: rgba(0, 0, 0, 0.5); 
    z-index: 0;
}

.hero-poster {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.hero-poster img { width: 100%; height: 100%; object-fit: cover; }
.hero-poster.is-hidden { opacity: 0; pointer-events: none; }
.hero .container { position: relative; z-index: 2; }

/* --- CTA Banner --- */
.cta-banner { padding: 40px 0 80px 0; }
.cta-content {
    background-color: var(--white);
    padding: 40px;
    border-radius: 5px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1); 
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 30px;
}

.cta-content .cta-text h2 {
    font-family: var(--font-text);
    font-size: 1.3em;
    line-height: 1.5;
    font-weight: 400;
    margin: 0;
    color: var(--black);
}

.cta-content .cta-button {
    display: inline-block;
    background-color: #333333;
    color: var(--white);
    padding: 15px 35px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 30px;
    text-align: center;
    line-height: 1.3;
    flex-shrink: 0;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.cta-content .cta-button:hover {
    background-color: #555555;
    transform: scale(1.05);
}

/* --- Misión --- */
.mission { background-color: var(--white); text-align: center; }
.mission h1.section-title { padding-bottom: 35px; text-align: center; }
.mission h1 { font-size: 2em; }

.mission .mission-subtitle {
    font-family: var(--font-text);
    font-size: 1.2em;
    font-style: italic;
    font-weight: 400;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 0 10%;
}

.mission-image img { border-radius: 5px; margin: 0 auto 30px auto; }

.mission-quote {
    font-family: var(--font-title);
    font-style: italic;
    font-size: 1.1em;
    margin: 30px 0 0 0;
    padding-left: 20px;
    border-left: 3px solid var(--accent);
    text-align: left;
    color: var(--accent);
}

/* --- Servicios --- */
.services {
    background-color: var(--black);
    color: var(--white);
    text-align: center;
    margin-bottom: 60px;
}

.services > .container > h2 { margin-bottom: 60px; }
.service-card { margin-bottom: 40px; }
.service-card img { border-radius: 5px; margin: 0 auto 20px auto; }

h4.service-tagline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 4.5em;
    width: auto;
    max-width: 90%;
    border: 2px solid var(--white);
    border-radius: 25px;
    padding: 10px 30px;
    margin: 15px auto 25px auto;
    font-family: var(--font-text);
    font-size: 1.1em;
    font-weight: bold;
    line-height: 1.3;
}

/* Servicio Full Width */
.service-row-full { margin-top: 60px; }
.service-row-image img { border-radius: 5px; margin: 0 auto 30px auto; }
.service-row-text p { padding: 0 5%; }

/* --- Sobre Mí --- */
.about { background-color: var(--white); text-align: center; }
#sobre-mi.about .container { padding-top: 50px; }
.about-image img {
    border-radius: 50%;
    width: 200px; height: 200px;
    object-fit: cover;
    margin: 0 auto 30px auto;
}
.about-text h3 { margin-top: 40px; }

.reasons-list { list-style: none; padding: 0; margin: 20px 0; }
.reasons-list li { margin-bottom: 20px; }
.reasons-list .highlight {
    font-weight: bold;
    color: var(--accent);
    margin-right: 8px;
}
.about-quote { margin-top: 40px; border-color: var(--accent); color: var(--accent); }

/* --- Equipo --- */
.team { background-color: var(--white); color: var(--black); text-align: center; }
.team h2 { margin-bottom: 60px; }
.team .testimonial-card img { width: 75%; height: auto; }
.team .testimonial-card a.team-link { color: inherit; text-decoration: none; }
.team .testimonial-card a.team-link:hover { text-decoration: underline; }

/* --- Testimonios --- */
.testimonials { background-color: var(--black); color: var(--white); text-align: center; }
.testimonials .read-more-btn { border-color: var(--white); color: var(--white); }
.testimonials .read-more-btn:hover { background-color: var(--white); color: var(--black); }
.testimonials-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr;
    margin-top: 40px;
}
.testimonial-card { padding: 30px; box-sizing: border-box; }
.testimonial-card img {
    width: 90px; height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px auto;
}
.testimonial-card .stars { color: var(--star-color); font-size: 1.2em; margin-bottom: 10px; }
.testimonial-card h3 { margin-bottom: 10px; }
.testimonial-title { font-weight: bold; font-style: italic; margin-bottom: 15px; }
.testimonials-actions { margin-top: 50px; text-align: center; }

/* --- Contacto y Formularios --- */
.contact { background-color: var(--white); color: var(--black); }

/* Inputs generales */
.contact-form input:not([type="checkbox"]),
.contact-form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-text);
    background-color: #fff;
}

.contact-form button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 5px;
    background-color: var(--black);
    color: var(--white);
    font-weight: bold;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.contact-form button:hover { transform: scale(1.02); }
.contact-form button:disabled { background-color: #ccc; cursor: not-allowed; }

#form-status {
    text-align: center;
    margin-top: 25px;
    font-weight: bold;
    min-height: 25px;
}

/* Consentimiento / Checkbox */
.privacy-policy-consent {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    width: 100%;
}

/* Checkbox específico */
.consent-label input[type="checkbox"] {
    width: auto;
    margin-bottom: 0;
    margin-top: 3px;
    flex-shrink: 0;
}

.consent-label span { text-align: left; }
.privacy-policy-consent a { color: var(--black); text-decoration: underline; font-weight: normal; }

/* --- Noticias (News) --- */
.news { background-color: var(--white); color: var(--black); text-align: center; }
.news h2 { margin-bottom: 60px; }
.news-grid { display: grid; gap: 30px; grid-template-columns: 1fr; }
.news-card {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.news-card-large { display: flex; flex-direction: column; text-align: left; }
.news-card img { width: 100%; height: 100%; object-fit: cover; }
.news-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}
.news-card h3 { font-size: 1.3em; margin-bottom: 20px; }
.news-btn {
    display: inline-block;
    background-color: var(--black);
    color: var(--white);
    padding: 10px 25px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    margin-top: auto;
    align-self: flex-start;
    transition: transform 0.3s ease;
}
.news-btn:hover { transform: scale(1.05); }
.more-news-container { text-align: center; margin-top: 60px; }

/* --- Footer --- */
footer { background-color: var(--black); color: var(--white); text-align: center; }
footer .container { padding: 30px 0; }
.footer-links { margin-top: 15px; font-size: 0.9em; }
.footer-links a {
    color: var(--white);
    text-decoration: none;
    transition: text-decoration 0.2s ease-in-out;
}
.footer-links a:hover { text-decoration: underline; }
footer p a { color: var(--white); }
.footer-links span { margin: 0 10px; }

/* =================================
   5. Páginas de Contenido (Legal)
   ================================= */
.legal-content .container { max-width: 800px; padding-top: 40px; }
.legal-content h2 { margin-top: 60px; margin-bottom: 15px; font-size: 1.5em; }
.legal-content p, .legal-content li { text-align: justify; margin-bottom: 20px; }
.legal-content ul { list-style-position: outside; padding-left: 20px; margin-bottom: 20px; }
.legal-content a { color: var(--black); font-weight: bold; }

/* Tablas Cookies */
.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    text-align: left;
}
.cookie-table th, .cookie-table td {
    border: 1px solid #ddd;
    padding: 10px;
    vertical-align: top;
}
.cookie-table th { background-color: #f2f2f2; font-weight: bold; }
.cookie-table td:first-child { font-weight: bold; }

/* =================================
   6. Cookie Banner
   ================================= */
.cookie-banner {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    background-color: var(--black);
    color: var(--white);
    padding: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 15px;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.2);
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.5s ease-out, visibility 0.5s ease-out;
}

.cookie-banner.is-visible { transform: translateY(0); visibility: visible; }
.cookie-banner p { margin: 0; font-size: 0.9em; max-width: 800px; line-height: 1.5; }
.cookie-buttons { display: flex; gap: 15px; align-items: center; flex-shrink: 0; }

.cookie-btn-more, .cookie-btn-close, .cookie-btn-deny { 
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
    cursor: pointer;
    font-family: var(--font-text);
    transition: background-color: 0.3s ease, color: 0.3s ease;
}

.cookie-btn-more { border: 1px solid var(--white); color: var(--white); }
.cookie-btn-more:hover { background-color: var(--white); color: var(--black); }

.cookie-btn-close { background-color: var(--white); color: var(--black); border: 1px solid var(--white); }
.cookie-btn-close:hover { background-color: #f0f0f0; }

.cookie-btn-deny { background-color: transparent; border: 1px solid var(--white); color: var(--white); }
.cookie-btn-deny:hover { background-color: var(--white); color: var(--black); }

/* =================================
   7. Media Queries (Tablets 768px+)
   ================================= */
@media (min-width: 768px) {
    /* Tipografía */
    h1 { font-size: 3.5em; }
    h2 { font-size: 2.5em; }
    .hero h2 { font-size: 3.8em; }
    .mission h1 { font-size: 2.5em; }
    .cta-content .cta-text h2 { font-size: 1.5em; }
    
    /* Layout */
    .cta-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 50px 10%;
    }

    .mission { text-align: left; }
    .mission-flex { display: flex; align-items: center; gap: 60px; }
    .mission-image { flex: 1; }
    .mission-text { flex: 2; }
    .mission-image img { margin: 0; }

    .services-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
    .service-card { margin-bottom: 0; }
    
    .services .read-more-btn { border-color: var(--white); color: var(--white); }
    .services .read-more-btn:hover { background-color: var(--white); color: var(--black); }

    /* Servicio Full Width */
    .service-row-full {
        display: flex;
        gap: 60px;
        align-items: center;
        margin-top: 80px;
    }
    .service-row-image { flex: 1; }
    .service-row-image img { margin-bottom: 0; }
    .service-row-text { flex: 2; }
    .service-row-text p { padding: 0 10%; }

    /* Sobre Mí */
    .about { text-align: left; }
    .about-flex { display: flex; align-items: center; gap: 60px; }
    .about-image { flex: 1; }
    .about-text { flex: 2; }
    .about-image img {
        width: 100%;
        height: auto;
        max-width: 350px;
        margin: 0 auto;
        display: block;
    }
    .reasons-list { text-align: left; }

    /* Testimonios */
    .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
    .testimonial-card { flex: none; width: auto; }

    /* Noticias */
    .news-grid { grid-template-columns: repeat(4, 1fr); grid-template-rows: auto auto; }
    .news-card-large { grid-column: 1 / 3; grid-row: 1 / 3; }
    .news-card-large .news-content { padding: 40px; }
    .news-card-large h3 { font-size: 2em; }

    /* Contacto */
    .contact-content { display: flex; align-items: flex-start; gap: 60px; }
    .contact-info, .contact-form { flex: 1; }
    .contact-form button { width: auto; padding: 15px 40px; }

    /* Cookie Banner */
    .cookie-banner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        padding: 20px 40px;
    }
    .cookie-banner p { margin-right: 20px; margin-bottom: 0; }
}

/* =================================
   8. Media Queries (Escritorio 1024px+)
   ================================= */
@media (min-width: 1024px) {
    /* Navegación */
    .mobile-menu-toggle { display: none; }
    .sticky-nav { display: block; }
    .logo {
        width: 150px;
        height: 150px;
        left: 30px;
        top: 90px;
    }
    
    /* Layout */
    .testimonials-grid { grid-template-columns: repeat(4, 1fr); }
}