/* --- VARIABLES GLOBALES --- */
:root {
    --primary-blue: #1a3a5a;    /* Azul corporativo Loira */
    --medical-green: #27ae60;   /* Verde para acentos médicos */
    --text-gray: #444;          /* Color de texto principal */
    --light-bg: #f4f7f6;        /* Fondo gris muy claro */
    --white: #ffffff;
    --naranja: #e6631c;
    --naranja-hover: #d35400;
}

/* --- RESET Y GENERAL --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-gray);
    background-color: var(--white);
    overflow-x: hidden;
}

main {
    min-height: 70vh; 
}

/* --- HEADER Y NAVEGACIÓN --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8%;
    background: var(--primary-blue);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 80px; 
}

.nav-logo {
    height: 60px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li a {
    text-decoration: none;
    padding: 10px 20px;
    color: var(--white);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s;
}

nav ul li a:hover, 
nav ul li a.active { 
    color: var(--naranja); 
}

.menu-toggle {
    display: none; 
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    color: #ffffff !important;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1001;
    width: 45px;
    height: 45px;
    padding: 0;
}

/* --- SECCIÓN BUSCADOR --- */
.search-section {
    background: linear-gradient(rgba(26, 58, 90, 0.85), rgba(26, 58, 90, 0.85)), url('../imagenes/FondoIndex.jpg') center/cover no-repeat;
    padding: 80px 10%;
    text-align: center;
    color: white;
}

.search-section h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 15px;
}

.search-container {
    max-width: 700px;
    margin: 40px auto 0;
    display: flex;
    gap: 15px;
    background: white;
    padding: 10px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.select-wrapper {
    flex: 2;
    display: flex;
    align-items: center;
    padding-left: 20px;
    color: var(--primary-blue);
}

.select-wrapper i {
    font-size: 1.2rem;
    margin-right: 10px;
}

#specialtySelect {
    width: 100%;
    padding: 12px;
    border: none;
    font-size: 1rem;
    outline: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.btn-search {
    flex: 1;
    background: var(--naranja);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-search:hover {
    background: var(--naranja-hover);
    transform: translateY(-2px);
}

/* --- GRILLA DE RESULTADOS Y TARJETAS --- */
.results-container {
    padding: 60px 10%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    background-color: var(--light-bg);
}

.doctor-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border-top: 6px solid var(--primary-blue);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.doctor-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

/* NUEVO: Contenedor circular para la foto del doctor */
.doctor-photo-container {
    width: 130px;
    height: 130px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--light-bg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background-color: #f0f4f8;
}

/* NUEVO: Ajuste de la imagen del doctor */
.doctor-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Mantiene la proporción sin deformar */
    display: block;
}

.doctor-card h3 {
    color: var(--primary-blue);
    margin: 10px 0;
    font-size: 1.3rem;
}

.specialty-label {
    display: block;
    color: var(--medical-green);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 25px;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #25d366;
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.95rem;
    transition: opacity 0.3s;
}

.btn-whatsapp:hover {
    opacity: 0.9;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #bbb;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

/* --- HOME PAGE --- */
.hero {
    position: relative;
    min-height: calc(100vh - 80px);
    background: linear-gradient(rgba(26, 58, 90, 0.55), rgba(26, 58, 90, 0.55)), url('../imagenes/FondoIndex.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.quick-services,
.welcome,
.directory {
    padding: 80px 10%;
}

.quick-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    background: var(--light-bg);
}

.service-card {
    background: var(--white);
    border-radius: 24px;
    padding: 35px 25px;
    text-align: center;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.service-card i {
    color: var(--primary-blue);
    font-size: 2.2rem;
    margin-bottom: 18px;
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--primary-blue);
}

.service-card p {
    color: var(--text-gray);
    line-height: 1.8;
}

.welcome {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.welcome-text h2 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin-bottom: 20px;
    color: var(--primary-blue);
}

.welcome-text p {
    margin-bottom: 20px;
    color: var(--text-gray);
}

.btn-more {
    display: inline-block;
    background: var(--naranja);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.btn-more:hover {
    background: var(--naranja-hover);
    transform: translateY(-2px);
}

.welcome-video .video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.welcome-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.directory h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 18px;
    color: var(--primary-blue);
}

.directory p {
    max-width: 760px;
    color: var(--text-gray);
    line-height: 1.8;
    margin-bottom: 25px;
}


footer {
    background: var(--primary-blue);
    color: var(--white);
    padding: 60px 10% 30px 10%;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

/* --- MEDIA QUERIES (Móvil) --- */
@media (max-width: 768px) {
    header {
        padding: 0 5%;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    nav {
        position: absolute;
        top: 80px; 
        left: 0;
        width: 100%;
        background: var(--primary-blue);
        flex-direction: column;
        max-height: 0; 
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        box-shadow: 0 10px 15px rgba(0,0,0,0.3);
    }

    nav.active {
        max-height: 600px; 
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        padding: 10px 0;
    }

    nav ul li a {
        padding: 18px;
        display: block;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .search-container {
        flex-direction: column;
        border-radius: 20px;
        padding: 20px;
    }

    .select-wrapper {
        padding-left: 0;
        margin-bottom: 10px;
    }

    .btn-search {
        width: 100%;
    }

    .search-section {
        padding: 60px 5%;
    }
    
}