/* ==========================================================================
   RESET Y VARIABLES GLOBAL DE ESTILOS
   ========================================================================== */
:root {
    --primary-color: #0b5ed7;
    --primary-dark: #0a4baf;
    --secondary-color: #198754;
    --warning-color: #d97706;
    --warning-bg: #fef3c7;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --gray-color: #6b7280;
    --border-color: #e5e7eb;
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--dark-color);
    background-color: #ffffff;
    line-height: 1.6;
}

/* ==========================================================================
   UTILIDADES Y LAYOUT
   ========================================================================== */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-padding {
    padding: 60px 0;
}

.bg-light {
    background-color: var(--light-color);
}

.text-center {
    text-align: center;
}

.section-header {
    margin-bottom: 40px;
}

.section-header .sub-title {
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 1.5px;
    color: var(--primary-color);
    font-weight: 700;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--dark-color);
}

/* ==========================================================================
   NAVEGACIÓN / NAVBAR
   ========================================================================== */
.navbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 700;
    color: var(--dark-color);
}

.logo-img {
    height: 48px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links > a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links > a:hover {
    color: var(--primary-color);
}

.menu-toggle, .hamburger-icon {
    display: none;
}

/* ==========================================================================
   MENÚ DESPLEGABLE "EL VALLE"
   ========================================================================== */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark-color);
    transition: color 0.3s;
}

.dropdown-toggle i {
    font-size: 0.75rem;
    transition: transform 0.3s;
}

.dropdown:hover .dropdown-toggle {
    color: var(--primary-color);
}

.dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    padding: 8px 0;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    white-space: nowrap;
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    background: none;
    border-radius: 0;
}

.dropdown-menu a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* Botón "Contactar" en la barra de navegación */
.nav-btn {
    background-color: var(--primary-color);
    color: #ffffff !important;
    padding: 8px 22px;
    border-radius: 6px;
    font-weight: 600;
}

