/* CSS Variables - Color Palette */
:root {
    --primary-purple: #5B378A;
    --secondary-pink: #EAD8E9;
    --accent-pink: #D94A8C;
    --text-dark: #333333;
    --background-light: #FCFAFF;
    --white: #FFFFFF;
    --gradient: linear-gradient(120deg, #5B378A, #A16B9F);
    
    /* Typography */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Lato', sans-serif;
    
    /* Spacing */
    --section-padding: 80px 0;
    --container-max-width: 1200px;
    --border-radius: 12px;
    --border-radius-button: 30px;
    
    /* Shadows */
    --shadow-light: 0 4px 15px rgba(91, 55, 138, 0.08);
    --shadow-medium: 0 8px 25px rgba(91, 55, 138, 0.15);
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-light);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-purple);
}

h2 {
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--primary-purple);
}

h3 {
    font-size: 1.5rem;
    font-weight: 500;
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

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

/* Container and Layout */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section__title {
    text-align: center;
    margin-bottom: 1rem;
}

.section__subtitle {
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-dark);
    margin-bottom: 3rem;
    opacity: 0.8;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-family: var(--font-heading);
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: var(--border-radius-button);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 1rem;
}

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

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

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

.btn--secondary:hover {
    background-color: var(--secondary-pink);
    transform: translateY(-2px);
}

.btn--outline {
    background: transparent;
    color: var(--primary-purple);
    border: 1px solid var(--primary-purple);
    padding: 10px 20px;
    font-size: 0.9rem;
}

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

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

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(252, 250, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid var(--secondary-pink);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav__logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-purple);
}

.nav__menu {
    display: flex;
}

.nav__list {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav__link {
    font-weight: 500;
    color: var(--text-dark);
    position: relative;
}

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

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

.nav__link:hover::after {
    width: 100%;
}

.nav__toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

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

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: var(--gradient);
    color: var(--white);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero__title {
    color: var(--white);
    margin-bottom: 1.5rem;
}

.hero__subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

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

.hero__image {
    text-align: center;
}

.hero__image img {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    max-height: 500px;
    object-fit: cover;
}

/* Certifications Section */
.certifications {
    padding: var(--section-padding);
    background-color: var(--white);
}

.certifications__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.certification__item {
    text-align: center;
    padding: 2rem;
    background-color: var(--secondary-pink);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.certification__item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

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

/* Services Section */
.services {
    padding: var(--section-padding);
    background-color: var(--background-light);
}

.services__category {
    margin-bottom: 4rem;
}

.services__category-title {
    font-size: 1.75rem;
    color: var(--primary-purple);
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.services__category-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--accent-pink);
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service__card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    text-align: center;
}

.service__card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.service__icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.service__title {
    color: var(--primary-purple);
    margin-bottom: 1rem;
}

.service__description {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Doctors Section */
.doctors {
    padding: var(--section-padding);
    background-color: var(--white);
}

.doctors__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.doctor__card {
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.doctor__card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.doctor__image {
    height: 300px;
    overflow: hidden;
}

.doctor__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doctor__content {
    padding: 2rem;
}

.doctor__name {
    color: var(--primary-purple);
    margin-bottom: 0.5rem;
}

.doctor__specialty {
    color: var(--accent-pink);
    font-weight: 600;
    margin-bottom: 1rem;
}

.doctor__description {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.doctor__contact p {
    margin-bottom: 1rem;
}

.doctor__contact a[href^="tel"] {
    color: var(--primary-purple);
    font-weight: 600;
}

/* Schedule Section */
.schedule {
    padding: var(--section-padding);
    background-color: var(--secondary-pink);
}

.schedule__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.schedule__card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    text-align: center;
}

.schedule__doctor {
    color: var(--primary-purple);
    margin-bottom: 1.5rem;
}

.schedule__times {
    margin-bottom: 2rem;
}

.schedule__time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background-color: var(--background-light);
    border-radius: 8px;
}

.schedule__day {
    font-weight: 600;
    color: var(--text-dark);
}

.schedule__hours {
    color: var(--primary-purple);
    font-weight: 600;
}

/* Contact Section */
.contact {
    padding: var(--section-padding);
    background-color: var(--white);
}

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

.contact__subtitle {
    color: var(--primary-purple);
    margin-bottom: 2rem;
}

/* Form Styles */
.contact__form {
    background-color: var(--background-light);
    padding: 2rem;
    border-radius: var(--border-radius);
}

.form__group {
    margin-bottom: 1.5rem;
}

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

.form__input,
.form__textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #CCCCCC;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.form__input:focus,
.form__textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(91, 55, 138, 0.1);
}

.form__textarea {
    resize: vertical;
    min-height: 120px;
}

/* Contact Info */
.contact__item {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.contact__details a {
    color: var(--accent-pink);
    font-weight: 600;
}

.contact__social {
    margin-top: 2rem;
}

.social__links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--secondary-pink);
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 600;
}

