/* --- VARIABLES --- */
:root {
    --color-text: #353331; /* Dark gray for contrast */
    --color-background: #F8F8F8; /* Very light gray/off-white */
    --color-surface: #EFEFEF; /* Slightly darker cream/gray for elements */
    --color-accent: #D8D8D8; /* Subtle light gray/silver */
    --color-white: #FFFFFF;
    --color-white-rgb: 255, 255, 255;

    --color-cream-rgb: 245, 245, 245;
    --color-light-gray-rgb: 220, 220, 220;
    --color-dark-gray-rgb: 100, 100, 100;

    --font-primary: 'Bodoni Moda', serif;
    --font-secondary: 'Albert Sans', sans-serif;
}


/* --- GLOBAL STYLES --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 2px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-secondary);
    background: linear-gradient(to bottom right, var(--color-background), var(--color-surface)), url('textura-ruido.png'); /* Linear gradient with noise texture using new palette */
    background-blend-mode: multiply; /* Blend the texture */
    background-size: cover;
    background-attachment: fixed; /* Keep background fixed during scroll */
    color: var(--color-text);
    line-height: 1.7;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

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

section {
    padding: 8rem 0; /* Generous vertical padding for luxury */
}

.section-title {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 5vw, 2.25rem); /* Responsive font size */
    text-align: center;
    margin-bottom: 3rem;
    font-weight: normal;
    text-transform: uppercase;
}


/* --- ANIMATIONS --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px); /* More pronounced fade-up */
    filter: blur(8px); /* Blur-in effect */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, filter 0.6s ease-out; /* Shorter, smoother transition */
}

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


/* --- HEADER --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent; /* Inicialmente transparente */
    z-index: 100;
    transition: background-color 0.3s ease, color 0.3s ease; /* Transición para color de texto */
    color: var(--color-white); /* Texto blanco inicial */
}

.main-header.header-scrolled {
    background-color: rgba(248, 248, 248, 0.9); /* Use rgba for header scrolled background consistent with new palette */
    color: var(--color-text); /* Texto oscuro al hacer scroll */
}

/* Los links individuales también necesitan cambiar de color */
.main-header.header-scrolled nav a {
    color: var(--color-text);
}


.main-header .container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.main-header nav {
    display: flex;
    justify-content: space-between; /* Logo a la izquierda, links y botón a la derecha */
    align-items: center;
    padding: 20px 0; /* Padding del header */
}

.nav-logo {
    height: 40px !important; /* Estricto */
    width: auto;
    display: block;
}

.main-header nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px; /* Espacio entre los links de navegación */
}

.main-header nav ul a { /* Estilo específico para los links del nav */
    text-decoration: none;
    font-weight: 400;
    color: inherit; /* Hereda el color del header para la transición */
}

.btn {
    font-family: var(--font-secondary);
    background-color: var(--color-text);
    color: var(--color-background);
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    font-weight: 500;
    border: 1px solid transparent;
    display: inline-block; /* Added for margin */
}

.btn:hover {
    background-color: var(--color-text); /* Use dark gray for hover, consistent with new palette */
}

.btn-outline {
    background-color: transparent;
    color: var(--color-text); /* Color inicial del botón */
    border: 1px solid var(--color-text); /* Borde inicial */
    transition: all 0.3s ease;
}

/* Cambio de color del botón al hacer scroll */
.main-header.header-scrolled .btn-outline {
    color: var(--color-text);
    border-color: var(--color-text);
}


/* --- HAMBURGER MENU --- */
.menu-toggle {
    display: none; /* Oculto por defecto en desktop */
    width: 30px;
    height: 20px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    z-index: 101; /* Asegura que esté por encima del menú móvil */
    transition: color 0.3s ease;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-white);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
    transform-origin: left center;
}

/* Cambio de color del icono al hacer scroll */
.header-scrolled .menu-toggle span {
    background-color: var(--color-text);
}

/* Animación del icono cuando está activo */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
    background-color: var(--color-text); /* Asegura que sea visible sobre el menú móvil claro */
}