.nav-btn:hover {
    background-color: var(--primary-dark);
    color: #ffffff !important;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
    position: relative;
    background: url('../images/comuna.jpg') center/cover no-repeat;
    height: 70vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.hero-content .tagline {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 25px;
}

.hero-tags {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-tags span {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* ==========================================================================
   GRID & TARJETAS
   ========================================================================== */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.responsive-img {
    width: 100%;
    height: auto;
    display: block;
}

.rounded-img {
    border-radius: 12px;
}

.card-alert {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning-color);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 15px;
}

.alert-list {
    list-style: none;
    margin-top: 15px;
}

.alert-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #991b1b;
}

.card {
    background: #ffffff;
    padding: 30px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.card-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 10px;
}

.card p {
    color: var(--gray-color);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #146c43;
}

/* Tarjetas de Noticias */
.news-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.news-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-body {
    padding: 20px;
}

.news-date {
    font-size: 0.8rem;
    color: var(--gray-color);
    display: block;
    margin-bottom: 10px;
}

.news-body h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.news-body p {
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-bottom: 15px;
}

.btn-link {
    display: inline-block;
    color: #ffffff;
    background-color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.btn-link:hover {
    background-color: #146c43;
    color: #ffffff;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    background: #0f172a;
    color: #e5e7eb;
    padding: 60px 0 0;
    margin-top: 40px;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-logo-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
}

.footer-brand p {
    color: #9ca3af;
    font-size: 0.85rem;
    max-width: 280px;
}

.footer-col h3 {
    color: #ffffff;
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.footer-contact-list,
.footer-links {
    list-style: none;
}

.footer-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    color: #cbd5e1;
    font-size: 0.85rem;
}

.footer-contact-list i {
    color: var(--primary-color);
    margin-top: 3px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.footer-contact-list a {
    color: #cbd5e1;
    text-decoration: none;
}

.footer-contact-list a:hover {
    color: #ffffff;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-hours li {
    margin-bottom: 14px;
    font-size: 0.85rem;
}

.footer-hours strong {
    display: block;
    color: #ffffff;
    margin-bottom: 3px;
}

.footer-hours span {
    color: #9ca3af;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    text-decoration: none;
    transition: background 0.3s;
}

.footer-social a:hover {
    background: var(--primary-color);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px 0;
    color: #9ca3af;
    font-size: 0.8rem;
}

.footer-bottom a {
    color: #9ca3af;
}

.footer-bottom a:hover {
    color: #ffffff;
}

/* ==========================================================================
   ENCABEZADO DE PÁGINA INTERNA
   ========================================================================== */
.page-header {
    position: relative;
    background: linear-gradient(rgba(11,94,215,0.75), rgba(11,94,215,0.75)), var(--page-header-img, none) center/cover no-repeat;
    background-color: var(--primary-dark);
    color: #ffffff;
    padding: 70px 0 50px;
    text-align: center;
}

.page-header h1 {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.breadcrumbs {
    font-size: 0.9rem;
    opacity: 0.9;
}

.breadcrumbs a {
    color: #ffffff;
    text-decoration: underline;
}

/* ==========================================================================
   CONTENIDO GENERAL DE PÁGINAS INTERNAS
   ========================================================================== */
.content-section h2 {
    font-size: 1.7rem;
    margin-bottom: 18px;
    color: var(--dark-color);
}

.content-section h3 {
    font-size: 1.25rem;
    margin: 20px 0 10px;
    color: var(--dark-color);
}

.content-section p {
    margin-bottom: 16px;
    color: #374151;
}

.content-section ul,
.content-section ol {
    margin: 0 0 16px 20px;
    color: #374151;
}

.content-section li {
    margin-bottom: 8px;
}

.content-section + .content-section {
    border-top: 1px solid var(--border-color);
}

.two-col {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: start;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.gallery-grid img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

/* ==========================================================================
   SERVICIOS / ACCESOS (tarjetas con icono cuadrado)
   ========================================================================== */
.service-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 26px 20px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.06);
}

.service-card img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 16px;
}

.service-card h3 {
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.service-card p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* ==========================================================================
   FAQ / ACORDEÓN (sin JavaScript, con <details>)
   ========================================================================== */
.faq-list {
    max-width: 850px;
    margin: 0 auto;
}

.faq-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}

.faq-item summary {
    padding: 18px 22px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "\f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--primary-color);
    transition: transform 0.3s;
    flex-shrink: 0;
}

.faq-item[open] summary::after {
    transform: rotate(180deg);
}

.faq-item .faq-answer {
    padding: 0 22px 20px;
    color: #374151;
}

/* ==========================================================================
   CONTACTO
   ========================================================================== */
.contact-info-list {
    list-style: none;
}

.contact-info-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
}

.contact-info-list i {
    color: var(--primary-color);
    font-size: 1.3rem;
    width: 24px;
    text-align: center;
    margin-top: 4px;
}

.contact-info-list h4 {
    margin-bottom: 3px;
    font-size: 1rem;
}

.contact-info-list p,
.contact-info-list a {
    color: var(--gray-color);
    text-decoration: none;
    font-size: 0.95rem;
}

.map-embed {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.map-embed iframe {
    width: 100%;
    height: 350px;
    border: 0;
    display: block;
}

.social-links {
    display: flex;
    gap: 14px;
    margin-top: 10px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    transition: background 0.3s;
}

.social-links a:hover {
    background: var(--primary-dark);
}

/* ==========================================================================
   FORMULARIOS
   ========================================================================== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

button.btn {
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 1rem;
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================================================== */
@media (max-width: 768px) {
    .hamburger-icon {
        display: block;
        font-size: 1.5rem;
        cursor: pointer;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    }

    .menu-toggle:checked ~ .nav-links {
        display: flex;
    }

    .nav-links {
        align-items: stretch;
    }

    .dropdown-menu {
        display: block;
        position: static;
        border: none;
        box-shadow: none;
        padding: 4px 0 4px 16px;
    }

    .dropdown-toggle i {
        display: none;
    }

    .nav-btn {
        text-align: center;
        margin-top: 6px;
    }

    .grid-2-col {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content .tagline {
        font-size: 1.2rem;
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .page-header {
        padding: 50px 0 35px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-bottom {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}