/* Agregamos más espacio y altura a las secciones */
.hero, .purpose-section, .section {
    min-height: 100vh; /* Cada sección ocupa toda la pantalla */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centra el contenido verticalmente */
    padding: 100px 0; /* Espacio extra arriba y abajo */
}

/* Ajuste para que el fondo se vea continuo y elegante */
.purpose-section {
    background: linear-gradient(to bottom, #ffffff, #f1f7f6);
}

/* Estilo para el botón que ahora irá a otra página */
.btn-nav, .btn-primary {
    transition: transform 0.3s ease, background-color 0.3s ease;
}



/* VARIABLES DE DISEÑO PROFESIONAL */
:root {
    --primary: #9DBEB9; /* Verde eucalipto suave (calma) */
    --secondary: #E9C46A; /* Amarillo mostaza suave (creatividad) */
    --accent: #F4A261; /* Durazno (calidez) */
    --dark: #264653; /* Azul petróleo para textos (legibilidad) */
    --light: #F8F9FA;
    --white: #FFFFFF;
    --shadow: 0 20px 40px rgba(0,0,0,0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Montserrat', sans-serif; 
    background-color: var(--light); 
    color: var(--dark); 
    overflow-x: hidden;
}

h1, h2 { font-family: 'Playfair Display', serif; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* HEADER DINÁMICO */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.navbar { display: flex; justify-content: space-between; align-items: center; }

.logo { 
    font-size: 1.5rem; 
    font-weight: 600; 
    text-decoration: none; 
    color: var(--dark);
}
.logo span { display: block; font-size: 0.7rem; letter-spacing: 3px; text-transform: uppercase; color: var(--primary); }

.nav-menu { display: flex; list-style: none; gap: 30px; align-items: center; }
.nav-menu a { text-decoration: none; color: var(--dark); font-weight: 500; font-size: 0.9rem; transition: 0.3s; }
.nav-menu a:hover { color: var(--primary); }

.btn-nav { background: var(--primary); color: white !important; padding: 10px 20px; border-radius: 50px; }

/* HERO SECTION */
.hero { padding: 100px 0; background: linear-gradient(135deg, #fff 0%, #f1f7f6 100%); }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 50px; align-items: center; }

.tag { background: #e0f2f1; color: var(--primary); padding: 5px 15px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; }
.hero h1 { font-size: 3.5rem; margin: 20px 0; line-height: 1.2; }
.hero p { font-size: 1.1rem; margin-bottom: 30px; opacity: 0.8; }

.btn-primary { 
    background: var(--dark); color: white; text-decoration: none; 
    padding: 15px 35px; border-radius: 50px; font-weight: 600; display: inline-block; transition: 0.4s;
}
.btn-primary:hover { background: var(--primary); transform: translateY(-3px); }

/* IMAGEN CON FORMA LÍQUIDA (BLOB) */
.hero-image { position: relative; }
.hero-image img { 
    width: 100%; border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; 
    box-shadow: var(--shadow); position: relative; z-index: 2;
}
.blob-shape {
    position: absolute; width: 110%; height: 110%; top: -5%; left: -5%;
    background: var(--primary); opacity: 0.2;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: blob-anim 10s infinite alternate;
}

@keyframes blob-anim {
    from { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    to { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

/* CARDS DE SERVICIOS */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 50px; }
.info-card { 
    background: white; padding: 40px; border-radius: 24px; box-shadow: var(--shadow);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); text-align: center;
}
.info-card:hover { transform: translateY(-10px); background: var(--primary); color: white; }
.info-card i { font-size: 2.5rem; color: var(--accent); margin-bottom: 20px; }
.info-card:hover i { color: white; }

/* RESPONSIVE */
@media (max-width: 968px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .nav-menu { display: none; } /* Aquí podrías añadir un menú hamburguesa */
    .hero h1 { font-size: 2.5rem; }
}

/* ESTILOS PARA LA PÁGINA DE CITAS */
.appointment-body {
    background-color: #f8fbfb;
}

.appointment-hero {
    padding: 80px 0;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
}

.appointment-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 80px;
    align-items: center;
}

/* Detalles de contacto a la izquierda */
.contact-details {
    margin-top: 40px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.detail-item i {
    width: 50px;
    height: 50px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* Contenedor del Formulario */
.appointment-form-container {
    position: relative;
    padding: 20px;
}

.styled-form {
    background: white;
    padding: 40px;
    border-radius: 30px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.08);
    position: relative;
    z-index: 5;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.input-group input, 
.input-group select, 
.input-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fdfdfd;
    font-family: inherit;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: var(--primary);
    outline: none;
    background: white;
}

.full-width {
    width: 100%;
    margin-top: 10px;
}

/* Decoración detrás del formulario */
.form-blob {
    position: absolute;
    width: 120%;
    height: 110%;
    background: var(--accent);
    opacity: 0.1;
    top: -5%;
    right: -10%;
    border-radius: 40% 60% 70% 30% / 40% 40% 60% 50%;
    z-index: 1;
}

@media (max-width: 968px) {
    .appointment-grid { grid-template-columns: 1fr; gap: 40px; }
    .appointment-info { text-align: center; }
    .detail-item { justify-content: center; }
}

/* --- ESTILOS DE SERVICIOS --- */
.section-services {
    padding: 100px 0;
    background-color: #ffffff;
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.service-card {
    background: #fdfdfd;
    padding: 40px;
    border-radius: 25px;
    border: 1px solid #f0f0f0;
    transition: 0.4s;
    text-align: left;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(157, 190, 185, 0.2);
    border-color: var(--primary);
}

.icon-box {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.service-list {
    list-style: none;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #666;
}

.service-list li { margin-bottom: 8px; }
.service-list i { color: var(--primary); margin-right: 10px; }

/* --- ESTILOS DE GALERÍA (Modern Masonry) --- */
.gallery-section {
    padding: 120px 0;
    background: #fdfdfd; /* Un blanco roto más limpio */
}

.gallery-masonry {
    display: grid;
    /* Usamos 4 columnas para mayor flexibilidad en diseño */
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 150px; 
    gap: 25px;
    margin-top: 50px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 30px; /* Bordes más circulares = más amigable */
    background: #eee;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1); /* Animación ultra fluida */
}

/* Diferentes tamaños para dinamismo */
.gallery-item.large { grid-column: span 2; grid-row: span 3; } /* Foto principal Lic. */
.gallery-item.medium { grid-column: span 2; grid-row: span 2; } /* Foto clínica amplia */
.gallery-item.tall { grid-row: span 3; } /* Foto detalle vertical */

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s ease;
    filter: brightness(0.95); /* Un toque sutil para resaltar el hover */
}

/* Efecto de elevación y luz */
.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(157, 190, 185, 0.25); /* Sombra con el color primario */
    z-index: 10;
}

.gallery-item:hover img {
    transform: scale(1.08);
    filter: brightness(1);
}

/* Overlay más elegante */
.gallery-item .overlay {
    position: absolute;
    inset: 0; /* Cubre todo */
    background: linear-gradient(to top, rgba(38, 70, 83, 0.6) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    padding: 30px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.overlay span {
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    transform: translateY(20px);
    transition: transform 0.5s ease;
}

.gallery-item:hover .overlay span {
    transform: translateY(0);
}

/* Ajuste para tablets y móviles */
@media (max-width: 1024px) {
    .gallery-masonry { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .gallery-masonry {
        grid-template-columns: 1fr;
        grid-auto-rows: 280px;
        gap: 20px;
    }
    .gallery-item.large, .gallery-item.medium, .gallery-item.tall {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* --- ESTILOS DE PREGUNTAS FRECUENTES (FAQ) --- */
.faq-section {
    padding: 100px 0;
    background-color: #ffffff;
}

.faq-container {
    max-width: 800px;
    margin: 40px auto 0;
    text-align: left;
}

.faq-item {
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.faq-question {
    width: 100%;
    padding: 25px 15px;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--dark);
    cursor: pointer;
    transition: 0.3s;
}

.faq-question:hover {
    color: var(--primary);
}

.faq-question i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

/* Cuando el acordeón está activo */
.faq-item.active .faq-question {
    color: var(--primary);
}

.faq-item.active i {
    transform: rotate(180deg);
}

/* La respuesta oculta */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #f9fbfb;
    border-radius: 10px;
}

.faq-answer p {
    padding: 20px;
    color: #666;
    line-height: 1.8;
}

/* --- FOOTER CLEAN & SMOOTH --- */
.main-footer {
    background-color: #F7F3F0; /* Un color diferente: crema suave orgánico */
    padding: 80px 0 30px;
    border-top: 1px solid rgba(0,0,0,0.03);
    color: #555;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

.footer-column h4 {
    font-family: 'Playfair Display', serif;
    color: var(--dark);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Estilo para los enlaces de contacto */
.contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #666;
    margin-bottom: 15px;
    transition: 0.3s ease;
}

.contact-link:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.contact-link i {
    color: var(--primary);
}

/* Enlaces de navegación */
.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul a {
    text-decoration: none;
    color: #666;
    transition: 0.3s;
}

.footer-column ul a:hover {
    color: var(--primary);
    padding-left: 5px;
}

/* Iconos de Redes Sociales */
.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    text-decoration: none;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.social-icons a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-5px);
}

/* Línea de Copyright */
.footer-bottom {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 30px;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 968px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 580px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .contact-link { justify-content: center; }
    .social-icons { justify-content: center; }
}

.cards-grid {
    display: grid;
    /* Esto hace que se adapten automáticamente de 1 a 4 columnas según el tamaño */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 30px;
    margin-top: 50px;
}

/* --- AJUSTE DE BOTONES HERO --- */
.hero-btns {
    display: flex;
    gap: 25px; /* Espacio entre el botón principal y el secundario */
    margin-top: 30px;
    align-items: center;
}

.btn-secondary {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: 0.3s;
    position: relative;
}

.btn-secondary:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary);
    transition: 0.3s;
}

.btn-secondary:hover {
    color: var(--primary);
}

.btn-secondary:hover:after {
    width: 100%;
}

/* Ajuste para móviles: si la pantalla es pequeña, se ponen uno sobre otro */
@media (max-width: 480px) {
    .hero-btns {
        flex-direction: column;
        gap: 15px;
    }
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none; /* Se oculta al principio */
    z-index: 2000;
    box-shadow: 0 10px 25px rgba(157, 190, 185, 0.4);
    transition: 0.3s;
}

.back-to-top:hover {
    transform: translateY(-5px);
    background: var(--dark);
}

/* --- ESTILOS EXCLUSIVOS PÁGINA 404 --- */
.error-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdfdfd 0%, #edf2f1 100%);
    overflow: hidden;
    position: relative;
}

.error-container {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 20px;
}

.error-content {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    padding: 60px 40px;
    border-radius: 40px;
    border: 1px solid rgba(158, 120, 120, 0.8);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.05);
    max-width: 650px;
}

.error-icon {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 20px;
    animation: float 4s ease-in-out infinite;
}

.error-content h1 {
    font-size: 8rem;
    line-height: 1;
    margin-bottom: 10px;
    background: linear-gradient(to right, var(--primary), var(--dark));
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.error-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 20px;
}

.error-content p {
    color: #666;
    margin-bottom: 40px;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.btn-link {
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 2px;
    transition: 0.3s;
}

.btn-link:hover {
    color: var(--primary);
    letter-spacing: 1px;
}

/* Animaciones de fondo */
.floating-shape {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
}

.s1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -100px;
    right: -100px;
}

.s2 {
    width: 250px;
    height: 250px;
    background: var(--accent);
    bottom: -50px;
    left: -50px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@media (max-width: 600px) {
    .error-content h1 { font-size: 5rem; }
    .error-actions { flex-direction: column; }
}

.cards-grid {
    display: grid;
    /* Esto crea exactamente 2 columnas de igual tamaño */
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px; /* Espacio entre los cuadros */
    max-width: 700px; /* Ajusta esto según el ancho que desees */
    margin: 0 auto; /* Centra todo el bloque en la página */
}

/* Para que en celulares se pongan una debajo de otra (1 sola columna) */
@media (max-width: 600px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

.purpose-section .section-title {
    margin-top: -30px; /* Esto "empuja" el título hacia arriba */
    margin-bottom: 40px; /* Mantiene el espacio con los cuadros de abajo */
}

.icon-box {
    display: flex;
    justify-content: center; /* Centra horizontalmente */
    align-items: center;     /* Centra verticalmente */
    margin: 0 auto 20px;    /* El 'auto' centra la caja entera dentro de la tarjeta */
    width: 60px;             /* Ajusta al tamaño que desees */
    height: 60px;
}