:root {
    --primary: #0f766e; 
    --primary-dark: #115e59;
    --secondary: #d97706; 
    --cyan-destacado: #22d3ee; 
    --text-color: #334155;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --transition: all 0.3s ease;
}

/* Blindaje inicial general para evitar el corte horizontal */
* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }

html, body {
    max-width: 100%;
    overflow-x: hidden; /* Corta la posibilidad de scroll lateral */
}

body { 
    font-family: 'Montserrat', sans-serif; 
    color: var(--text-color); 
    line-height: 1.6; 
    background-color: var(--bg-white);
}

/* Reset implacable para aniquilar el azul/subrayado de los enlaces */
a, a:link, a:visited, a:active { 
    text-decoration: none !important; 
    color: inherit; 
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }
.section-title { text-align: center; font-size: 2.2rem; font-weight: 700; color: var(--primary); margin-bottom: 10px; text-transform: uppercase; max-width: 100%; word-wrap: break-word; }
.section-subtitle { text-align: center; color: var(--text-light); max-width: 700px; margin: 0 auto 50px auto; }

/* HEADER */
header { position: fixed; top: 0; width: 100%; background: rgba(255, 255, 255, 0.95); box-shadow: 0 2px 10px rgba(0,0,0,0.05); z-index: 1000; backdrop-filter: blur(5px); }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 80px; }
.logo-img { max-height: 55px; }

.nav-links { display: flex; gap: 25px; align-items: center; }
.nav-links a, .nav-links a:link, .nav-links a:visited { font-weight: 500; font-size: 0.95rem; color: var(--text-color); transition: var(--transition); }
.nav-links a:hover { color: var(--primary); }

