/* Variables y Configuración Base */
:root {
    --primary-color: #00A9B8;
    --primary-dark: #004d61;
    --primary-light: #4DD0E1;
    --secondary-color: #f1f5f9;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --white: #ffffff;
    --bg-light: #f8fafc;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    --font-main: 'Inter', sans-serif;
    
    /* Variables dinámicas para modo oscuro */
    --overlay-rgb: 255, 255, 255;
    --header-bg: rgba(255, 255, 255, 0.95);
    --input-border: #cbd5e1;
}


html {
    scroll-behavior: smooth; /* Desplazamiento suave a etiquetas */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--white);
    padding-top: 70px; /* Para el menú fijo */
    font-size: clamp(1rem, 1vw + 0.8rem, 1.125rem); /* Tipografía fluida base */
}

/* Tipografía */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.text-center { text-align: center; }
.text-white, .text-white h1, .text-white h2, .text-white h3, .text-white h4 { color: #ffffff !important; }
.text-white p { color: #e2e8f0 !important; }

/* Contenedor */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header & Navegación */
.header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    height: 70px;
    display: flex;
    align-items: center;
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-img {
    height: 50px; /* Ajusta la altura según sea necesario */
    width: auto;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

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

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 700;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
}

.menu-toggle-text {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Hero Section */
.hero {
    position: relative;
    height: calc(100vh - 70px);
    min-height: 500px;
    background-image: url('assets/images/hero_dental_banner_1787017849452.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Alineado a la izquierda para mejor visibilidad del texto */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(var(--overlay-rgb), 0.95) 0%, rgba(var(--overlay-rgb), 0.75) 50%, rgba(var(--overlay-rgb), 0) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
    padding: 2rem;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw + 1rem, 3.5rem); /* Tipografía fluida */
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: clamp(1.05rem, 2vw + 0.5rem, 1.25rem);
    color: var(--text-dark);
    margin-bottom: 2rem;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px; /* Tap Target Optimization */
    padding: 0.8rem 2rem;
    font-size: clamp(0.95rem, 1vw + 0.8rem, 1.05rem);
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 14px 0 rgba(13, 148, 136, 0.39);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(13, 148, 136, 0.39);
}

.full-width {
    width: 100%;
}

/* Secciones genéricas */
.section {
    padding: 5rem 0;
}

.bg-light { background-color: var(--bg-light); }
.bg-primary { background-color: var(--primary-color); }
.bg-white { background-color: var(--white); }

.section-title {
    font-size: clamp(1.8rem, 4vw + 0.5rem, 2.5rem); /* Tipografía fluida */
    color: var(--primary-dark);
    margin-bottom: 2rem;
    position: relative;
}

/* Grids */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.align-center {
    align-items: center;
}

.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

/* Imágenes */
.rounded-image {
    width: 100%;
    border-radius: 16px;
    display: block;
}

.full-width-image {
    max-height: 400px;
    object-fit: cover;
}

.shadow {
    box-shadow: var(--shadow-md);
}

/* Cards de Servicios */
.card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid #f1f5f9;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--secondary-color);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background-color: var(--secondary-color);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.card-title {
    font-size: 1.25rem;
    color: var(--primary-dark);
}

/* FAQ (Acordeón nativo) */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background-color: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-question {
    padding: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--primary-dark);
    list-style: none; /* Oculta la flecha por defecto en algunos navegadores */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

details[open] .faq-question::after {
    content: '−';
}

.faq-answer {
    padding: 0 1.2rem 1.2rem;
    color: var(--text-light);
}

/* Contacto y Formulario */
.contact-list {
    list-style: none;
    margin-top: 2rem;
}

.contact-list li {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.location-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.contact-list-location {
    margin-bottom: 0;
}

.contact-list address {
    font-style: normal;
}

.map-container {
    flex: 1;
    min-height: 300px;
    display: flex;
}

.map-iframe {
    flex: 1;
    border: 0;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

/* Redes Sociales */
.social-links {
    display: flex;
    gap: 1rem;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px; /* Tap Target Optimization (mínimo 48px) */
    height: 48px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    transition: var(--transition);
    text-decoration: none;
}

.social-icon:hover {
    background-color: var(--white);
    color: var(--primary-color);
    transform: translateY(-3px);
}

.rounded-form {
    padding: 2.5rem;
    border-radius: 16px;
}

.appointment-title {
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.appointment-description {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.form-status {
    min-height: 1.5rem;
    margin: 1rem 0 0;
    color: var(--primary-dark);
    font-size: 0.95rem;
    font-weight: 600;
}

.form-status:not(.is-visible) {
    visibility: hidden;
}

.honeypot-field {
    display: none;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 48px; /* Tap Target Optimization */
    padding: 0.8rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: clamp(1rem, 1vw + 0.8rem, 1.05rem);
    color: var(--text-dark);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

/* Footer */
.footer {
    background-color: var(--text-dark);
    color: var(--white);
    padding: 2rem 0;
}

.footer p {
    margin: 0;
    color: #94a3b8;
}

.schedule-item {
    margin-bottom: 0.5rem !important;
}

.social-links {
    gap: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.developer-link {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

/* Responsividad */
@media (max-width: 992px) {
    .grid-2-col {
        grid-template-columns: 1fr;
    }
    #contacto .contact-form {
        order: -1;
    }
    .grid-3-col {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero h1 {
        font-size: 2.8rem;
    }
    .hero-overlay {
        background: rgba(var(--overlay-rgb), 0.85); /* Overlay dinámico en móvil */
    }
}

@media (max-width: 768px) {
    .footer {
        padding-bottom: 6rem; /* Evita que el botón de menú flotante tape el texto */
    }
    
    .nav-container {
        justify-content: center;
    }
    
    .hero {
        justify-content: center;
        text-align: center;
    }
    
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-bottom: 6rem; /* Espacio para que el botón de Agendar no choque con el botón flotante de menú */
    }

    .menu-toggle {
        display: flex;
        position: fixed;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        background-color: var(--primary-color);
        color: #ffffff !important;
        padding: 0.8rem 1.5rem;
        border-radius: 50px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        z-index: 1002; /* Sobre el bottom sheet */
        align-items: center;
        gap: 0.5rem;
    }
    
    .menu-toggle svg {
        stroke: #ffffff !important;
    }
    
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 999; /* Debajo del nav */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }
    
    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .nav {
        position: fixed;
        bottom: -100%; /* Inicia oculto abajo */
        left: 0;
        top: auto;
        width: 100%;
        height: auto;
        max-height: 85vh; /* Altura máxima */
        background-color: var(--header-bg);
        flex-direction: column;
        transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efecto rebote suave */
        box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
        overflow-y: auto;
        z-index: 1001; /* Sobre el overlay */
        border-radius: 24px 24px 0 0; /* Estilo Bottom Sheet */
        padding-bottom: 3rem; /* Espacio extra abajo */
    }
    
    .nav.active {
        bottom: 0;
    }

    /* Línea indicadora superior (Handle) */
    .nav::before {
        content: '';
        display: block;
        width: 40px;
        height: 5px;
        background-color: var(--text-light);
        border-radius: 10px;
        margin: 1rem auto;
        opacity: 0.5;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        padding: 3rem 0;
        gap: 2.5rem;
    }
    
    .grid-3-col {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.2rem;
    }
}

/* --- Scroll Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Pulse Animation for Hero Button --- */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 169, 184, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(0, 169, 184, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 169, 184, 0); }
}

.btn-pulse {
    animation: pulse 2s infinite;
}

.btn-pulse:hover {
    animation: none;
    transform: translateY(-2px);
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

/* --- MODO OSCURO (Auto-detect) --- */
@media (prefers-color-scheme: dark) {
    :root {
        /* Inversión de colores */
        --secondary-color: #1e293b;
        --text-dark: #f8fafc;
        --text-light: #94a3b8;
        --white: #0f172a;
        --bg-light: #020617;
        
        /* Ajuste de colores primarios para mayor contraste */
        --primary-dark: #4DD0E1; 
        
        /* Variables estructurales dinámicas */
        --overlay-rgb: 15, 23, 42;
        --header-bg: rgba(15, 23, 42, 0.95);
        --input-border: #334155;
        
        /* Sombras adaptadas a fondos oscuros */
        --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    }

    /* Correcciones específicas para modo oscuro */
    .form-group input,
    .form-group select,
    .form-group textarea {
        background-color: #1e293b;
        color: #f8fafc;
    }

    .form-group input::placeholder,
    .form-group textarea::placeholder {
        color: #64748b;
    }

    .faq-item {
        border-bottom-color: #334155;
    }

    /* Ajuste de la sección Contacto para que no encandile */
    .bg-primary {
        background-color: #003747; 
    }

    /* Footer más profundo */
    .footer {
        background-color: #020617;
        border-top: 1px solid #1e293b;
    }
}
