/* ===== Variables CSS ===== */
:root {
    --primary-color: #0052CC;
    --primary-dark: #1E3A5F;
    --primary-light: #00CED1;
    --secondary-color: #E31C23;
    --accent-color: #c2aa25;
    --text-color: #1E3A5F;
    --text-light: #666666;
    --bg-color: #FFFFFF;
    --bg-light: #f8f9fa;
    --bg-dark: #1E3A5F;
    --border-color: #CCCCCC;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --border-radius-lg: 16px;
}

/* ===== Reset y Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

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

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

.section__title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section__subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* ===== Botones ===== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
}

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

.btn--primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn--secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.btn--full {
    width: 100%;
}

/* ===== Header / Navegación ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    z-index: 1000;
}

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

.nav__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav__logo-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.nav__menu {
    display: flex;
    gap: 2rem;
}

.nav__link {
    color: var(--text-color);
    font-weight: 500;
    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::after,
.nav__link.active::after {
    width: 100%;
}

.nav__link:hover,
.nav__link.active {
    color: var(--primary-color);
}

.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav__toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding-top: 70px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/><circle cx="50" cy="50" r="30" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/><circle cx="50" cy="50" r="20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></svg>');
    background-size: 200px 200px;
    opacity: 0.5;
}

.hero__content {
    text-align: center;
    color: white;
    position: relative;
    z-index: 1;
}

.hero__logo {
    max-width: 280px;
    height: auto;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.hero__title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero__subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.hero__description {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

.hero__buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero .btn--primary {
    background-color: white;
    color: var(--primary-color);
}

.hero .btn--primary:hover {
    background-color: var(--bg-light);
}

.hero .btn--secondary {
    border-color: white;
    color: white;
}

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

.hero .btn--secondary:active,
.hero .btn--secondary:focus {
    background-color: transparent;
    color: white;
    outline: none;
}

/* ===== About Section ===== */
.about {
    padding: 100px 0;
    background-color: var(--bg-light);
}

.about__content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    margin-top: 3rem;
}

.about__text p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-size: 1.05rem;
}

