/* --- VARIABLES Y RESET --- */
:root {
    --bg-main: #F8FAFC;
    --card-bg: #FFFFFF;
    
    /* Paleta Monocromática de Azules */
    --primary-dark: #1E3A8A;
    --primary-blue: #2563EB;
    --blue-bg-icon: #EFF6FF;
    --blue-border: #DBEAFE;
    
    --whatsapp: #25D366;
    --text-dark: #0F172A;
    --text-muted: #64748B;
    
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(37, 99, 235, 0.07);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* --- CONTENEDOR TIPO APP --- */
.app-container {
    width: 100%;
    max-width: 440px;
    background-color: #FAFAFA;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
    position: relative;
    
    /* ¡AQUÍ ESTABA EL ERROR DEL STICKY! 
       Antes decía "hidden", que rompe el sticky. Lo cambiamos a "clip". */
    overflow-x: clip; 
}

/* --- HEADER UNIFICADO (FIJO ARRIBA) --- */
.app-header {
    background: var(--card-bg);
    padding: 16px 20px;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.app-logo {
    max-width: 150px;
    height: auto;
    display: block;
}

.btn-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--blue-bg-icon);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--blue-border);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-header-icon:active {
    background-color: var(--blue-border);
}

/* --- MENÚ LATERAL (DRAWER) --- */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: var(--card-bg);
    z-index: 100;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-menu.active {
    right: 0;
}

.side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #F1F5F9;
}

.side-menu-header h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.btn-close-menu {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.side-menu-nav {
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.92rem;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link i {
    font-size: 1.1rem;
    color: var(--primary-blue);
}

.nav-link:hover, .nav-link.active {
    background-color: var(--blue-bg-icon);
    color: var(--primary-dark);
}

.nav-link.whatsapp-link {
    margin-top: 10px;
    background-color: #ECFDF5;
    color: #059669;
}

.nav-link.whatsapp-link i {
    color: var(--whatsapp);
}

/* --- MAIN CONTENT --- */
.app-main {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.section-header {
    text-align: center;
    margin-bottom: 4px;
}

.section-header h2 {
    font-size: 1.35rem;
    color: var(--primary-dark);
    font-weight: 800;
}

.section-header p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* HERO CARD & BOTONES INICIO */
.hero-card {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
    color: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.badge {
    background-color: rgba(255, 255, 255, 0.2);
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.hero-card h2 {
    margin-top: 10px;
    font-size: 1.45rem;
    font-weight: 700;
}

.hero-card p {
    font-size: 0.88rem;
    opacity: 0.9;
    margin: 6px 0 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    transition: transform 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: #FFFFFF;
    color: var(--primary-dark);
}

.btn-whatsapp {
    background-color: var(--whatsapp);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

/* GRID DE NAVEGACIÓN */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.grid-card {
    background: var(--card-bg);
    padding: 20px 12px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #F1F5F9;
    transition: all 0.2s ease;
}

.grid-card:hover {
    transform: translateY(-2px);
    border-color: var(--blue-border);
    box-shadow: var(--shadow-md);
}

.grid-card span {
    font-size: 0.88rem;
    font-weight: 600;
}

.icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--blue-bg-icon);
    border: 1px solid var(--blue-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--primary-dark);
}

/* TARJETAS DE INFORMACIÓN (NOSOTROS) */
.info-cards-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-card {
    background: var(--card-bg);
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid #F1F5F9;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.info-card .icon-wrapper {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
}

.info-card-content h3 {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.info-card-content p {
    font-size: 0.85rem;
    color: var(--text-dark);
    line-height: 1.45;
}

/* VIDEO CONTENEDOR */
.video-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.video-section h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background-color: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* REDES SOCIALES */
.social-section {
    margin-top: 8px;
}

.social-section h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
}

.social-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.social-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #F1F5F9;
    gap: 6px;
}

.social-btn i {
    font-size: 1.15rem;
    color: var(--primary-blue);
}

/* FOOTER */
.app-footer {
    text-align: center;
    padding: 18px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid #F1F5F9;
    margin-top: auto;
}

/* --- STAFF & ACORDEONES --- */
.staff-accordion-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.staff-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid #F1F5F9;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.staff-card.open {
    border-color: var(--blue-border);
    box-shadow: var(--shadow-md);
}

.staff-header {
    width: 100%;
    padding: 16px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-align: left;
}

.staff-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--blue-bg-icon);
    border: 1px solid var(--blue-border);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.staff-basic-info {
    flex: 1;
}

.staff-basic-info h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.staff-role {
    font-size: 0.78rem;
    color: var(--primary-blue);
    font-weight: 600;
    display: block;
}

.accordion-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.staff-card.open .accordion-icon {
    transform: rotate(180deg);
    color: var(--primary-dark);
}

/* DESPLEGABLE DE INFORMACIÓN */
.staff-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0, 1, 0, 1);
    background-color: #FAFAFA;
    border-top: 1px dashed transparent;
}

