/* ================================ */
/* ESTILOS GENERALES                */
/* ================================ */
body {
    margin: 0;
    font-family: "Nunito", Arial, sans-serif;
    font-size: 16px;
}

html,
body {
    overflow-x: hidden; /* Evita la barra de desplazamiento horizontal */
    width: 100%;
}

/* Fondo con textura para toda la página */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("/img/Fondo_textura.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.4; /* Control de transparencia */
    z-index: -1; /* Asegura estar detrás de todo el contenido */
}

/* ================================ */
/* HEADER Y TOPBAR                  */
/* ================================ */

/* Barra superior (topbar) */
.topbar {
    background-color: rgb(144, 12, 63); /* Color corporativo */
    padding: 5px 0;
    color: rgb(144, 12, 63);
    height: auto;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.topbar .container {
    width: 100%;
    padding: 0 15px;
}

/* Información de contacto */
.contact-info {
    color: rgb(255, 255, 255);
    font-size: 14px;
    gap: 10px;
    display: flex;
    align-items: center;
    margin: 5px 0;
    white-space: nowrap; /* Previene saltos de línea */
    flex-wrap: wrap;
    justify-content: center;
}

.contact-info-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.contact-info img {
    width: 20px;
    margin-right: 1px;
    filter: brightness(0) saturate(100%) invert(25%) sepia(69%) saturate(2988%)
        hue-rotate(320deg) brightness(94%) contrast(90%);
}

/* ================================ */
/* ICONOS SOCIALES                  */
/* ================================ */

/* Contenedor de iconos sociales */
.social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin: 5px 0;
}

.social-icons-container {
    display: flex;
    justify-content: flex-end; /* Alineación a la derecha */
}

/* Estilo base para iconos sociales */
.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: transparent !important;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 20px;
    color: rgb(255, 255, 255);
    line-height: 1;
}

.social-icon i,
.social-icon img {
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icon i {
    font-size: 20px !important; /* Sobrescribe estilos inline */
}

/* Efectos hover para iconos sociales */
.social-icon:hover {
    transform: translateY(-3px);
    background-color: transparent !important;
    color: #ccc;
}

/* Colores específicos por red social */
.social-icon.facebook:hover {
    color: blue;
}
.social-icon.x:hover {
    color: black;
}
.social-icon.youtube:hover {
    color: red;
}

/* Gradientes para Instagram y TikTok */
.social-icon.instagram:hover {
    background: linear-gradient(
        45deg,
        #f09433,
        #e6683c,
        #dc2743,
        #cc2366,
        #bc1888
    );
    background-clip: text;
    color: transparent;
}

.social-icon.tiktok:hover {
    background: linear-gradient(45deg, #000000, #ffffff, #ff0050, #00f2ea);
    background-clip: text;
    color: transparent;
}

/* Icono de X/Twitter específico */
.social-icon.x img,
.footer-social-icon.x img {
    width: 20px;
    height: 20px;
    filter: brightness(0) saturate(100%) invert(1); /* Blanco por defecto */
    transition: all 0.3s ease;
}

.social-icon.x:hover img,
.footer-social-icon.x:hover img {
    filter: brightness(0) saturate(100%) invert(0); /* Negro en hover */
}

/* ================================ */
/* NAVBAR Y LOGOTIPO               */
/* ================================ */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: transparent; /* Navbar transparente */
    padding: 10px;
}

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

.navbar-logo img {
    height: auto;
    max-height: 110px;
    width: auto;
    margin: 0;
}

/* Banner de enlaces destacados */
.highlight-banner h6 {
    font-size: min(18px, 4vw);
    font-weight: bold;
    margin: 0;
    padding: 10px;
    color: #900c3f;
    text-align: center;
}

.highlight-banner h6 a {
    text-decoration: none;
    color: #900c3f;
    transition: color 0.3s ease;
}

.highlight-banner h6 a:hover {
    color: #721c24;
}

/* ================================ */
/* SECCIÓN VIDEO Y BANNER           */
/* ================================ */

.video-container {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
    margin-top: 0;
}

.video-container video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* Contenedor del banner sobre el video */
.banner-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.overlay-image {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ================================ */
/* SERVICIOS Y TRÁMITES            */
/* ================================ */

#services {
    padding: 20px 0;
    margin-top: 0;
}

.section-title {
    text-align: center;
    margin-bottom: 20px;
}

.section-title h2 {
    font-size: 2rem;
    color: #333;
}

/* Grid de servicios con flexbox */
#services .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 0 -10px;
}

