/* 
   Theme: Emotional, Professional, Family-Oriented, Premium
   Colors: 
     - Midnight Blue: #0A1E3C (Trust, Authority)
     - Soft Gold/Amber: #D4AF37 (Warmth, Value)
     - Cream White: #F9F9F9 (Background)
     - Dark Gray: #333333 (Text)
*/

:root {
    --primary-color: #0B2545;
    /* Deep Midnight Blue */
    --accent-color: #D4AF37;
    /* Metallic Gold */
    --accent-hover: #b5952f;
    --text-color: #333333;
    --light-bg: #F5F7FA;
    --white: #FFFFFF;
    --font-main: 'Outfit', sans-serif;
    --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* GLOBAL RESET & OVERFLOW FIXES */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
video,
svg {
    max-width: 100%;
    height: auto;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 80px 0;
}

.text-center {
    text-align: center;
}

.bg-light {
    background-color: var(--light-bg);
}

.bg-dark {
    background-color: var(--primary-color);
    color: var(--white);
}

.light-text h2,
.light-text p {
    color: var(--white);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.2rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.btn-outline:hover {
    background: var(--accent-color);
    color: var(--primary-color);
}

.btn-block {
    width: 100%;
    margin-top: 10px;
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(212, 175, 55, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Header */
.site-header {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    /* Removed: replaced by .brand structure */
    display: none;
}

/* --- NEW BRANDING STYLES --- */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    z-index: 10;
    /* Ensure it stays above other elements if needed */
}

.brand-mark {
    width: clamp(34px, 8vw, 44px);
    height: clamp(34px, 8vw, 44px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: clamp(14px, 3.5vw, 18px);
    /* Adjust font size relative to container */
    letter-spacing: 0.5px;
    background: rgba(11, 37, 69, 0.08);
    /* primary-color with low opacity */
    color: var(--primary-color);
    flex: 0 0 auto;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    justify-content: center;
}

.brand-name {
    font-size: clamp(14px, 3.2vw, 18px);
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--primary-color);
    text-transform: uppercase;
    white-space: nowrap;
}

.brand-surname {
    margin-top: 2px;
    font-size: clamp(14px, 3.2vw, 18px);
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--primary-color);
    text-transform: uppercase;
    white-space: nowrap;
}

.brand-accent {
    display: block;
    margin-top: 6px;
    width: clamp(36px, 10vw, 54px);
    height: 3px;
    border-radius: 999px;
    background: var(--accent-color);
}


/* Hamburger Menu Button (Hidden on Desktop) */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--primary-color);
    cursor: pointer;
    z-index: 1001;
    /* Above nav */
}

/* Desktop Nav (unchanged) */
.main-nav ul {
    display: flex;
    gap: 30px;
    align-items: center;
}

.main-nav a {
    font-weight: 500;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.main-nav a:hover:not(.btn) {
    color: var(--accent-color);
}

/* Hero Section */
.hero {
    height: 90vh;
    background-image: url('assets/hero-family.png');
    background-size: cover;
    background-position: center;
    position: relative;
    /* Fixed: 'relative' instead of 'absolute' to contain overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 0;
    /* Remove top margin, handled by height/layout */
    padding-top: 80px;
    /* Account for fixed header if needed, but flex centering handles main content */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(11, 37, 69, 0.7) 0%, rgba(11, 37, 69, 0.4) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    color: var(--white);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* Empathy Section */
.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.separator {
    height: 4px;
    width: 80px;
    background-color: var(--accent-color);
    margin: 0 auto 50px;
    border-radius: 2px;
}

.empathy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.empathy-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: var(--transition);
}

.empathy-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.empathy-card i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.empathy-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* Solution Section */
.solution-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.solution-text h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.solution-text p {
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.benefits-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.benefits-list i {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-right: 15px;
    margin-top: 4px;
}

.benefits-list strong {
    display: block;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.solution-visual {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.card-visual {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    text-align: center;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-visual .icon-large {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.mt-up {
    margin-top: -40px;
}

/* About Section */
.about-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

.about-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
}

.quote-card {
    position: absolute;
    bottom: 30px;
    right: -20px;
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    border-left: 5px solid var(--accent-color);
    max-width: 250px;
}

.quote-card p {
    font-style: italic;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.about-text h2 {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.about-text h3 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 25px;
}

/* Contact Section */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 50px;
    padding: 10px;
    /* Inner padding wrapper */
}

.contact .section-header h2 {
    color: var(--white);
    position: relative;
    display: inline-block;
}

.contact .section-header h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    background-color: #d4af37;
    margin: 15px auto 0;
    border-radius: 2px;
}

.form-container {
    padding: 50px;
}

.contact-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--primary-color);
}

.contact-form input,
.contact-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form select:focus {
    border-color: var(--accent-color);
    outline: none;
}

/* Form Grid */
.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-group.half {
    flex: 1 1 calc(50% - 10px);
}

.form-group.third {
    flex: 1 1 calc(33.333% - 14px);
}

@media (max-width: 600px) {

    .form-group.half,
    .form-group.third {
        flex: 1 1 100%;
    }
}

.calendar-placeholder-container {
    background-color: var(--light-bg);
    /* Contrast */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-left: 1px solid #eee;
}

.calendar-mockup {
    text-align: center;
}

.calendar-mockup h4 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.calendar-mockup p {
    color: #666;
    margin-bottom: 25px;
}

.calendar-mockup a {
    text-decoration: none;
}

/* Partners Section */
.partners {
    background-color: var(--light-bg);
    padding: 60px 0;
}

.partners-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    margin-bottom: 30px;
}

.partners-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    flex-wrap: wrap;
}