.staff-card.open .staff-content {
    max-height: 2000px;
    transition: max-height 0.5s ease-in-out;
    border-top-color: #E2E8F0;
}

.staff-content-inner {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cv-section h4 {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cv-section h4 i {
    color: var(--primary-blue);
}

.cv-section ul {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cv-section li {
    font-size: 0.83rem;
    color: var(--text-dark);
    line-height: 1.45;
    position: relative;
    padding-left: 14px;
}

.cv-section li::before {
    content: "•";
    color: var(--primary-blue);
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

/* --- TRATAMIENTOS & ACORDEONES --- */
.treatments-accordion-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.treatment-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid #F1F5F9;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.treatment-card.open {
    border-color: var(--blue-border);
    box-shadow: var(--shadow-md);
}

.treatment-header {
    width: 100%;
    padding: 16px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-align: left;
}

.treatment-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background-color: var(--blue-bg-icon);
    border: 1px solid var(--blue-border);
    color: var(--primary-dark);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.treatment-basic-info {
    flex: 1;
}

.treatment-basic-info h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.treatment-tag {
    font-size: 0.76rem;
    color: var(--primary-blue);
    font-weight: 600;
    display: block;
}

.treatment-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0, 1, 0, 1);
    background-color: #FAFAFA;
    border-top: 1px dashed transparent;
}

.treatment-card.open .treatment-content {
    max-height: 500px;
    transition: max-height 0.4s ease-in-out;
    border-top-color: #E2E8F0;
}

.treatment-content-inner {
    padding: 16px 18px 20px;
}

.treatment-content-inner p {
    font-size: 0.85rem;
    color: var(--text-dark);
    line-height: 1.5;
    margin: 0;
}

/* --- OBRAS SOCIALES UI --- */

/* Input Buscador */
.search-box-container {
    margin-bottom: 20px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.search-input-wrapper input {
    width: 100%;
    padding: 14px 42px 14px 44px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    outline: none;
    transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.clear-search-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
}

/* Grilla de Obras Sociales */
.insurance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 640px) {
    .insurance-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.insurance-item {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.insurance-item:active {
    transform: scale(0.98);
}

.insurance-item i {
    color: var(--primary-blue);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.insurance-item span {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.25;
}

/* Mensaje sin resultados */
.no-results-card {
    background: #FFFFFF;
    border: 1px dashed #CBD5E1;
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    margin: 10px 0;
}

.no-results-card i {
    font-size: 2rem;
    color: #94A3B8;
    margin-bottom: 8px;
}

.no-results-card p {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.no-results-card span {
    font-size: 0.8rem;
}

/* Nota inferior al pie */
.insurance-note-card {
    margin-top: 24px;
    background: #EFF6FF;
    border: 1px solid var(--blue-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.insurance-note-card i {
    color: var(--primary-blue);
    font-size: 1.2rem;
    margin-top: 2px;
}

.insurance-note-card h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 2px;
}

.insurance-note-card p {
    font-size: 0.8rem;
    color: var(--text-dark);
    line-height: 1.4;
    margin: 0;
}

/* --- BOTÓN WHATSAPP CTA --- */
.cta-whatsapp-container {
    margin-top: 20px;
    margin-bottom: 10px;
}

.btn-whatsapp-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background-color: var(--whatsapp);
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

/* --- BANNER PWA FLOTANTE INFERIOR --- */
.pwa-banner {
    position: fixed;
    bottom: -250px;
    left: 16px;
    right: 16px;
    max-width: 420px;
    margin: 0 auto;
    background: #FFFFFF;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid #E2E8F0;
    z-index: 9999;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwa-banner.show {
    bottom: 20px;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    position: relative;
}

.pwa-banner-icon img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
}

.pwa-banner-text h4 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.pwa-banner-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
    margin: 0;
}

.pwa-banner-close {
    position: absolute;
    top: -6px;
    right: -4px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #94A3B8;
    cursor: pointer;
}

.btn-pwa-install {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-blue);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

/* --- MODAL DE TURNOS (NUEVO) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 320px;
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    text-align: center;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #F1F5F9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
    background: #E2E8F0;
    color: var(--text-dark);
}

.modal-header-icon {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 12px;
}

.modal-content h3 {
    color: var(--primary-dark);
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

/* Efecto tipo pincelada amarilla del flyer */
.modal-hours {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-dark);
    background-color: #FACC15; 
    display: inline-block;
    padding: 6px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    transform: rotate(-2deg); /* Inclinación sutil */
    box-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.modal-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 24px;
}