.service-link {
    flex: 1 0 200px;
    max-width: 220px;
    padding: 10px;
    margin-bottom: 15px;
    transition: transform 0.3s;
}

.service-img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease-in-out;
    border-radius: 10px; /* Bordes redondeados */
}

/* Efecto hover en servicios */
.service-img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ================================ */
/* PIE DE PÁGINA                   */
/* ================================ */

/* Links sociales en footer */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 10px;
}

.footer-top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: left;
}

/* Títulos del footer */
.footer-links h4,
.footer-about h4 {
    display: flex;
    align-items: center;
}

/* Enlaces del footer */
.footer-links ul li a,
.footer-about a.logo,
.footer-about p a {
    color: #ffffff;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.3s;
}

.footer-links ul li a:hover,
.footer-about p a:hover {
    color: #ccc;
}

.footer-about p,
.footer-links ul li {
    text-align: justify;
}

.footer-links,
.footer-about {
    padding: 0 15px;
}

/* Iconos sociales del footer */
.footer-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: transparent !important;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 20px;
    color: #fff;
}

.footer-social-icon:hover {
    background-color: transparent !important;
    transform: translateY(-3px);
}

/* ================================ */
/* ICONOS Y ELEMENTOS AUXILIARES    */
/* ================================ */

.icon-small {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 5px;
}

.white-icon {
    filter: invert(1);
}

.icon {
    width: 20px;
    height: auto;
    margin-right: 8px;
    filter: invert(1) grayscale(1);
}

/* ================================ */
/* MEDIA QUERIES - RESPONSIVE       */
/* ================================ */

/* Pantallas extra pequeñas (móviles) */
@media (max-width: 480px) {
    .col-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .service-img {
        max-width: 150px;
    }

    .contact-info {
        font-size: 13px;
    }

    .service-link {
        flex: 0 0 calc(100% - 30px);
        max-width: calc(100% - 30px);
    }

    .footer-top {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .video-container {
        height: 30vh;
    }

    .footer-links ul li a {
        font-size: 16px;
    }

    .social-links {
        gap: 10px;
    }

    .footer-social-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .navbar-logo img {
        max-height: 80px;
    }

    .highlight-banner h6 {
        font-size: 12px;
        margin: 10px 0;
        text-align: justify;
    }
}

/* Móviles y tablets pequeñas */
@media (max-width: 767.98px) {
    /* Ocultar información de contacto */
    .col-md-7.col-12 {
        display: none !important;
    }

    /* Ajustar contenedor social */
    .col-md-5.col-12 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        text-align: center;
    }

    /* Centrar iconos sociales */
    .social-icons-container {
        justify-content: center;
        width: 100%;
    }

    /* Optimizar iconos para móvil */
    .social-icon {
        width: 40px;
        height: 40px;
        margin: 0 5px;
    }

    .social-icon i {
        font-size: 22px !important;
    }

    /* Topbar más compacto */
    .topbar {
        padding: 8px 0;
    }

    .topbar .container {
        flex-direction: column;
        padding: 5px 0;
    }

    .social-icons {
        display: flex !important; /* Sobrescribe d-none d-md-flex */
        margin: 10px 0;
        justify-content: center;
        width: 100%;
    }

    /* Layout en columnas para móvil */
    .topbar .row {
        flex-direction: column;
    }

    .navbar {
        flex-direction: column;
    }

    .contact-info-group {
        justify-content: center;
        text-align: center;
        margin-bottom: 8px;
    }
}

/* Pantallas medianas y grandes */
@media (min-width: 768px) {
    .col-md-7.col-12 {
        display: flex !important;
    }

    .topbar .row {
        flex-direction: row !important;
    }

    .social-icons {
        margin-left: 20px;
    }
}

/* Estilos para tablets */
@media (min-width: 768px) and (max-width: 991px) {
    .contact-info {
        font-size: 13px;
    }

    .service-link {
        flex: 0 0 calc(33.333% - 30px);
        max-width: calc(33.333% - 30px);
    }

    .video-container {
        height: 50vh;
    }
}

/* Pantallas grandes */
@media (min-width: 992px) {
    .service-link {
        flex: 0 0 calc(25% - 30px);
        max-width: calc(25% - 30px);
    }
}