.partners-logos a {
    display: inline-block;
    transition: var(--transition);
    opacity: 0.8;
}

.partners-logos a:hover {
    opacity: 1;
    transform: translateY(-5px);
}

.partners-logos img {
    height: 60px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%);
    /* Elegant, minimal look */
    transition: var(--transition);
}

.partners-logos a:hover img {
    filter: grayscale(0%);
    /* Color on hover */
}

/* Modal Styles */
.modal-overlay-container {
    display: none;
    /* Hidden by default */
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--white);
    padding: 40px 24px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 92%;
    max-width: 420px;
    position: relative;
    text-align: center;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    color: #9CA3AF;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    padding: 4px;
}

.close-modal:hover {
    color: var(--text-color);
}

.modal-icon {
    font-size: 3.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.modal-content h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.5rem;
    line-height: 1.2;
}

.modal-content p {
    color: #666;
    font-size: 1rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Footer */
.site-footer {
    background-color: #051224;
    /* Darker than primary */
    color: rgba(255, 255, 255, 0.6);
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    z-index: 1000;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

/* Responsiveness */
@media (max-width: 900px) {

    .solution-content,
    .about-wrapper,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .solution-visual {
        margin-top: 40px;
    }

    .mt-up {
        margin-top: 0;
    }

    .quote-card {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: -30px;
        margin-left: auto;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    .solution-text h2 {
        font-size: clamp(1.8rem, 6vw, 2.2rem);
    }

    .form-container,
    .calendar-placeholder-container {
        padding: 30px 20px;
    }
}

/* --- MOBILE & TABLET OPTIMIZATION (Strict Fixes) --- */
@media (max-width: 768px) {

    /* 1. Header & Navigation */
    .hamburger-menu {
        display: block;
    }

    .main-nav {
        display: none;
        /* Hidden by default */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        padding: 20px;
        flex-direction: column;
        z-index: 999;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        gap: 20px;
    }

    .main-nav ul.is-open {
        display: flex;
    }

    .main-nav ul li {
        width: 100%;
        text-align: center;
    }

    .main-nav a.btn {
        display: block;
        width: 100%;
        max-width: 100%;
    }

    /* 2. Overflow Fixes (CRITICAL) */
    .quote-card {
        position: relative;
        bottom: auto;
        right: auto;
        left: auto;
        margin: 20px auto 0;
        width: 100%;
        max-width: 300px;
        border-left: 5px solid var(--accent-color);
    }

    .about-wrapper,
    .contact-wrapper {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        overflow: hidden;
    }

    /* 3. Global Container & Section Fixes */
    .container {
        width: 100%;
        padding: 0 16px;
        /* Reset padding to standard mobile */
        max-width: 100%;
        overflow-x: hidden;
    }

    .section-padding {
        padding: 50px 0;
    }

    .hero {
        min-height: 80vh;
        height: auto;
        padding-top: 100px;
        padding-bottom: 40px;
    }

    /* 4. WhatsApp Button Position */
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 28px;
    }
}

/* Specific Mobile Optimization (<= 480px) */
@media (max-width: 480px) {

    /* Header Spacing */
    .site-header .container {
        gap: 10px;
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Prevent CTA cut off if visible in header, or optimize menu button */
    .main-nav .btn,
    .site-header .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: visible;
    }

    /* Solution Visual Grid */
    .solution-visual {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        justify-items: center;
        width: 100%;
        margin-top: 30px;
    }

    .card-visual {
        width: 100%;
        max-width: 100%;
        padding: 20px 10px;
        min-height: 140px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .card-visual .icon-large {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }

    .card-visual h4 {
        font-size: 1rem;
        margin: 0;
    }

    /* Typography Safety */
    h1,
    h2,
    h3 {
        word-break: normal;
        overflow-wrap: anywhere;
    }
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    background-color: #efefef;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    width: 70px;
    height: 32px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    outline: none;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.toggle-switch:focus {
    border-color: var(--accent-color);
}

.toggle-option {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
    color: #999;
    transition: color 0.3s ease;
    user-select: none;
}

.toggle-circle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transition: transform 0.3s ease;
    z-index: 1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Active State Styles */
.toggle-switch.active .toggle-circle {
    transform: translateX(38px);
}

.toggle-switch .toggle-option {
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
}

.toggle-switch .toggle-option.lang-es {
    left: 0;
    color: var(--white);
}

.toggle-switch .toggle-option.lang-en {
    right: 0;
    color: #888;
}

.toggle-switch.active .toggle-option.lang-es {
    color: #888;
}

.toggle-switch.active .toggle-option.lang-en {
    color: var(--white);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .lang-switcher {
        margin: 0;
        margin-top: 15px;
        /* Add space in mobile menu */
        justify-content: center;
        width: 100%;
    }
}