/* CEMEPROS - Central de Turnos Styles */

/* ========== VARIABLES CSS ========== */
:root {
    --green-cemepros: #79cdb7;
    --blue-cemepros: #314855;
    --dark-cemepros: #31485b;
}

/* ========== ESTILOS BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafb;
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* font-display swap para mejorar performance */
@font-face {
    font-family: 'Inter';
    font-display: swap;
}

/* ========== CLASES UTILITARIAS ========== */
.text-green-cemepros {
    color: var(--green-cemepros);
}

.bg-green-cemepros {
    background-color: var(--green-cemepros);
}

.text-blue-cemepros {
    color: var(--blue-cemepros);
}

.bg-dark-cemepros {
    background-color: var(--dark-cemepros);
}

.invert-white {
    filter: brightness(0) invert(1);
}

.btn-whatsapp {
    background-color: #25D366;
}

/* ========== MODAL ========== */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

/* ========== WHATSAPP FLOATING BUTTON ========== */
.whatsapp-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 50;
}

.whatsapp-floating a {
    display: block;
    transition: transform 0.3s ease;
}

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

.whatsapp-floating img {
    width: 4rem;
    height: 4rem;
}

.whatsapp-tooltip {
    position: absolute;
    right: 100%;
    bottom: 50%;
    transform: translateY(50%);
    margin-right: 1rem;
    padding: 0.5rem 1rem;
    background-color: white;
    color: var(--blue-cemepros);
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.whatsapp-floating:hover .whatsapp-tooltip {
    opacity: 1;
}

/* ========== HEADER / HERO SECTION ========== */
.hero-section {
    background-color: var(--dark-cemepros);
    padding: 3rem 1rem;
    text-align: center;
    border-radius: 0 0 1.5rem 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.hero-logo {
    filter: brightness(0) invert(1);
    height: 6rem;
    margin: 0 auto 1.5rem;
    object-fit: contain;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
}

.hero-subtitle {
    margin-top: 1rem;
    font-size: 1.25rem;
    font-weight: 500;
    color: white;
}

.hero-button {
    margin-top: 2rem;
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    background-color: var(--green-cemepros);
    color: white;
    text-decoration: none;
}

.hero-button:hover {
    transform: scale(1.05);
}

/* ========== SECCIONES GENERALES ========== */
.section {
    padding: 4rem 1rem;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--blue-cemepros);
}

/* ========== FORMULARIO DE TURNOS ========== */
.form-container {
    max-width: 36rem;
    margin: 0 auto;
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

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

.form-label {
    display: block;
    color: #374151;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    outline: none;
    transition: all 0.3s ease;
    background-color: white;
}

.form-input:focus,
.form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.5);
    outline: 2px solid transparent;
}

.form-button {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    background-color: var(--green-cemepros);
    color: white;
    border: none;
    cursor: pointer;
}

.form-button:hover {
    transform: scale(1.05);
}

.form-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== TARJETAS DE ESPECIALIDADES ========== */
.specialties-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