.social__link:hover {
    background-color: var(--primary-purple);
    color: var(--white);
    transform: translateY(-2px);
}

/* Map */
.contact__map {
    margin-top: 3rem;
}

.map__container {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

/* Footer */
.footer {
    background-color: var(--primary-purple);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer__content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer__logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer__logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.footer__info,
.footer__contact {
    font-size: 0.95rem;
}

.footer__contact a,
.footer__social a {
    color: var(--secondary-pink);
    transition: var(--transition);
}

.footer__contact a:hover,
.footer__social a:hover {
    color: var(--white);
}

.footer__social {
    display: flex;
    gap: 1rem;
}

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

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
    z-index: 1000;
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
}

.whatsapp-icon {
    font-size: 1.5rem;
    color: var(--white);
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.6);
    }
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero__container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .contact__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .doctors__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav__menu {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: var(--shadow-medium);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }
    
    .nav__menu.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav__list {
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
    }
    
    .nav__toggle {
        display: flex;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .hero {
        padding: 100px 0 60px;
        text-align: center;
    }
    
    .hero__buttons {
        justify-content: center;
    }
    
    .services__grid,
    .doctors__grid,
    .schedule__grid {
        grid-template-columns: 1fr;
    }
    
    .certifications__grid {
        grid-template-columns: 1fr;
    }
    
    .footer__content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer__social {
        justify-content: center;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-icon {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    .hero__buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .service__card,
    .doctor__card,
    .schedule__card {
        padding: 1.5rem;
    }
    
    .contact__form {
        padding: 1.5rem;
    }
    
    .doctors__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .schedule__time {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

/* Performance Optimizations */
.hero__image img,
.doctor__image img {
    will-change: transform;
}

/* Smooth scrolling for anchor links */
html {
    scroll-padding-top: 80px;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .whatsapp-float {
        animation: none;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.form__input:focus,
.form__textarea:focus,
.nav__link:focus {
    outline: 2px solid var(--accent-pink);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .whatsapp-float,
    .contact__form {
        display: none;
    }
    
    .hero {
        background: none;
        color: var(--text-dark);
    }
    
    .hero__title {
        color: var(--text-dark);
    }
}

/* Fix for Agendar Cita button text color */
.btn--primary,
.btn--primary:visited,
.nav__link.btn.btn--primary {
    color: var(--white) !important;
}

/* WhatsApp Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white);
    margin: 10% auto;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-medium);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--accent-pink);
}

.modal-content h3 {
    color: var(--primary-purple);
    font-family: var(--font-heading);
    margin-bottom: 10px;
    text-align: center;
}

.modal-content p {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.doctor-selector {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.doctor-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid var(--secondary-pink);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    background: var(--background-light);
}

.doctor-option:hover {
    border-color: var(--primary-purple);
    background: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.doctor-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid var(--secondary-pink);
}

.doctor-info h4 {
    color: var(--primary-purple);
    font-family: var(--font-heading);
    margin-bottom: 5px;
}

.doctor-info p {
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.doctor-info .phone {
    color: var(--accent-pink);
    font-weight: bold;
    font-size: 0.9rem;
}

/* WhatsApp Float Button Fix */
.whatsapp-float {
    background: none;
    border: none;
}

/* Mobile responsiveness for modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 20% auto;
        padding: 20px;
        width: 95%;
    }
    
    .doctor-option {
        flex-direction: column;
        text-align: center;
    }
    
    .doctor-avatar {
        margin-right: 0;
        margin-bottom: 10px;
    }
}
