:root {
    --gold: #C5A880;
    --gold-hover: #b09168;
    --dark: #12181f;
    --dark-light: #1c2530;
    --text-gray: #64748b;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--dark);
    background-color: var(--white);
    line-height: 1.6;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid #edf2f7;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 85px;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.brand-logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    letter-spacing: 1px;
}

.brand-sub {
    font-size: 0.65rem;
    color: var(--gold);
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--gold);
}

/* Botones */
.btn-gold-sm {
    background: var(--gold);
    color: var(--white) !important;
    padding: 10px 18px;
    border-radius: 2px;
}

.btn-gold {
    background: var(--gold);
    color: var(--white);
    padding: 15px 30px;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 1px;
    display: inline-block;
    transition: background 0.3s;
}

.btn-gold:hover {
    background: var(--gold-hover);
}

.btn-whatsapp {
    background: transparent;
    color: var(--white);
    border: 1px solid var(--white);
    padding: 14px 28px;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-whatsapp:hover {
    background: var(--white);
    color: var(--dark);
}

/* Hero */
.hero {
    position: relative;
    background: url('img/centro.webp') center/cover no-repeat;
    padding: 160px 0 120px;
    color: var(--white);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(18,24,31,0.92) 0%, rgba(18,24,31,0.65) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

.hero-subtitle {
    color: var(--gold);
    font-size: 0.8rem;
    letter-spacing: 3px;
    font-weight: 600;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: 3.2rem;
    font-weight: 400;
    line-height: 1.2;
    margin: 15px 0 20px;
}

.hero p {
    font-size: 1.05rem;
    color: #d1d5db;
    margin-bottom: 35px;
}

.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Encabezados */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    font-weight: 400;
}

.gold-line {
    width: 60px;
    height: 2px;
    background: var(--gold);
    margin: 15px auto;
}

/* Tarjetas y Grilla de Especialidades */
.services {
    padding: 100px 0;
    background: var(--light-bg);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.cards-grid .card:nth-child(4) {
    grid-column: 2;
}

.card {
    background: var(--white);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.card-img {
    height: 220px;
    background-size: cover;
    background-position: center;
}

.card-content {
    padding: 30px;
}

.card-tag {
    font-size: 0.7rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.card h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin: 8px 0 12px;
}

.card p {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.card-btn {
    color: var(--dark);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--gold);
    padding-bottom: 2px;
}

/* Perfil */
.doctor-profile {
    padding: 100px 0;
}

.doctor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.doctor-img img {
    width: 100%;
    border-radius: 2px;
    box-shadow: 20px 20px 0px var(--gold);
}

.doctor-info .gold-line {
    margin: 15px 0 25px;
}

.doctor-info h2 {
    font-family: var(--font-serif);
    font-size: 2.6rem;
}

.lead {
    font-size: 1.1rem;
    color: var(--dark);
    font-weight: 500;
    margin-bottom: 15px;
}

.doctor-info p {
    color: var(--text-gray);
    margin-bottom: 20px;
}

.credentials-list {
    list-style: none;
}

.credentials-list li {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--dark);
}

.credentials-list span {
    color: var(--gold);
    font-weight: bold;
    margin-right: 8px;
}

/* Respaldos Institucionales / Afiliaciones */
.doctor-affiliations {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
}

.affiliation-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #f8fafc;
    padding: 18px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.affiliation-logo {
    width: 180px !important;
    max-width: 90% !important;
    height: auto !important;
    min-height: 50px !important;
    max-height: none !important;
    object-fit: contain !important;
    margin-bottom: 8px;
    display: block !important;
}

.affiliation-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.affiliation-info strong {
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 600;
    line-height: 1.2;
}

.affiliation-info span {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.2;
}

/* Forzado específico para Celular */
@media screen and (max-width: 768px) {
    .doctor-affiliations {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .affiliation-card {
        padding: 20px 10px !important;
    }

    /* Agrandamos la imagen forzando escala y eliminando límites */
    .affiliation-card img.affiliation-logo {
        width: 260px !important;
        max-width: 95% !important;
        height: 75px !important;
        min-height: 75px !important;
        object-fit: contain !important;
        transform: scale(1.25) !important;
        margin: 10px 0 14px 0 !important;
    }

    .affiliation-info strong {
        font-size: 0.95rem !important;
    }

    .affiliation-info span {
        font-size: 0.8rem !important;
    }
}

/* Testimonios */
.testimonials {
    padding: 80px 0;
    background: var(--dark);
    color: var(--white);
}

.testimonials h2 {
    color: var(--white);
}

.reviews-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.review-card {
    background: var(--dark-light);
    padding: 35px;
    border-left: 3px solid var(--gold);
}

.stars {
    color: var(--gold);
    margin-bottom: 10px;
}

.review-card p {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 15px;
}

.author {
    font-size: 0.85rem;
    color: var(--gold);
    letter-spacing: 1px;
}

/* Contacto */
.contact-section {
    padding: 100px 0;
    background: var(--light-bg);
}

.contact-box {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    padding: 50px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.contact-box h2 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.contact-box p {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 14px;
    border: 1px solid #cbd5e1;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--gold);
}

.btn-gold-full {
    background: var(--gold);
    color: var(--white);
    border: none;
    padding: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-gold-full:hover {
    background: var(--gold-hover);
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 0 30px;
    text-align: center;
}

.footer-logo-img {
    max-width: 260px;
    height: auto;
    margin-bottom: 20px;
    display: inline-block;
}

.address {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 30px;
}

.copyright {
    font-size: 0.75rem;
    color: #64748b;
    border-top: 1px solid #1e293b;
    padding-top: 20px;
}

.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-bottom: 25px;
}

.social-links a {
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #1e293b;
    background: var(--dark-light);
    transition: all 0.3s ease;
}

.social-links a[aria-label="WhatsApp"] {
    margin-right: 4px;
}

.social-links a[aria-label="Facebook"] {
    margin-left: 2px;
}

.social-links a:hover {
    color: var(--gold);
    border-color: var(--gold);
    transform: translateY(-3px);
}

/* Slider de Testimonios */
.slider-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
}

.reviews-slider {
    position: relative;
    width: 100%;
}

.slide {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.slide.active {
    display: grid;
    opacity: 1;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: #334155;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.dot.active {
    background-color: var(--gold);
    transform: scale(1.2);
}

/* Acordeón / Desplegable */
.acordeon-container {
    max-width: 600px;
    margin: 40px auto 0 auto;
    padding: 0 15px;
}

.acordeon-toggle {
    width: 100%;
    background: transparent;
    border: 1px solid #c5a059;
    color: #1a1a1a;
    padding: 12px 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.acordeon-toggle:hover {
    background: #c5a059;
    color: #ffffff;
}

.acordeon-toggle:hover .acordeon-icon {
    color: #ffffff;
}

.acordeon-icon {
    font-size: 1.1rem;
    color: #c5a059;
    font-weight: 600;
    transition: transform 0.3s ease, color 0.3s ease;
    margin-left: 10px;
}

.acordeon-toggle.active .acordeon-icon {
    transform: rotate(45deg);
}

.acordeon-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease-in-out, opacity 0.4s ease, margin-top 0.3s ease;
}

.acordeon-content.open {
    opacity: 1;
    margin-top: 25px;
}

.desglose-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding-top: 15px;
}

.desglose-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 32px 22px 22px 22px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    text-align: left;
}

.desglose-badge {
    position: absolute;
    top: 12px;
    right: 15px;
    background: #c5a059;
    color: #ffffff;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.desglose-card h4 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem;
    color: #1a1a1a;
    margin-top: 5px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid #f0f0f0;
}

/* Responsive */
@media (max-width: 991px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .cards-grid .card:nth-child(4) {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .cards-grid .card:nth-child(4) {
        grid-column: auto;
    }
    .doctor-grid, .reviews-grid {
        grid-template-columns: 1fr;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
    .nav-links {
        display: none;
    }
    .slide.active {
        grid-template-columns: 1fr;
    }
    .affiliation-logo {
        width: 50px !important;
        max-width: 50px !important;
    }
}

/* Exportación PDF */
@media print {
    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        background-color: #0b0f19 !important;
    }

    .btn-whatsapp, 
    .acordeon-toggle {
        display: none !important;
    }

    section, 
    .card, 
    .doctor-grid, 
    .contact-box {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .hero, 
    .services, 
    .doctor-profile, 
    .contact-section {
        page-break-after: always;
    }
}