.menu-toggle.active span:nth-child(2) {
    width: 0%;
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
    background-color: var(--color-text); /* Asegura que sea visible sobre el menú móvil claro */
}







/* --- MOBILE NAVIGATION --- */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(var(--color-cream-rgb), 0.95); /* Fondo semitransparente */
    backdrop-filter: blur(10px);
    z-index: 99;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateX(100%); /* Ocultar por defecto */
    transition: transform 0.4s ease-in-out;
}

.mobile-nav.active {
    transform: translateX(0); /* Mostrar */
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    text-align: center;
}

.mobile-nav ul li {
    margin: 1.5rem 0;
}

.mobile-nav ul li a {
    text-decoration: none;
    color: var(--color-text);
    font-size: 1.8rem;
    font-family: var(--font-serif);
    font-weight: 700;
    transition: color 0.3s ease;
}

.mobile-nav ul li a:hover {
    color: var(--color-dark-gray-rgb);
}



.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}


/* --- HERO SLIDER --- */
/* --- HERO --- */
.hero {
    height: 650px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    position: relative;
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    width: 100%;
}

.hero-content {
    max-width: 800px;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    z-index: 2;
}

.hero-content h1 {
    font-family: var(--font-primary) !important;
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: normal;
    line-height: 1.2;
    margin: 0;
    text-transform: uppercase;
    color: var(--color-white);
}

.hero-subtitle {
    font-family: var(--font-secondary);
    font-size: 1.25rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0;
    color: var(--color-white);
}

.hero-cta {
    margin-top: 1rem;
}

.hero .btn {
    background-color: #F2F2F2;
    color: #353331;
}


/* --- SERVICES CARD LAYOUT --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
    align-items: stretch;
}

.service-card {
    background: var(--color-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.service-card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.service-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-card:hover .service-card-image img {
    transform: scale(1.1);
}

.service-card-content {
    padding: 2rem;
    padding-bottom: 4rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-card .category-title {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--color-accent);
    padding-bottom: 1rem;
    text-transform: uppercase;
}

.service-description {
    font-family: var(--font-secondary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    margin: 0;
    
    /* Truncado por defecto */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.4s ease;
}

.service-card.expanded .service-description {
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
}

.expand-btn {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 35px;
    height: 35px;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.service-card.expanded .expand-btn {
    transform: rotate(45deg);
    background: var(--color-text);
    color: var(--color-white);
}

.services-cta {
    margin-top: 4rem;
    text-align: center;
}

/* Responsive adjustments for cards */
@media (max-width: 1200px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}

.services-cta {
    margin-top: 4rem;
    text-align: center;
}

/* Responsive adjustments for cards */
@media (max-width: 1200px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}


/* --- ABOUT US --- */

.about-us {

    background-color: var(--color-surface); /* Distinct background for differentiation */

}



.about-us-layout {

    display: grid;
    grid-template-columns: 1.2fr 1fr; /* Asymmetric columns: image wider than text */
    grid-template-areas: "image text"; /* Define named areas */
    align-items: center; /* Vertically align items */
    gap: 4rem;

}



.about-us-image {
    grid-area: image;
    transform: translateY(10px);
    margin-bottom: 50px;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}



.about-us-image img {
    border-radius: 0px;
    object-fit: cover;
    object-position: top;
    width: 100%;
    height: 100%; /* Make image fill container for better control */
    max-height: 550px; /* Slightly increase max-height */

}

.about-us-text {
    grid-area: text; /* Assign to grid area */
    text-align: left; /* Ensure text is aligned left */

}


.about-us-text .section-title {
    text-align: left;

} 



/* --- FAQ --- */
.faq {
    background-color: var(--color-background);
    padding: 4rem 0;
}

.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 2rem; /* Generous spacing below accordion */
}

