/* --- RESET Y VARIABLES --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Roboto', sans-serif; color: #333; line-height: 1.6; background-color: #f4f6f8; }
a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

:root {
    --color-primary: #A03234;
    --color-dark: #2c3e50;
    --color-text-muted: #727376;
    --color-border: #D2D3D5;
    --color-bg-hover: #fff0f0;
}

/* --- HEADER Y NAVEGACIÓN DESKTOP --- */
header { background: #ffffff; border-bottom: 4px solid var(--color-primary); box-shadow: 0 2px 5px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }
.header-flex { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; }
.logo a { display: block; }
.logo img { max-width: 100%; max-height: 80px; width: auto; display: block; }

nav { display: flex; align-items: center; }
.nav-menu { display: flex; align-items: center; list-style: none; gap: 5px; }
.nav-item { position: relative; }
.nav-link { display: block; padding: 10px 15px; font-weight: 700; color: var(--color-primary); text-transform: uppercase; font-size: 14px; letter-spacing: 0.5px; transition: all 0.3s ease; }
.nav-link:hover { background-color: var(--color-bg-hover); border-radius: 4px; }

/* Submenús Dropdown */
.submenu { position: absolute; top: 100%; left: 0; background: #ffffff; box-shadow: 0 4px 10px rgba(0,0,0,0.15); border-top: 3px solid var(--color-primary); min-width: 200px; list-style: none; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.25s ease; border-radius: 0 0 4px 4px; }
.submenu li a { display: block; padding: 10px 15px; font-size: 13px; color: #555; border-bottom: 1px solid #f0f0f0; transition: background 0.2s; }
.submenu li a:hover { background: #f9f9f9; color: var(--color-primary); }

@media (min-width: 992px) { .nav-item:hover .submenu { opacity: 1; visibility: visible; transform: translateY(0); } }
.menu-toggle { display: none; background: none; border: none; font-size: 28px; color: var(--color-primary); cursor: pointer; padding: 5px; }

/* --- COMPONENTES HOME (Banners y Accesos) --- */
.main-content { padding: 40px 20px; min-height: 60vh; }
.banner-destacado { text-align: center; margin-bottom: 50px; }
.banner-destacado img { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); transition: transform 0.3s ease; }
.banner-destacado a:hover img { transform: scale(1.02); }

.accesos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; }
.card { background: #fff; border: 1px solid var(--color-border); border-radius: 8px; padding: 20px; display: flex; align-items: center; gap: 20px; transition: transform 0.25s, box-shadow 0.25s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.08); }
.card img { width: 65px; height: auto; flex-shrink: 0; object-fit: contain; }
.card-text h4 { color: var(--color-primary); margin-bottom: 6px; font-size: 16px; font-weight: 700; }
.card-text p { font-size: 13px; color: var(--color-text-muted); line-height: 1.4; }

/* --- PÁGINAS INTERNAS --- */
.page-header { background-color: var(--color-primary); color: #ffffff; padding: 40px 20px; text-align: center; margin-bottom: 40px; }
.page-header h1 { font-size: 28px; text-transform: uppercase; letter-spacing: 1px; }
.page-content { background: #ffffff; padding: 40px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 50px; font-size: 16px; color: #444; }
.page-content h2, .page-content h3 { color: var(--color-primary); margin-top: 30px; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.page-content h2:first-child { margin-top: 0; }
.page-content p { margin-bottom: 20px; text-align: justify; }
.page-content ul { margin-bottom: 20px; padding-left: 30px; list-style-type: square; color: var(--color-primary); }
.page-content ul li span { color: #444; }
.page-content li { margin-bottom: 10px; }

/* --- FOOTER --- */
footer { background: #ffffff; border-top: 1px solid var(--color-border); padding: 30px 20px; margin-top: 50px; }
.footer-content { text-align: center; font-size: 13px; color: var(--color-text-muted); }
.developer { margin-top: 15px; font-size: 12px; }

/* --- ADAPTACIÓN A MÓVILES --- */
@media (max-width: 991px) {
    .header-flex { padding: 10px 15px; }
    .logo img { max-height: 60px; }
    .menu-toggle { display: block; }
    .nav-menu { display: none; flex-direction: column; width: 100%; position: absolute; top: 100%; left: 0; background: #ffffff; border-top: 1px solid #eee; box-shadow: 0 4px 10px rgba(0,0,0,0.1); padding: 10px 0; gap: 0; }
    .nav-menu.open { display: flex; }
    .nav-item { width: 100%; }
    .nav-link { padding: 12px 20px; border-bottom: 1px solid #f5f5f5; }
    .submenu { position: static; box-shadow: none; border-top: none; background: #fcfcfc; max-height: 0; overflow: hidden; opacity: 1; visibility: visible; transform: none; transition: max-height 0.3s ease-out; }
    .submenu.submenu-active { max-height: 400px; } 
    .submenu li a { padding: 10px 35px; background: #fafafa; }
    .page-content { padding: 20px; }
    .page-header h1 { font-size: 24px; }


/* --- TABLAS Y LISTADOS --- */
.table-responsive { 
    overflow-x: auto; 
    margin-top: 20px; 
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.tabla-institucional { 
    width: 100%; 
    border-collapse: collapse; 
    text-align: left; 
    font-size: 15px;
}
.tabla-institucional th { 
    background-color: var(--color-primary); 
    color: white; 
    padding: 15px; 
    font-weight: 500;
    text-transform: uppercase;
    font-size: 14px;
}
.tabla-institucional td { 
    padding: 15px; 
    border-bottom: 1px solid var(--color-border); 
}
.tabla-institucional tbody tr {
    transition: background-color 0.2s;
}
.tabla-institucional tbody tr:hover { 
    background-color: var(--color-bg-hover); 
}
.tabla-institucional td:first-child {
    font-weight: 500;
    color: var(--color-dark);
}
}


/* --- BOTONES Y ENLACES --- */
.btn-pdf {
    display: inline-block;
    background-color: var(--color-primary);
    color: #ffffff !important;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}
.btn-pdf:hover {
    background-color: #7a2527; /* Un rojo más oscuro */
}


/* --- BOTÓN FLOTANTE DE WHATSAPP --- */
.whatsapp-flotante {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.3);
    z-index: 1000; /* Asegura que siempre esté por encima del contenido */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.whatsapp-flotante:hover {
    transform: scale(1.1);
    background-color: #20b858;
}

.whatsapp-flotante svg {
    width: 35px;
    height: 35px;
    fill: currentColor;
}

/* Ajuste del botón WhatsApp para celulares */
@media (max-width: 768px) {
    .whatsapp-flotante {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
    .whatsapp-flotante svg {
        width: 30px;
        height: 30px;
    }
}

/* --- DIRECTORIO DE ASOCIADOS (TARJETAS) --- */
.asociados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.asociado-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--color-primary); /* Línea superior roja institucional */
    border-radius: 8px;
    padding: 25px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.asociado-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.asociado-card h4 {
    color: var(--color-dark);
    font-size: 17px;
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.3;
    border-bottom: none; /* Evita que tome el estilo de h4 general si lo hubiera */
    padding-bottom: 0;
}

.asociado-card p {
    font-size: 14px;
    color: var(--color-text-muted);
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Color del icono del pin de ubicación */
.asociado-card svg {
    color: var(--color-primary);
    flex-shrink: 0;
}