.about__list {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.about__list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

.about__list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

.about__video h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

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

/* ===== Services Section ===== */
.services {
    padding: 80px 0;
}

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

.service-card {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.service-card__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-card__title {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-card__description {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ===== Doctors Section ===== */
.doctors {
    padding: 80px 0;
    background-color: var(--bg-light);
}

.doctors__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background-color: var(--bg-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.doctors__filters .btn {
    min-width: auto;
    white-space: nowrap;
}

.doctors__filters-buttons {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.filter-group select {
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

.filter-group__cp {
    display: flex;
    gap: 0.5rem;
}

.filter-group__cp input {
    flex: 1;
}

.btn--sm {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn--sm svg {
    width: 18px;
    height: 18px;
}

.doctors__content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    min-height: 420px;
}

.doctors__map {
    background-color: var(--bg-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

#map {
    width: 100%;
    height: 100%;
    min-height: 420px;
}

.doctors__list {
    background-color: var(--bg-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 1rem;
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.doctors__loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

/* Doctor Card */
.doctor-card {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.doctor-card:hover {
    border-color: var(--primary-color);
    background-color: rgba(26, 95, 122, 0.05);
}

.doctor-card.active {
    border-color: var(--primary-color);
    background-color: rgba(26, 95, 122, 0.1);
    position: relative;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.doctor-card.active::after {
    content: '✕ Clic para deseleccionar';
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.doctor-card.active:hover::after {
    opacity: 1;
}

.doctor-card__header {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.doctor-card__info {
    flex: 1;
}

.doctor-card__distance {
    display: flex;
    align-items: flex-start;
}

.distance-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.doctors-list__header {
    background-color: var(--primary-light);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-weight: 500;
}

.doctors-list__header p {
    margin: 0;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(227, 28, 35, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(227, 28, 35, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(227, 28, 35, 0);
    }
}

.doctor-card__avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
}

.doctor-card__info h4 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.doctor-card__specialty {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 500;
}

.doctor-card__details {
    font-size: 0.85rem;
    color: var(--text-light);
}

.doctor-card__details p {
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.doctor-card__details .icon {
    font-size: 1rem;
}

/* ===== Contact Section ===== */
.contact {
    padding: 80px 0;
}

.contact__content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2.5rem;
}

.contact__info h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.contact__info p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.contact__details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
}

.contact__icon {
    font-size: 1.5rem;
}

.contact__form {
    background-color: var(--bg-light);
    padding: 1.75rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ===== Social Section ===== */
.social-section {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.social-section .section__title {
    color: white;
}

.social-section .section__subtitle {
    color: rgba(255, 255, 255, 0.9);
}

.social-section__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.social-card {
    background-color: white;
    padding: 3rem 2rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    transition: var(--transition);
    text-decoration: none;
    display: block;
}

.social-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.social-card__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
}

.social-card__icon svg {
    width: 100%;
    height: 100%;
}

.social-card__title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.social-card__description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.social-card__link {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.social-card--facebook:hover .social-card__link {
    color: #1877F2;
}

.social-card--instagram:hover .social-card__link {
    color: #E4405F;
}

.social-card--twitter:hover .social-card__link {
    color: #1DA1F2;
}

.social-card--youtube:hover .social-card__link {
    color: #FF0000;
}

@media (max-width: 768px) {
    .social-section__grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        gap: 1.5rem;
    }
    
    .social-card {
        padding: 2.5rem 2rem;
    }
}

/* ===== Footer ===== */
.footer {
    background-color: var(--bg-dark);
    color: white;
    padding: 60px 0 20px;
}

.footer__content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer__logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.footer__brand p {
    opacity: 0.9;
}

.footer__tagline {
    opacity: 0.7;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.footer__links h4,
.footer__social h4 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer__links ul li {
    margin-bottom: 0.75rem;
}

.footer__links a {
    opacity: 0.8;
    transition: var(--transition);
}

.footer__links a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 28px;
    height: 28px;
    transition: var(--transition);
    display: inline-block;
}

.social-link svg {
    width: 100%;
    height: 100%;
}

.social-link:hover {
    transform: scale(1.2);
}

.footer__bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* ===== Leaflet Custom Styles ===== */
.leaflet-popup-content-wrapper {
    border-radius: var(--border-radius);
}

.leaflet-popup-content {
    margin: 15px;
}

.popup-content h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.popup-content p {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.popup-content .specialty {
    color: var(--accent-color);
    font-weight: 500;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .about__content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .services__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .doctors__content {
        grid-template-columns: 1fr;
    }

    .doctors__list {
        max-height: 400px;
    }

    .contact__content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .footer__content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav__menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--bg-color);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: var(--shadow);
        transform: translateY(-150%);
        transition: var(--transition);
        opacity: 0;
    }

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

    .nav__toggle {
        display: flex;
    }

    .nav__toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav__toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav__toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hero {
        padding-top: 100px;
        padding-bottom: 3rem;
    }

    .hero__logo {
        max-width: 220px;
    }

    .hero__title {
        font-size: 2.5rem;
    }

    .hero__subtitle {
        font-size: 1.2rem;
    }

    .section__title {
        font-size: 2rem;
    }

    .services__grid {
        grid-template-columns: 1fr;
    }

    .doctors__filters {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .footer__content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero__title {
        font-size: 2rem;
    }

    .hero__buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .doctor-card__header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* ===== Animaciones ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.doctor-card {
    animation: fadeIn 0.3s ease forwards;
}

/* Scrollbar personalizada */
.doctors__list::-webkit-scrollbar {
    width: 8px;
}

.doctors__list::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 4px;
}

.doctors__list::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

.doctors__list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* No results message */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.no-results h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
