/* =========================
   VARIABLES GOB.CL
========================= */
:root {
    --gob-primary: #D92E5E;
    --gob-secondary: #F06A8F;
    --gob-tertiary: #0A132D;
    --gob-accent: #E6B3C1;
    --gob-neutral: #F7F7F7;
    --gob-gray-a: #4A4A4A;
    --gob-black: #111111;
    --gob-white: #FFFFFF;
}

/* =========================
   BASE
========================= */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Roboto", Arial, sans-serif;
    background: var(--gob-white);
    color: var(--gob-black);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Roboto Slab", Georgia, serif;
    font-weight: 400;
    color: var(--gob-black);
}

p {
    color: var(--gob-gray-a);
    line-height: 1.5;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

.container {
    width: 90%;
    max-width: 1140px;
    margin: 0 auto;
}

/* =========================
   NAVBAR ESCRITORIO
========================= */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;

    width: 100%;
    background: var(--gob-white);
    border-bottom: 1px solid var(--gob-accent);
}

/* Logo y menú centrados como un solo conjunto */
.topbar .nav-container {
    position: relative;

    width: 90%;
    max-width: 1400px;
    min-height: 78px;
    margin: 0 auto;
    padding: 12px 0;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 55px;
}

/* Logo */
.brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.brand-img {
    width: auto;
    height: 50px;
    display: block;
    object-fit: contain;
}

/* Menú */
.menu {
    display: flex;
    align-items: center;
    gap: 24px;

    margin: 0;
    padding: 0;
}

/* Enlaces del menú */
.menu a {
    display: flex;
    align-items: center;

    color: var(--gob-black);
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.menu a:hover,
.menu a:focus {
    color: var(--gob-primary);
    text-decoration: underline;
}

/* Icono de inicio de sesión */
.login-icon {
    position: relative;

    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    color: var(--gob-primary) !important;
    border: 2px solid var(--gob-primary);
    border-radius: 50%;

    font-size: 0;
    text-decoration: none !important;
}

.login-icon::before {
    content: "👤";
    font-size: 20px;
}

.login-icon:hover {
    background: var(--gob-primary);
    color: var(--gob-white) !important;
    text-decoration: none;
}
/* =========================
   BOT脫N MEN脷 CELULAR
   OCULTO EN COMPUTADOR
========================= */
.menu-toggle {
    display: none;
    position: relative;
    z-index: 1002;
    width: 46px;
    height: 46px;
    padding: 0;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    background: rgba(217, 46, 94, 0.08);
    color: var(--gob-tertiary);
    border: 1px solid rgba(217, 46, 94, 0.20);
    border-radius: 8px;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.menu-toggle:hover {
    background: rgba(217, 46, 94, 0.14);
    color: var(--gob-primary);
}

.menu-toggle:focus-visible {
    outline: 3px solid rgba(217, 46, 94, 0.28);
    outline-offset: 2px;
}

/* =========================
   BOT脫N INICIAR SESI脫N
========================= */
.login-icon {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--gob-primary) !important;
    border: 2px solid var(--gob-primary);
    border-radius: 50%;
    font-size: 0;
    text-decoration: none !important;
}

.login-icon::before {
    content: "";
    font-size: 20px;
}

.login-icon:hover {
    background: #00598f;
    color: var(--gob-white) !important;
}

/* =========================
   BOTONES
========================= */
.btn {
    display: inline-block;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
}

.btn-primary {
    background: var(--gob-primary);
    color: var(--gob-white) !important;
}

.btn-primary:hover {
    background: #00598f;
    text-decoration: none;
}

.btn-outline {
    background: var(--gob-white);
    color: var(--gob-primary) !important;
    border-color: var(--gob-primary);
}

/* =========================
   CARRUSEL PRINCIPAL
========================= */
.hero-carousel {
    position: relative;
    width: calc(100% - 120px);
    max-width: 1500px;
    height: 560px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--gob-tertiary);
    border-bottom: 1px solid var(--gob-accent);
    border-left: 1px solid var(--gob-accent);
    border-right: 1px solid var(--gob-accent);
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.carousel-slide.active {
    z-index: 1;
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.carousel-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(10, 19, 45, 0.88) 0%,
        rgba(10, 19, 45, 0.60) 45%,
        rgba(10, 19, 45, 0.18) 100%
    );
}

.carousel-content {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 9%;
    max-width: 620px;
    color: var(--gob-white);
    transform: translateY(-50%);
}