.social-nav a, .social-nav a:link, .social-nav a:visited { color: #1877f2; font-size: 1.2rem; }
.menu-toggle { display: none; font-size: 1.5rem; cursor: pointer; color: var(--primary); }

/* HERO */
.hero { padding: 140px 0 100px 0; background: linear-gradient(rgba(255,255,255,0.3), rgba(255,255,255,0.5)), url('img/agustin-bellver.jpg') center/cover no-repeat; min-height: 85vh; display: flex; align-items: center; width: 100%; }
.hero-content { max-width: 950px; width: 100%; margin: 0 auto; background: rgba(255,255,255,0.95); padding: 50px 40px; border-radius: 8px; box-shadow: 0 20px 40px rgba(0,0,0,0.12); display: flex; align-items: center; gap: 40px; box-sizing: border-box; }
.hero-logo-box { border-right: 2px solid var(--border-color); padding-right: 30px; flex-shrink: 0; }
.hero-spine-img { max-height: 280px; max-width: 100%; }
.hero-subtitle { display: block; font-weight: 600; color: var(--secondary); margin-bottom: 10px; text-transform: uppercase; }
.hero-text-box h1 { font-size: 2.4rem; color: var(--primary); text-transform: uppercase; word-wrap: break-word; }

/* DISCIPLINAS */
.servicios { padding: 90px 0; width: 100%; }
.grid-servicios { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.card-servicio { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.06); border-bottom: 4px solid var(--primary); }

.card-img-wrapper { height: 350px; width: 100%; background-color: var(--bg-light); }
.card-img-wrapper img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

.card-body { padding: 30px 25px; text-align: center; }

/* TARIFAS Y BONOS */
.tratamientos { padding: 90px 0; background: var(--bg-light); width: 100%; }
.grid-tarifas { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 20px; max-width: 1000px; margin: 0 auto; }
.tarifa-item { background: #fff; padding: 20px 30px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.tarifa-precio { font-weight: 700; color: var(--secondary); background: #fef3c7; padding: 8px 18px; border-radius: 6px; }

.bonos-container.legible-theme { background: #fff; border: 2px solid var(--border-color); max-width: 1000px; margin: 50px auto 0 auto; border-radius: 12px; overflow: hidden; width: 100%; }
.bonos-header { padding: 35px 30px; text-align: center; }
.bonos-gallery { display: grid; grid-template-columns: repeat(3, 1fr); height: 280px; }
.bonos-gallery img { width: 100%; height: 100%; object-fit: cover; }

/* ENFOQUE Y CONVENIOS */
.sobre-nosotros { padding: 90px 0 20px 0; width: 100%; }

.convenios-destacados-header { 
    background-color: var(--bg-light); 
    padding: 25px 30px; 
    text-align: center; 
    border: 2px solid var(--border-color); 
    border-radius: 8px;
    margin: 0 auto 40px auto; 
    max-width: 1200px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    display: block;
    width: 100%;
    box-sizing: border-box;
}
.convenios-destacados-header h3 { 
    color: var(--cyan-destacado); 
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase; 
    letter-spacing: 1px;
    margin: 0;
    word-wrap: break-word;
}

.sobre-nosotros-title-small { font-size: 1.6rem; color: var(--primary); text-align: center; margin-bottom: 20px; text-transform: uppercase; }

.tags-dolencias { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 40px 0; }
.tag { background: var(--bg-light); border: 1px solid var(--border-color); padding: 8px 18px; border-radius: 50px; color: var(--primary); }

/* Logos Justificados en Escritorio */
.logos-convenios-justified-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-top: 1px solid var(--border-color); 
    border-bottom: 1px solid var(--border-color); 
    padding: 30px 0; 
    margin: 50px 0; 
    width: 100%;
    box-sizing: border-box;
}
.logo-conv-large { height: 100px; flex: 1; display: flex; justify-content: center; align-items: center; padding: 0 10px; }
.logo-conv-large img { max-height: 90px; max-width: 100%; object-fit: contain; }

/* CONTACTO Y HORARIOS */
.contacto { padding: 60px 0 90px 0; background: var(--bg-light); width: 100%; }

.centro-gallery-grid { 
    display: grid; 
    grid-template-columns: 2fr 1fr; 
    gap: 20px; 
    max-width: 1000px; 
    margin: 0 auto; 
    align-items: stretch;
    width: 100%;
}
.gallery-item { border-radius: 8px; overflow: hidden; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; min-height: 480px; display: block; }

.gallery-item-column { display: flex; flex-direction: column; gap: 20px; justify-content: space-between; }
.gallery-item-column img { width: 100%; height: calc(50% - 10px); object-fit: cover; border-radius: 8px; display: block; flex-grow: 1; }

.contacto-textos-wrapper { margin-top: 80px; width: 100%; clear: both; }
.contacto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 40px; }
.info-box { background: #fff; padding: 40px 30px; border-radius: 8px; text-align: center; width: 100%; box-sizing: border-box; }
.info-box i { font-size: 2.2rem; color: var(--secondary); margin-bottom: 15px; }

.info-box a, .info-box a:link, .info-box a:visited { color: var(--text-color); transition: var(--transition); }
.info-box a:hover { color: var(--primary); }

.phone-link, .phone-link:link, .phone-link:visited { font-weight: 600; font-size: 1.15rem; color: var(--text-color) !important; }
.phone-link:hover { color: var(--primary) !important; }

/* FOOTER */
footer { background: #0f172a; color: #fff; padding: 60px 0; text-align: center; width: 100%; }
.footer-firma { filter: brightness(0) invert(1); max-height: 60px; max-width: 100%; }
.footer-links { display: flex; justify-content: center; gap: 25px; margin: 25px 0; flex-wrap: wrap; }
.footer-links a, .footer-links a:link, .footer-links a:visited { color: #94a3b8; transition: var(--transition); }
.footer-links a:hover { color: white; }
.copyright { color: #64748b; border-top: 1px solid #1e293b; padding-top: 25px; }

/* --- OPTIMIZACIÓN Y CORRECCIONES PARA VERSIÓN MÓVIL --- */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-links { position: absolute; top: 80px; left: -100%; width: 100%; background: #fff; flex-direction: column; padding: 30px 0; transition: 0.3s; box-shadow: 0 10px 15px rgba(0,0,0,0.05); }
    .nav-links.active { left: 0; }
    
    /* Hero ajustado para no desbordar por la derecha */
    .hero { padding: 110px 0 50px 0; min-height: auto; }
    .hero-content { flex-direction: column; text-align: center; padding: 30px 20px; gap: 20px; width: calc(100% - 40px); margin: 0 20px; }
    .hero-logo-box { border-right: none; padding: 0 0 20px 0; }
    .hero-text-box h1 { font-size: 1.7rem; }
    
    /* Compactación drástica de los abismos/espaciados verticales */
    .servicios, .tratamientos, .sobre-nosotros, .contacto { padding: 45px 0; }
    .section-subtitle { margin-bottom: 30px; }
    
    /* Ajuste en el Grid de tarifas para pantallas estrechas */
    .grid-tarifas { grid-template-columns: 1fr; }
    .tarifa-item { flex-direction: column; text-align: center; gap: 10px; padding: 15px 20px; }
    .bonos-container.legible-theme { margin-top: 35px; }
    
    .convenios-destacados-header { padding: 18px 15px; margin-bottom: 25px; }
    .convenios-destacados-header h3 { font-size: 1.15rem; }
    .tags-dolencias { margin: 25px 0; }
    
    /* SOLUCIÓN AL CORTE DEL LOGO APTTUV:
       Usamos flex-wrap inteligente centrado y compactado para que entren todos en simetría */
    .logos-convenios-justified-row { 
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 15px 10px; 
        padding: 20px 0; 
        margin: 25px 0;
    }
    .logo-conv-large { 
        flex: 0 0 30%; /* Tres o dos logos por fila equilibrados */
        height: 60px; 
        padding: 0 5px;
    }
    .logo-conv-large img { max-height: 50px; }

    /* Galería adaptada a una columna */
    .centro-gallery-grid { grid-template-columns: 1fr; gap: 15px; }
    .gallery-item img { min-height: 250px; height: 250px; }
    .gallery-item-column { flex-direction: row; gap: 15px; }
    .gallery-item-column img { height: 140px; width: calc(50% - 7.5px); }
    
    .card-img-wrapper { height: 240px; }
    .contacto-textos-wrapper { margin-top: 40px; }
    .contacto-grid { margin-top: 25px; gap: 20px; }
    .info-box { padding: 25px 20px; }
    
    footer { padding: 40px 0; }
}

@media (max-width: 480px) {
    /* Ajuste extra para móviles muy estrechos */
    .logo-conv-large { flex: 0 0 45%; } /* Dos logos por fila para máxima legibilidad */
}