/* --- VARIABLES Y ESTILOS GENERALES --- */
:root { --primary-color: #008D8D; --secondary-color: #E57373; --light-bg: #F8FDFD; --dark-text: #333333; --light-text: #666666; --gradient: linear-gradient(135deg, var(--primary-color), #00A7A7); }

body { font-family: 'Montserrat', sans-serif; margin: 0; color: var(--dark-text); line-height: 1.7; background-color: #FFFFFF; }

/* === INICIO DE LA CORRECCIÓN GLOBAL Y DEFINITIVA === */
/* El contenedor principal de todo el sitio ocultará el overflow */
.site-wrapper {
    width: 100%;
    overflow-x: hidden;
}
/* === FIN DE LA CORRECCIÓN GLOBAL === */

.container { width: 90%; margin: 0 auto; max-width: 1200px; }
h1, h2, h3 { font-family: 'Montserrat', sans-serif; font-weight: 700; }
h2 { font-size: 2rem; color: #48a0b8; text-align: center; margin-bottom: 20px; line-height: 2rem; }
h2 span { color: var(--secondary-color); }
.section-subtitle { text-align: center; max-width: 600px; margin: 0 auto 50px auto; color: var(--light-text); font-size: 1.1rem; }

/* --- HEADER --- */
.main-header { background: rgba(255, 255, 255, 1 ); backdrop-filter: blur(10px); padding: 1rem 0; box-shadow: 0 2px 15px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }
.main-header .container { display: flex; justify-content: space-between; align-items: center; }
.main-header .logo img { height: 55px; }
.main-header .main-nav ul { margin: 0; padding: 0; list-style: none; display: flex; }
.main-header .main-nav ul li { display: inline-block; margin-left: 25px; }
.main-header .main-nav a { text-decoration: none; color: var(--dark-text); font-weight: 400; position: relative; padding-bottom: 5px; font-size: 12px; }
.main-header .main-nav a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 0; background-color: var(--secondary-color); transition: width 0.3s ease; }
.main-header .main-nav a:hover::after { width: 100%; }

/* --- HERO & CONTENT --- */
#hero { height: 50vh; background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('fondoweb.jpg'); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; padding: 0 20px; }
#hero h1 { color: #fff; font-size: 2.5rem; font-weight: 800; max-width: 900px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); line-height: 2.6rem; }
.content-section { padding: 100px 0; }
#nosotros .grid-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
#nosotros .text-content h2 { text-align: left; }
#nosotros .image-content { position: relative; }
#nosotros .image-content::before { content: ''; position: absolute; top: 10px; left: 10px; width: 100%; height: 100%; background-color: var(--primary-color); border-radius: 15px; z-index: -1; }
#nosotros .image-content img { width: 100%; border-radius: 15px; }
.with-pattern { background-color: var(--light-bg); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cg fill='%23008d8d' fill-opacity='0.08'%3E%3Cpath d='M10 0v20M0 10h20'/%3E%3C/g%3E%3C/svg%3E"); }
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 50px; }
.value-card { background: #fff; padding: 40px; text-align: center; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); border: 1px solid #eee; transition: transform 0.3s, box-shadow 0.3s; }
.value-card:hover { transform: translateY(-8px); box-shadow: 0 12px 25px rgba(0,0,0,0.08); }
.value-card i { font-size: 2.5rem; color: var(--secondary-color); margin-bottom: 20px; }
.value-card h3 { margin-bottom: 15px; color: var(--primary-color); }

/* --- OBRAS SOCIALES --- */
#os-search { width: 100%; padding: 15px; margin: 0 auto 30px auto; display: block; max-width: 600px; border: 2px solid #eee; border-radius: 50px; font-size: 1rem; box-sizing: border-box; transition: border-color 0.3s, box-shadow 0.3s; }
#os-search:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0, 141, 141, 0.2); }
#os-list { list-style: none; padding: 0; columns: 4; -webkit-columns: 4; -moz-columns: 4; gap: 30px; }
#os-list li { padding: 8px 10px; color: var(--light-text); border-radius: 5px; transition: background-color 0.3s, color 0.3s; break-inside: avoid; }
#os-list li:hover { background-color: var(--light-bg); color: var(--primary-color); font-weight: bold; }

/* --- CTA Y FOOTER --- */
.cta-section { padding: 100px 0; text-align: center; color: #fff; background: var(--gradient); }
.cta-section h2 { color: #fff; font-size: 2.8rem; }
.cta-section p { font-size: 1.2rem; opacity: 0.9; margin-bottom: 40px; }
.cta-button { background-color: #25D366; color: #fff; padding: 18px 40px; border-radius: 50px; text-decoration: none; font-weight: bold; font-size: 1.1rem; transition: background-color 0.3s, transform 0.3s; display: inline-flex; align-items: center; gap: 10px; }
.cta-button:hover { background-color: #ffffff; color: #128C7E; transform: scale(1.05); }
#contacto { background: var(--dark-text); color: #ddd; padding: 80px 0 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 50px; padding-bottom: 50px; }
.footer-logo { height: 50px; margin-bottom: 20px; }
.footer-col h3 { color: #fff; margin-top: 30px; }
.footer-col a { color: #ddd; text-decoration: none; transition: color 0.3s; }
.footer-col a:hover { color: var(--secondary-color); }
.footer-col ul { list-style: none; padding: 0;}
.footer-col ul li { margin-bottom: 10px; }
.footer-col p i { color: var(--primary-color); margin-right: 10px; width: 20px; }
.footer-bottom { text-align: center; padding: 20px 0; border-top: 1px solid #444; color: #888; }
.hamburger-menu { display: none; background: none; border: none; cursor: pointer; padding: 10px; z-index: 1010; }
.hamburger-menu .line { display: block; width: 25px; height: 3px; background-color: var(--dark-text); margin: 5px 0; transition: transform 0.3s ease, opacity 0.3s ease; }

/* ============================ INICIO DE SECCIÓN RESPONSIVA ============================ */
@media (max-width: 992px) {
    #nosotros .grid-layout { grid-template-columns: 1fr; }
    #nosotros .image-content { order: -1; margin-bottom: 40px; }
    #nosotros .text-content h2 { text-align: center; }
    #os-list { columns: 3; -webkit-columns: 3; -moz-columns: 3; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    h2 { font-size: 1.8rem; }
    #hero h1 { font-size: 2rem; line-height: 2.4rem; }
    .values-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-col p i { display: block; margin: 0 auto 10px auto; }
    .content-section { padding: 80px 0; }
    .main-header .container { flex-direction: row; justify-content: space-between; align-items: center; }
    .hamburger-menu { display: block; }
    .main-nav { display: flex; flex-direction: column; justify-content: center; align-items: center; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-color: rgba(255, 255, 255, 0.98); backdrop-filter: blur(8px); z-index: 1005; visibility: hidden; opacity: 0; transform: translateX(100%); transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out, visibility 0.4s; }
    .main-nav.is-open { visibility: visible; opacity: 1; transform: translateX(0); }
    .main-nav ul { display: flex; flex-direction: column; align-items: center; gap: 25px; padding: 0; list-style: none; }
    .main-nav ul li { margin: 0; }
    .main-nav ul a { font-size: 1.5rem; }
    .hamburger-menu.is-active .line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger-menu.is-active .line:nth-child(2) { opacity: 0; }
    .hamburger-menu.is-active .line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    #os-list { display: none; columns: 2; -webkit-columns: 2; margin-top: 20px; }
    section#obras-sociales:focus-within #os-list { display: block; }
}

@media (max-width: 480px) {
    #os-list { columns: 1; -webkit-columns: 1; }
}