@media (min-width: 640px) {
    .specialties-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .specialties-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .specialties-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.specialty-card {
    background-color: var(--green-cemepros);
    padding: 1.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.specialty-card:hover {
    transform: scale(1.05);
}

.specialty-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

/* ========== TARJETAS DE DOCTORES ========== */
.doctors-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

@media (min-width: 640px) {
    .doctors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .doctors-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .doctors-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.doctor-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.doctor-card:hover {
    transform: scale(1.05);
}

.doctor-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.doctor-card p {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ========== SEDES / UBICACIONES ========== */
.locations-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .locations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.location-card {
    background-color: white;
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.location-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
}

.location-map {
    width: 100%;
    height: 16rem;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.location-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.location-info {
    width: 100%;
    text-align: center;
}

.location-info p {
    color: #4b5563;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.location-info p span {
    font-weight: 700;
}

/* ========== PÁGINA DE GRACIAS ========== */
.thank-you-container {
    max-width: 42rem;
    margin: 0 auto;
    background-color: white;
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.thank-you-icon {
    height: 6rem;
    width: 6rem;
    margin: 0 auto 1.5rem;
    color: var(--green-cemepros);
}

.thank-you-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--blue-cemepros);
    margin-bottom: 1rem;
}

.thank-you-text {
    font-size: 1.125rem;
    color: #374151;
    margin-bottom: 2rem;
}

.thank-you-button {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    background-color: var(--green-cemepros);
    color: white;
    text-decoration: none;
}

.thank-you-button:hover {
    transform: scale(1.05);
}

/* ========== FOOTER ========== */
.footer {
    background-color: var(--dark-cemepros);
    color: white;
    padding: 1.5rem;
    margin-top: 3rem;
    text-align: center;
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.footer p {
    color: white;
}

/* ========== SELECTOR DE SEDE ========== */
.sede-selector-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .sede-selector-container {
        flex-direction: row;
    }
}

.sede-selector-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--blue-cemepros);
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .sede-selector-label {
        margin-bottom: 0;
        margin-right: 1rem;
    }
}

.sede-selector-select {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 2px solid var(--green-cemepros);
    outline: none;
    color: var(--blue-cemepros);
}

@media (min-width: 640px) {
    .sede-selector-select {
        width: auto;
    }
}

.sede-selector-select:focus {
    box-shadow: 0 0 0 2px var(--green-cemepros);
    outline: 2px solid transparent;
}

/* ========== RESPONSIVE ========== */
@media (min-width: 640px) {
    .hero-logo {
        height: 8rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 2.25rem;
    }
}

@media (min-width: 1024px) {
    .hero-logo {
        height: 10rem;
    }

    .hero-title {
        font-size: 3.75rem;
    }

    .section-title {
        font-size: 2.25rem;
    }
}

/* ========== HIDDEN IFRAME ========== */
#hidden-iframe {
    display: none;
    visibility: hidden;
    width: 0;
    height: 0;
    border: 0;
}

/* ========== FOCUS VISIBLE - ACCESIBILIDAD ========== */
:focus-visible {
    outline: 3px solid var(--green-cemepros);
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 3px solid var(--green-cemepros);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========== MOBILE NAV CLOSE BUTTON ========== */
.mobile-nav-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.mobile-nav-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* ========== GOOGLE TAG MANAGER NOSCRIPT ========== */
noscript iframe {
    display: none;
    visibility: hidden;
}

/* ========== IFRAME MAPS ========== */
iframe[src*="google.com/maps"] {
    border: 0;
    width: 100%;
    height: 100%;
}

/* ========== NAVIGATION MENU ========== */
.nav-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 50;
}

.nav-menu-button {
    background-color: white;
    color: var(--blue-cemepros);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu-button:hover {
    background-color: var(--green-cemepros);
    color: white;
    transform: scale(1.05);
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    min-width: 280px;
    max-height: 500px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.nav-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--blue-cemepros);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-dropdown a:hover {
    background-color: var(--green-cemepros);
    color: white;
}

.nav-dropdown a:first-child {
    border-radius: 1rem 1rem 0 0;
}

.nav-dropdown a:last-child {
    border-radius: 0 0 1rem 1rem;
}

.nav-dropdown-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 0.5rem 0;
}

/* Mobile Menu */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80%;
    max-width: 320px;
    background-color: white;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-nav-menu.active {
    transform: translateX(0);
}

.mobile-nav-header {
    background-color: var(--dark-cemepros);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-nav-header h2 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

.mobile-nav-close {
    color: white;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
}

.mobile-nav-links {
    padding: 1rem 0;
}

.mobile-nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--blue-cemepros);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.mobile-nav-links a:hover {
    background-color: #f3f4f6;
    border-left-color: var(--green-cemepros);
    color: var(--green-cemepros);
}

@media (min-width: 768px) {
    .mobile-menu-button {
        display: none;
    }
}

@media (max-width: 767px) {
    .desktop-menu-button {
        display: none;
    }
}