.faq-item {
    background-color: rgba(var(--color-cream-rgb), 0.1); /* Subtle transparent cream background */
    backdrop-filter: blur(20px) saturate(1.8) brightness(1.1); /* Glassmorphism blur effect with saturation and brightness */
    border: 1px solid rgba(var(--color-white-rgb), 0.5); /* Light border */
    border-radius: 10px; /* Add border-radius for consistency */
    box-shadow: 0 10px 40px rgba(0,0,0,0.05); /* Soft-ambient shadow */
    transition: all 0.6s ease-in-out;
    margin-bottom: 1rem; /* Add some space between FAQ items */
}

.faq-item:hover {
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    transform: translateY(-5px); /* Item floats subtly */
}

.faq-item:hover {
    box-shadow: 0 15px 50px rgba(0,0,0,0.1); /* More intense soft-ambient shadow on hover */
    transform: translateY(-5px); /* Item floats subtly */
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 1.5rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-icon {
    width: 1em;
    height: 1em;
    border-left: 2px solid var(--color-text);
    border-bottom: 2px solid var(--color-text);
    transform: rotate(-45deg);
    transition: transform 0.3s ease;
}

.faq-item.expanded .faq-icon {
    transform: rotate(135deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease;
    padding: 0 1rem;
}

.faq-answer p {
    font-weight: 300;
    padding-bottom: 1.5rem;
}

.faq-item.expanded .faq-answer {
    max-height: 1000px; /* Ajustar si las respuestas son más largas */
}



/* --- GIFT CARD BANNER --- */
.gift-card-banner {
    padding: 25rem 0;
    background-image: url('placeholder-gift-card.jpg');
    background-size: cover;
    background-position: center 65%;
    background-repeat: no-repeat;
}

/* --- CONTACT --- */
.contact {
    background-color: var(--color-surface);
    padding-top: 4rem;    /* Generous spacing above contact section */
    padding-bottom: 2rem; /* Generous spacing below contact section */
}

.contact-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contact-content .btn {
    margin-top: 2rem;
}

.contact-info {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-icon {
    width: 32px;
    height: 32px;
    color: var(--color-text);
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.15);
}



/* --- WHATSAPP FLOAT BUTTON --- */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: var(--color-background);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 100;
    transition: transform 0.3s ease;
}
.whatsapp-float svg {
    width: 32px;
    height: 32px;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}


/* --- FOOTER --- */
.main-footer {
    background-color: var(--color-text);
    color: var(--color-white);
    padding: 3rem 0;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 300;
}


/* --- ACCESSIBILITY: PREFERS REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
    .fade-in {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}


/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    /* --- HEADER MOBILE --- */
    .main-header nav {
        flex-wrap: nowrap;
        padding: 15px 1rem;
    }
    
    .nav-logo {
        height: 25px !important;
    }

    /* --- HERO MOBILE --- */
    .hero {
        height: 500px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
    }

    /* --- SERVICES MOBILE --- */
    .category-grid {
        gap: 1.5rem;
    }

    .service-card-image {
        height: 180px;
    }

    .service-card-content {
        padding: 1.5rem;
        padding-bottom: 3.5rem;
    }

    .service-card .category-title {
        font-size: 1.2rem;
    }

    /* --- ABOUT US MOBILE --- */
    .about-us-layout {
        grid-template-columns: 1fr;
        grid-template-areas: none; /* Reset areas to show all items */
        gap: 2rem;
    }
    .about-us-image {
        grid-area: auto; /* Reset grid area */
        margin-bottom: 1rem;
    }
    .about-us-image img {
        max-height: 350px;
    }
    .about-us-text {
        grid-area: auto; /* Reset grid area */
        text-align: center;
    }
    .about-us-text .section-title {
        text-align: center;
    }
    .about-us-text p {
        font-size: 0.95rem;
    }
}

/* --- DIAGNOSTIC CONSULTATION --- */
.diagnostic-consultation {
    background-color: #353331; /* Dark gray almost black */
    color: var(--color-white);
    text-align: center;
    padding: 6rem 0;
}

.diagnostic-consultation .section-title {
    color: var(--color-white);
    margin-bottom: 2rem;
}

.diagnostic-text-box {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.diagnostic-text-box p {
    font-size: 1.1rem;
    line-height: 1.8;
}