.carousel-content .tag {
    display: inline-block;
    margin-bottom: 18px;
    padding: 8px 12px;
    background: var(--gob-primary);
    color: var(--gob-white);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.carousel-content h1 {
    margin: 0 0 18px;
    color: var(--gob-white);
    font-size: 58px;
    line-height: 1.1;
    overflow-wrap: anywhere;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.carousel-content p {
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 19px;
    line-height: 1.6;
}

.carousel-btn {
    position: absolute;
    z-index: 10;
    top: 50%;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.88);
    color: var(--gob-tertiary);
    font-size: 24px;
    cursor: pointer;
    transform: translateY(-50%);
}

.carousel-btn:hover {
    background: var(--gob-white);
}

.carousel-btn.prev {
    left: 18px;
}

.carousel-btn.next {
    right: 18px;
}

.carousel-dots {
    position: absolute;
    z-index: 10;
    bottom: 28px;
    left: 50%;
    display: flex;
    gap: 10px;
    transform: translateX(-50%);
}

.dot {
    width: 13px;
    height: 13px;
    padding: 0;
    border: 2px solid var(--gob-white);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.dot.active {
    background: var(--gob-white);
}

/* =========================
   ACCESOS R脕PIDOS
========================= */
.quick-links {
    position: relative;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 25px;
    margin-top: 35px;
}

.quick-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    overflow: hidden;
    background: var(--gob-white);
    border: 1px solid var(--gob-accent);
    border-left: 6px solid var(--gob-primary);
    color: var(--gob-black);
    text-decoration: none;
}

.quick-card:hover {
    background: var(--gob-neutral);
}

.quick-card h3 {
    margin: 0 0 6px;
    color: var(--gob-black);
    font-size: 1.25rem;
}

.quick-card p {
    margin: 0;
}

.quick-icon {
    font-size: 30px;
}

.quick-img {
    width: 100%;
    height: 130px;
    display: block;
    object-fit: cover;
}
/* =========================
   SECCIONES
========================= */
.section {
    margin-top: 55px;
    margin-bottom: 55px;
}

.section-header h2 {
    position: relative;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gob-accent);
    font-size: 1.6875rem;
}

.section-header h2::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 3px;
    background: var(--gob-primary);
}

/* =========================
   NOTICIAS Y SERVICIOS
========================= */
.news-grid,
.service-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 25px;
}

.news-card,
.service-card {
    overflow: hidden;
    background: var(--gob-white);
    border: 1px solid var(--gob-accent);
}

.news-image {
    position: relative;
    height: 190px;
    overflow: hidden;
    background: var(--gob-neutral);
}

.news-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.badge {
    position: absolute;
    z-index: 1;
    top: 12px;
    left: 12px;
    padding: 5px 8px;
    background: var(--gob-primary);
    color: var(--gob-white);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-secondary {
    background: var(--gob-secondary);
}

.badge-tertiary {
    background: var(--gob-tertiary);
}

.news-body {
    padding: 22px;
}

.news-body small {
    color: var(--gob-gray-a);
    font-size: 0.75rem;
}

.news-body h3 {
    margin: 12px 0;
    color: var(--gob-black);
    font-size: 1.25rem;
}

.news-body p {
    margin-bottom: 18px;
}

.read-more {
    color: var(--gob-black);
    font-weight: 700;
    text-decoration: underline;
}

.read-more:hover {
    color: var(--gob-primary);
}

/* =========================
   SERVICIOS
========================= */
.service-card {
    padding: 25px;
    border-top: 5px solid var(--gob-primary);
}

.service-card h3 {
    margin-top: 0;
    color: var(--gob-black);
    font-size: 1.25rem;
}

.service-card p {
    margin-bottom: 0;
}

.service-card img {
    width: calc(100% + 50px);
    max-width: calc(100% + 50px);
    height: 170px;
    display: block;
    margin: -25px -25px 18px;
    object-fit: cover;
}

/* =========================
   CONTACTO Y MAPA
========================= */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 35px;
    padding: 35px;
    background: var(--gob-white);
    border: 1px solid var(--gob-accent);
}

.contact-grid h3 {
    margin-top: 0;
}

.map-box {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: var(--gob-neutral);
    border: 1px solid var(--gob-accent);
}

.map-box iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* =========================
   FOOTER
========================= */
.footer {
    padding: 35px 0;
    background: var(--gob-neutral);
    border-top: 4px solid var(--gob-primary);
    color: var(--gob-black);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
}

.footer h3,
.footer p {
    margin: 5px 0;
}

