/* ================================ */
/* ESTILOS GENERALES                */
/* ================================ */

/* Aplicar Montserrat a TODOS los elementos */
* {
    font-family: "Montserrat", Arial, sans-serif !important;
}

body {
    margin: 0;
    font-family: "Montserrat", 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) invert(1);
}

/* ================================ */
/* 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: center; /* Centrado en todos los tamaños */
    background-color: transparent; /* Navbar transparente */
    padding: 10px;
}

.navbar-logo {
    text-align: center;
    width: 100%; /* Asegura que ocupe todo el ancho disponible */
}

.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: 45vh;
    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;
    /* Mejoras de calidad de video */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    filter: none;
    will-change: transform;
}

.video-container iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw; /* 16:9 aspect ratio (9/16 * 100) */
    min-height: 100%;
    min-width: 177.78vh; /* 16:9 aspect ratio (16/9 * 100) */
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
}

/* 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;
}

/* Título del banner sobre el video */
.banner-title {
    font-size: 5.5rem;
    color: #ffffff;
    font-weight: bold;
    text-align: center;
    margin: 0;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.7);
}

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

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

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

.section-title h2 {
    font-size: 2.5rem;
    color: #a62346;
    letter-spacing: 8px;
}

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

.section-supertitle h2 {
    font-size: 2rem;
    color: #a62346;
}

/* 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;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.service-link label {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 8px;
}

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

/* Imágenes de bancos (ventanilla) más pequeñas */
.bank-img {
    max-width: 160px;
    width: 100%;
    height: auto;
}

/* Forzar a prevalecer sobre .img-fluid de Bootstrap (cargado después) */
.service-link img.bank-img {
    max-width: 140px !important;
}

/* Contenedor para "En Ventanilla" y sus bancos */
.ventanilla-container {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    margin-bottom: 20px;
}

/* Título "En Ventanilla" - lateral en desktop */
.ventanilla-title {
    flex-shrink: 0;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
    color: #a62346;
    font-weight: bold;
    font-size: 34px;
    margin: 0;
    padding: 0 10px;
    letter-spacing: 12px;
}

/* Contenedor de bancos dentro de ventanilla */
.ventanilla-banks {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex: 1;
}

/* Reutilizar estilos para "Efectivo o Tarjeta" */
.payment-container {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    margin-bottom: 20px;
}

.payment-title {
    flex-shrink: 0;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
    color: #a62346;
    font-weight: bold;
    font-size: 44px;
    margin: 0;
    padding: 0 10px;
    letter-spacing: 12px;
}

.payment-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    flex: 1;
    align-items: center;
}

/* Filas de pago */
.payment-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
    justify-content: center;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* Efecto hover para el elemento de pasarela (EN LÍNEA Y TIENDAS DE AUTOSERVICIO) */
.payment-row-pasarela {
    padding: 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.payment-row-pasarela:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(30, 92, 80, 0.2);
    background-color: rgba(255, 255, 255, 0.5);
}

/* Efecto hover en la imagen dentro de payment-row-pasarela */
.payment-row-pasarela:hover .service-img {
    transform: scale(1.05);
}

/* Efecto hover en los textos dentro de payment-row-pasarela */
.payment-row-pasarela:hover p {
    color: #145046 !important;
}

/* Efecto hover para el elemento de banbajio (EN LÍNEA CON BANBAJIO) */
.payment-row-banbajio {
    padding: 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.payment-row-banbajio:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(30, 92, 80, 0.2);
    background-color: rgba(255, 255, 255, 0.5);
}

/* Efecto hover en la imagen dentro de payment-row-banbajio */
.payment-row-banbajio:hover .service-img {
    transform: scale(1.05);
}

/* Efecto hover en los textos dentro de payment-row-banbajio */
.payment-row-banbajio:hover p {
    color: #145046 !important;
}

/* Mostrar/ocultar imágenes según dispositivo */
.desktop-img {
    display: block !important;
}

.mobile-img {
    display: none !important;
}

/* ================================ */
/* 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: 120px;
    }

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

    .service-link {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .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;
    }

    /* Banner título en móvil */
    .banner-title {
        font-size: 2rem;
        letter-spacing: 8px;
    }

    /* Ajustar tamaño de títulos en móvil */
    .section-title h2 {
        font-size: 1.8rem !important;
        letter-spacing: 4px !important;
        padding: 0 10px;
    }

    /* Ventanilla en móvil: vertical sin rotación */
    .ventanilla-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .ventanilla-title {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 20px;
        margin-bottom: 15px;
        text-align: left;
        width: 100%;
    }

    /* Efectivo o Tarjeta en móvil: vertical sin rotación */
    .payment-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .payment-title {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 289px;
        margin-bottom: 15px;
        text-align: left;
        width: 100%;
    }

    /* Filas de pago en móvil: texto abajo de imagen */
    .payment-row {
        flex-direction: column;
        align-items: center;
    }

    .payment-row .service-link {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: 100%;
    }

    /* Intercambiar imágenes en móvil */
    .desktop-img {
        display: none !important;
    }

    .mobile-img {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Móviles medianos */
@media (min-width: 481px) and (max-width: 767.98px) {
    .service-link {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* 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;
    }

    /* Banner título en móvil/tablet */
    .banner-title {
        font-size: 3.5rem;
        letter-spacing: 10px;
    }

    /* Ajustar tamaño de títulos en tablet */
    .section-title h2 {
        font-size: 2.5rem !important;
        letter-spacing: 8px !important;
        padding: 0 15px;
    }

    /* Ventanilla en móvil/tablet: vertical sin rotación */
    .ventanilla-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .ventanilla-title {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 22px;
        margin-bottom: 15px;
        text-align: left;
        width: 100%;
    }

    /* Efectivo o Tarjeta en móvil/tablet: vertical sin rotación */
    .payment-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .payment-title {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 22px;
        margin-bottom: 15px;
        text-align: left;
        width: 100%;
    }

    /* Filas de pago en móvil/tablet: texto abajo de imagen */
    .payment-row {
        flex-direction: column;
        align-items: center;
    }

    .payment-row .service-link {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: 100%;
    }

    /* Intercambiar imágenes en móvil/tablet */
    .desktop-img {
        display: none !important;
    }

    .mobile-img {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* 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);
    }

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