/* =========================
   REDES SOCIALES FOOTER
========================= */
.footer-social {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-social-btn {
    width: 60px;
    height: 60px;
    overflow: hidden;
    display: flex;
    align-items: center;
    border-radius: 8px;
    color: var(--gob-white);
    text-decoration: none;
    font-weight: 700;
    transition: width 0.3s ease, box-shadow 0.2s ease;
}

.footer-social-btn span:first-child {
    width: 60px;
    min-width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
}

.footer-social-btn span:last-child {
    opacity: 0;
    white-space: nowrap;
    padding-right: 16px;
    transition: opacity 0.2s ease;
}

.footer-social-btn:hover {
    width: 185px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.footer-social-btn:hover span:last-child {
    opacity: 1;
}

.footer-social-btn.instagram {
    background: linear-gradient(
        135deg,
        #405DE6,
        #833AB4,
        #E1306C,
        #FCAF45
    );
}

.footer-social-btn.facebook {
    background: #1877F2;
}

.footer-social-btn.youtube {
    background: #FF0000;
}

.footer-social-btn.whatsapp {
    background: #25D366;
}

.footer-social-btn.whatsapp:hover {
    background: #1ebe5d;
}

.footer-social-btn.facebook span:first-child {
    font-family: Arial, sans-serif;
    font-size: 36px;
}

/* =========================
   LAYOUT NOTICIAS + ACCESOS
========================= */
.home-layout {
    display: grid;
    grid-template-columns: 2fr 0.85fr;
    gap: 28px;
    align-items: start;
}

.main-news .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.side-access {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 55px;
}

.side-card {
    position: relative;
    min-height: 92px;
    padding: 18px 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #0A132D, #006FB3);
    background-position: center;
    background-size: cover;
    border-left: 6px solid var(--gob-secondary);
    color: white;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.side-card::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(10, 19, 45, 0.90),
        rgba(0, 111, 179, 0.55)
    );
}

.side-card span,
.side-card strong {
    position: relative;
    z-index: 1;
    color: white;
    text-transform: uppercase;
}

.side-card span {
    font-size: 14px;
    font-weight: 400;
}

.side-card strong {
    font-size: 24px;
    line-height: 1;
}

.side-card:hover {
    transform: translateX(4px);
}

/* =========================
   ACCESOS DESTACADOS
   SOLO IMAGEN
========================= */
.side-card.only-image {
    min-height: auto;
    padding: 0;
    overflow: hidden;
    background: transparent;
    border-left: 6px solid var(--gob-primary);
}

.side-card.only-image::after {
    display: none;
}

.side-card.only-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* =========================
   NOTICIA DETALLE
========================= */
.noticia-detalle {
    max-width: 850px;
    margin: 0 auto;
}

.noticia-detalle h1 {
    margin-top: 20px;
    color: var(--gob-tertiary);
    font-size: 42px;
}

.noticia-detalle img {
    width: 100%;
    max-height: 420px;
    margin: 25px 0;
    border: 1px solid var(--gob-accent);
    object-fit: cover;
}

.noticia-resumen {
    color: var(--gob-black);
    font-size: 20px;
    font-weight: 700;
}

.noticia-contenido {
    margin-bottom: 30px;
    color: var(--gob-gray-a);
    font-size: 17px;
    line-height: 1.8;
}

/* =========================
   QUI脡NES SOMOS
========================= */
.qs-value img {
    width: 90px;
    height: 90px;
    margin-bottom: 15px;
    object-fit: contain;
}

/* =========================
   RESPONSIVE TABLET
========================= */
@media (max-width: 900px) {
    .hero-carousel {
        width: 100%;
        height: 500px;
        border-right: none;
        border-left: none;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .map-box {
        height: 320px;
    }

    .home-layout {
        grid-template-columns: 1fr;
    }

    .main-news .news-grid {
        grid-template-columns: 1fr;
    }

    .side-access {
        margin-top: 0;
    }
}

/* =========================
   RESPONSIVE CELULAR
   SOLO HASTA 768px
========================= */
@media (max-width: 768px) {
    .container {
        width: 92%;
    }

    /* =========================
       NAVBAR CELULAR
    ========================= */
    .nav-container {
        min-height: 76px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        padding: 10px 0;
    }

    .brand {
        min-width: 0;
        flex: 1;
    }

    .brand-img {
        width: auto;
        max-width: 210px;
        height: 48px;
        object-fit: contain;
    }

    /* Mostrar hamburguesa en celular */
    .menu-toggle {
        display: inline-flex;
    }

    /* Men煤 cerrado por defecto */
    .menu {
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        z-index: 1001;

        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;

        width: 100%;
        max-height: 70vh;
        overflow-y: auto;
        overscroll-behavior: contain;

        margin: 0;
        padding: 8px 14px 14px;

        background: var(--gob-white);
        border-top: 1px solid var(--gob-accent);
        border-radius: 0 0 10px 10px;
        box-shadow: 0 14px 28px rgba(10, 19, 45, 0.18);
    }

    /* Men煤 abierto por JavaScript */
    .menu.menu-open {
        display: flex;
    }

    .menu a {
        width: 100%;
        min-height: 48px;
        display: flex;
        align-items: center;
        padding: 13px 14px;
        border-bottom: 1px solid #eeeeee;
        color: var(--gob-tertiary);
        text-decoration: none;
        font-size: 16px;
        font-weight: 700;
    }

    .menu a:hover,
    .menu a:focus {
        background: rgba(217, 46, 94, 0.08);
        color: var(--gob-primary);
        text-decoration: none;
    }

    /* Iniciar sesi贸n dentro del men煤 */
    .menu .login-icon {
        width: 100%;
        height: auto;
        min-height: 48px;
        margin-top: 8px;
        justify-content: flex-start;
        background: rgba(217, 46, 94, 0.08);
        border: 1px solid rgba(217, 46, 94, 0.24);
        border-radius: 8px;
        font-size: 0;
    }

    .menu .login-icon::before {
        content: "馃懁";
        margin-right: 10px;
        font-size: 20px;
    }

    .menu .login-icon::after {
        content: "Iniciar sesi贸n";
        color: var(--gob-primary);
        font-size: 16px;
        font-weight: 700;
    }

    /* =========================
       CARRUSEL CELULAR
    ========================= */
    .hero-carousel {
        width: 100%;
        height: 430px;
    }

    .carousel-content {
        right: 7%;
        left: 7%;
        max-width: none;
    }

    .carousel-content .tag {
        margin-bottom: 12px;
        padding: 6px 9px;
        font-size: 11px;
    }

    .carousel-content h1 {
        margin-bottom: 14px;
        font-size: 36px;
        line-height: 1.08;
    }

    .carousel-content p {
        margin-bottom: 22px;
        font-size: 16px;
        line-height: 1.45;
    }

    .carousel-btn {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .carousel-btn.prev {
        left: 8px;
    }

    .carousel-btn.next {
        right: 8px;
    }

    .carousel-dots {
        bottom: 18px;
    }

    /* =========================
       ACCESOS R脕PIDOS
    ========================= */
    .quick-links {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 25px;
    }

    .quick-card {
        padding: 18px;
    }

    /* =========================
       NOTICIAS Y SERVICIOS
    ========================= */
    .news-grid,
    .service-grid,
    .main-news .news-grid {
        grid-template-columns: 1fr;
    }

    .section {
        margin-top: 40px;
        margin-bottom: 40px;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    /* =========================
       CONTACTO
    ========================= */
    .contact-grid {
        gap: 24px;
        padding: 22px;
    }

    /* =========================
       FOOTER
    ========================= */
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-social {
        flex-wrap: wrap;
        margin: 15px 0;
    }

    .footer-social-btn,
    .footer-social-btn:hover {
        width: 180px;
    }

    .footer-social-btn span:last-child {
        opacity: 1;
    }

    /* =========================
       NOTICIA DETALLE
    ========================= */
    .noticia-detalle h1 {
        font-size: 32px;
    }
}

/* =========================
   CELULARES PEQUE脩OS
========================= */
@media (max-width: 480px) {
    .brand-img {
        max-width: 180px;
        height: 44px;
    }

    .menu-toggle {
        width: 42px;
        height: 42px;
        font-size: 27px;
    }

    .menu {
        max-height: 65vh;
        padding-right: 10px;
        padding-left: 10px;
    }

    .hero-carousel {
        height: 400px;
    }

    .carousel-content {
        top: 46%;
        right: 8%;
        left: 8%;
    }

    .carousel-content h1 {
        font-size: 30px;
    }

    .carousel-content p {
        font-size: 15px;
    }

    .carousel-btn {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }

    .quick-card {
        padding: 16px;
    }

    .contact-grid {
        padding: 18px;
    }

    .footer-social-btn,
    .footer-social-btn:hover {
        width: 100%;
    }
}

