/* ========================================
    VARIABLES GLOBALES
======================================== */
:root {
    --bg-app: url('../img/fondo-app.webp');
    --color-principal: rgb(245, 101, 5);
    --color-blanco: #fff;
    --color-negro: #000;
    --color-hover: rgb(131, 131, 131);
    --font-base: system-ui, sans-serif;
}

/* ========================================
    RESET Y BASE
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    font-family: var(--font-base);
    line-height: 1.6;
    color: var(--color-blanco);
}

body {
    background-image: var(--bg-app);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    transition: background-image 0.3s ease-in-out;
}

/* Fondo de la navbar: transparente para heredar el fondo de la web */
.navbar-custom {
    background: transparent;
    padding-top: 2rem;
    padding-bottom: 2rem;
    border-top: 9px solid var(--color-principal);
    border-bottom: 3px solid var(--color-principal);
}


.navbar-custom .navbar-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 3rem;
    align-items: center;
}

/* Logo */
.logo {
    width: 170px;
    max-width: 100%;
    height: auto;
}

/* Separadores entre links */
.navbar-custom .nav-item {
    position: relative;
}

/* Separadores entre links usando pseudo-elementos */
.navbar-custom .nav-item:not(:last-child) {
    position: relative;
}

/* Separadores entre links usando pseudo-elementos */
.navbar-custom .nav-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -1.5rem;
    top: 0;
    height: 100%;
    border-right: 2px solid var(--color-blanco);
}

/* Enlaces normales */
.navbar-custom .nav-link {
    padding: 0 4rem;
    color: var(--color-blanco);
    font-weight: 500;
    font-size: 1.3rem;
    transition: color 0.3s ease;
    display: inline-block;
}

/* Enlaces al pasar el mouse */
.navbar-custom .nav-link:hover {
    border-bottom: 2px solid var(--color-principal);
}


/* Botón hamburguesa */
.navbar-custom .navbar-toggler {
    border-color: var(--color-principal);

}

/* Icono hamburguesa en blanco */
.navbar-custom .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='white' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/*=========================Carousel General=========================*/
.carousel-inner .carousel-item img {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    object-position: center top;
    opacity: 0.9;
}


.carousel-img-container {
    position: relative;
}


.carousel-img-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
    pointer-events: none;
    z-index: 5;
}


.carousel-caption {
    position: relative;
    text-align: center;
    z-index: 10;
}

.carousel__link {
    text-decoration: none;
    color: var(--color-blanco);
    display: inline-block;
}

.carousel__link:hover h3 {
    color: var(--color-hover);
    text-decoration: underline;
}

.black-bar {
    background-color: var(--color-negro);
    color: var(--color-blanco);
    padding: 10px 80px;
    text-align: center;
    position: absolute;
    bottom: 220px;
    left: 0;
    right: 0;
    z-index: 20;
}

.black-bar h3 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

/* =========================
   Botones de navegación del carrusel
========================= */
.carousel-control-prev,
.carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--color-principal, rgba(255, 255, 255, 0.2));
    /* usa variable o fallback */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    border: none;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background-color: var(--color-principal, rgba(255, 255, 255, 0.4));
    transform: scale(1.1);
}

/* Elimina los SVG por defecto */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    display: none;
}

/* Íconos de Font Awesome */
.carousel-control-prev i,
.carousel-control-next i {
    font-size: 1.8rem;
    color: var(--color-negro);
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
    /* para que no se pierdan en fondos claros */
}

/* Posición */
.carousel-control-prev {
    left: 20px;
}

.carousel-control-next {
    right: 20px;
}



/* ========================================
    GRID DE IMÁGENES
======================================== */
#image-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(4, 1fr);
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0.7;
}

.grid-piece {
    background-image: url('../img/nosotros.webp');
    background-size: 800% 400%;
    opacity: 0;
    transition: opacity 0.5s;
}

/* ========================================
    ABOUT
======================================== */
.about {
    position: relative;
    padding: 1rem;
    color: var(--color-blanco);
    text-align: center;
    overflow: hidden;
    margin: 0;
}

.about__title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-principal);
    margin-bottom: 2rem;
}



.about__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(4, 1fr);
    overflow: hidden;
    z-index: 1;
}

.about__content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.6);
    /* overlay oscuro para legibilidad */
    padding: 3rem;
    border-radius: 1rem;
}

.about__subtitle {
    font-size: 2rem;
    font-weight: 700;
    color: #f56505;
    margin-bottom: 1.5rem;
}

.about__text {
    font-size: 1.3rem;
    line-height: 1.8;
    margin-bottom: 2.6rem;
    color: #eee;
}

/* Contenedor general del slider */
.slider__container {
    padding: 10px 2%;
    width: 100%;
    overflow: hidden;

}

.title__services {
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 700;
    color: rgb(255, 254, 254);
    /* Color institucional */
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 7rem;
    position: relative;
    text-align: center;
    margin-top: 4rem;
}

.title__services::after {
    content: "";
    width: 80px;
    height: 4px;
    background: rgb(255, 123, 0);
    /* Color institucional */
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}



/* Contenedor del contenido deslizante */
.slide__content {
    margin-bottom: 4rem;
    position: relative;
    width: 100%;
    overflow: hidden;

}

/* Contenedor de las tarjetas adaptado a Swiper */
.swiper-wrapper {
    display: flex;
}

/* Tarjeta individual */

swiper-slide {
    flex-shrink: 0;          /* no se encogen */
    width: 85%;              /* que se vea casi toda en móviles */
    max-width: 300px;        /* límite en pantallas grandes */
    border-radius: 8px;
    background: white;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}
/*.swiper-slide {
    flex: 0 0 auto;
    width: 90%;
    max-width: 300px;
    min-width: 300px;
    border-radius: 8px;
    background: white;
    overflow: hidden;
    margin: 0 auto;
    scroll-snap-align: start;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}*/

/* Contenedor de las tarjetas, scroll horizontal con snapping */
.card__wrapper {
    display: flex;
    overflow-x: auto;
    /* Permite desplazamiento horizontal */
    scroll-snap-type: x mandatory;
    /* Obliga al snap a la tarjeta m谩s cercana */
    -webkit-overflow-scrolling: touch;
    /* Mejora scroll en iOS */
    gap: 20px;
    /* Espacio entre tarjetas */
    padding-bottom: 10px;
    scroll-padding: 20px;
    /* Espacio antes del primer snap */
}

/* Tarjeta individual */

.card {
    flex: 0 0 auto;
    width: 300px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--color-blanco);

    display: flex;
    flex-direction: column;

    height: auto;
    /* que se ajuste al contenido */
    min-height: 0;
    /* elimina espacio extra */
}


/* Contenedor de la imagen de la tarjeta */
.image__box {
    height: 200px;
    width: 100%;
}

/* Imagen dentro de la tarjeta */
.image__box img {
    width: 100%;
    height: 100%;
    border-radius: 8px 8px 0 0;
    object-fit: cover;
}

/* Contenido textual de la tarjeta */
.profile__details {
    padding: 10px;
    margin-bottom: 10px;
    font-size: 15px;

}

.name__title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 15px;
}

.name__description {
    font-size: 14px;
    color: #4d4d4d;
    max-height: 100px;
    /* límite */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    /* máximo 4 líneas */
    -webkit-box-orient: vertical;
    line-clamp: 4;
    /* estándar futuro */
    box-orient: vertical;
}

/* Bot贸n dentro de la tarjeta */
.card__button {
    margin-top: 10px;
    /* Empuja el bot贸n al final de la tarjeta */
    padding: 15px;
    background-color: rgb(255, 123, 0);
    color: #e9e9e9;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
    border-radius: 2px;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
}

/* Hover del bot贸n */
.card__button:hover {
    background-color: var(--color-principal);
    transform: scale(1.05);
    color: var(--color-negro);
}

/* =========================
   BOTONES SWIPER
========================= */
.swiper {
    position: relative; /* Importante para que los botones se posicionen sobre el slider */
}

.swiper-button-prev,
.swiper-button-next {
    
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--color-principal, rgba(255, 255, 255, 0.2));
    /* usa variable o fallback */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    border: none;
    
    
   /* position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    color: var(--color-principal); /* o var(--color-principal) 
    background: rgba(0, 0, 0, 0.5); /* fondo visible 
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;*/
}

.swiper-button-prev { left: 10px; }
.swiper-button-next { right: 10px; }

.swiper-button-prev ,
.swiper-button-next {
    background-color: var(--color-principal, rgba(255, 255, 255, 0.4));
    transform: scale(1.1);
}



/* Servicios */
.services__container {
    margin: 0 auto 4rem auto;
    padding: 0 50px;
    text-align: justify;
}

.services__container p {
    line-height: 1.6;
    font-size: 23px;
    color: #ffffff;
    margin-bottom: 10rem;
}

.services__subtitle {
    font-size: 1.9em;
    color: #ffffff;
    margin-top: 10px;
    margin-bottom: 5rem;
    text-align: center;
}

#fullImageView {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    text-align: center;
    z-index: 9999;
    overflow: auto;
}

#fullImage {
    padding: 24px;
    max-width: 98%;
    max-height: 98%;
}

.services__galeria {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 10px;
    margin-bottom: 2rem;
}

.services__galeria img {
    max-width: 298px;
    max-height: 224px;
    margin: 2px;
}

.services__galeria img:hover {
    cursor: pointer;
    filter: brightness(70%);
}



#closeButton {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    z-index: 10000;
}


/* ========================================
    LAYOUT GENERAL
======================================== */
.layout {
    height: 100%;
    border-radius: 2rem;
    padding: 1rem;
}

.layout__main {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.main__container {
    width: 90%;
}

/* .main__title {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 800;
    font-size: 3rem;
    color: var(--color-blanco);
} */

/* ========================================
    SOCIALS
======================================== */
.main__socials {
    width: 100%;
    background-color: rgba(245, 101, 5, 0.7);
    border-radius: 10px;
    padding: 1rem 1rem;
    display: flex;
    justify-content: space-around;
    list-style: none;
}

.socials__item {
    width: 65%;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--color-negro);
    margin: 1rem 1rem;
}

.socials__item i {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.socials__number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.socials__title {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;

}


/* Contacto */
/* .contact__layout {
    padding: 20px 20px;
    font-family: 'Helvetica Neue', sans-serif;
    padding-bottom: 10px;
    margin-top: 1px;
} */

.layout__year {
    color: var(--color-blanco);
    text-align: center;
    font-size: 1.3em;

}
.contact__services {
    font-size: clamp(3rem, 3vw, 2.5rem);
    font-weight: 700;
    color: rgb(255, 254, 254);
    /* Color institucional */
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 3rem;
    position: relative;
    text-align: center;
    margin-top: 1rem;
}

.contact__services::after {
    content: "";
    width: 80px;
    height: 4px;
    background: rgb(255, 123, 0);
    /* Color institucional */
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}


.contact__nav-container {
    display: flex;
    flex-direction: row;
    /* aseguramos fila */
    justify-content: space-between;
    align-items: flex-start;
    /* para que el contenido no se estire verticalmente */
    gap: 20px;
    flex-wrap: wrap;
    /* responsive */
    min-height: auto;
    /* no ocupar toda la pantalla */
    margin-top: 2rem;
}




.contact__nav {
    width: 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 100px;
}

.contact__logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.contact__logo-link {
    display: flex;
    justify-content: center;
}

.contact__logo-img {
    max-width: 250px;
    height: auto;
}

.contact__links {
    width: 100%;
    text-align: center;
   
}

.contact__menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0;
    padding: 0;
}

.contact__menu-item {
    margin: 0;
}

.contact__menu-link {
    color: var(--color-blanco);
    text-decoration: none;
    font-weight: bold;
    font-family: 'Helvetica Neue', sans-serif;
    transition: color 0.3s;
    font-size: 1.2rem;
}

.contact__menu-link:hover {
    color: var(--color-principal);
}

.contact__info-container {
    width: 50%;
    padding: 30px;
    color: #fff;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: auto;
    text-align: center;
    max-width: 500px;
    height: auto;
}


.contact__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact__list li {
    margin: 5px 0;
    font-size: 18px;
}

.contact__list a {
    color: rgb(255, 123, 0);
    text-decoration: none;
    transition: color 0.3s;
}

.contact__list a:hover {
    color: rgb(255, 123, 0);
    text-decoration: underline;
}


#scrollToTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--color-principal);
    color: var(--color-negro);
    font-size: 22px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: opacity 0.4s ease, transform 0.3s ease;

    opacity: 0;
    /* oculto al inicio */
    pointer-events: none;
    /* desactiva clic cuando está oculto */
}

#scrollToTopBtn.show {
    opacity: 1;
    /* aparece suavemente */
    pointer-events: auto;
    /* vuelve a ser clickeable */
}

#scrollToTopBtn:hover {
    background-color: var(--color-principal);
    transform: scale(1.1);
}

/* =========================
   AJUSTES SOLO PARA CELULARES
========================= */
@media (max-width: 768px) {
    .swiper-slide {
        width: 85%;       /* casi todo el ancho */
        min-width: auto;  /* elimina el min-width fijo */
        flex-shrink: 0;   /* evita que se encoja demasiado */
    }

    .swiper-button-prev,
    .swiper-button-next {
        width: 35px;
        height: 35px;
    }

    .swiper-button-prev::after,
    .swiper-button-next::after {
        font-size: 16px;
    }
}


/* Estilos responsivos para pantallas pequeñas */
@media (max-width: 991.98px) {
    .navbar-custom {
        padding: 1rem 1rem;
        /* menos padding en móvil */
    }

    /* Quitar separadores */
    .navbar-custom .nav-item:not(:last-child)::after {
        display: none;
    }

    /* Navbar-nav: columna, centrado y con línea superior */
    .navbar-custom .navbar-nav {
        flex-direction: column;
        align-items: center;
        /* centra los links horizontalmente */
        gap: 1rem;
        width: 100%;
        /* ocupa todo el ancho */
        border-top: 3px solid rgba(245, 101, 5);
        margin-top: 1rem;
        /* separa la línea del contenido superior */
        padding-top: 1rem;
        /* opcional: agrega espacio extra dentro */
    }

    /* Links: ocupar todo el ancho y centrados */
    .navbar-custom .nav-link {
        text-align: center;
        /* centra el texto */
        display: block;
        padding: 1rem 2rem;
        font-size: 1.2rem;
        width: 100%;
    }

    .navbar-custom .nav-link:hover {
        border-bottom: 2px solid rgba(245, 101, 5);
        width: 100%;
        text-align: center;
        display: block;
    }

    .carousel-inner .carousel-item img {
        height: 70vh;
        /* menos altura en tablets y móviles */
    }

    .black-bar {
        padding: 8px 40px;
        bottom: 150px;
    }

    .black-bar h2 {
        font-size: 14px;
    }

    .black-bar h3 {
        font-size: 17px;
    }

    .black-bar p {
        display: none;
    }

    .about {
        padding: 2rem 1rem;
    }

    .about__title {
        font-size: 2.2rem;
        margin-bottom: 1.5rem;
    }

    .about__subtitle {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .about__text {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 2rem;
    }

    .about__content {
        padding: 2rem;
        border-radius: 0.8rem;
    }

    .about__image {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(2, 1fr);
    }

    .layout {
        padding: 3rem;
    }

    .main__container {
        width: 90%;
    }

    .main__title {
        font-size: 2.5rem;
        margin-bottom: 2rem;
    }

    .main__socials {
        flex-direction: column;
        padding: 2rem 1rem;
    }

    .socials__item {
        width: 100%;
        margin-bottom: 1.5rem;
    }

    .socials__item i {
        font-size: 3rem;
    }

    .socials__number {
        font-size: 1.5rem;
    }

    .socials__title {
        font-size: 1.4rem;
    }

    .contact__nav-container {
        flex-direction: column;
        height: auto;
    }

    .contact__nav,
    .contact__info-container {
        width: 100%;
        padding: 20px;
    }

    .contact__menu {
        flex-direction: column;
        gap: 15px;
    }

    .contact__menu-link {
        font-size: 18px;
    }

    .contact__info-container {
        margin-top: 20px;
    }

    .contact__logo-img {
        max-width: 200px;
        height: auto;
    }
}

/* ========================================
   MONITORES GRANDES (21" o más, >= 1600px)
======================================== */
@media screen and (min-width: 1600px) {

    body {
        font-size: 18px;
        line-height: 1.8;
    }

    main,
    .layout,
    .main__container,
    .about__content,
    .services__container {
        max-width: 1600px;
        /* mantiene centrado */
        margin: 0 auto;
    }

    /* Fuerza que el carrusel ocupe todo el ancho */
    .hero,
    #carouselExampleIndicators,
    .carousel-inner,
    .carousel-item,
    .carousel-img-container {
        width: 100vw;
        max-width: 100%;
    }

    /* Imagen: ocupa todo el ancho sin deformarse */
    .carousel-item img {
        width: 100%;
        height: auto;
        /* altura automática según proporción */
        object-fit: cover;
        object-position: center;
    }

    .navbar-custom .nav-link {
        font-size: 1.5rem;
        padding: 0 5rem;
    }

    .about__title {
        font-size: 4rem;
    }

    .about__subtitle {
        font-size: 2.5rem;
    }

    .about__text {
        font-size: 1.5rem;
        max-width: 1200px;
        /* evita que la línea sea infinita */
        margin: 0 auto;
    }

    .services__container,
    .contact__nav-container {
        background-color: rgba(0, 0, 0, 0.6); /* negro semi-transparente */
        padding: 3rem 5%;
        border-radius: 1rem;
        margin: 0 auto 4rem auto;
        backdrop-filter: blur(5px);
    }

    .services__container p {
        font-size: 1.4rem;
        max-width: 1100px;
        margin-left: auto;
        margin-right: auto;
    }

    .contact__layout {
        padding: 120px 100px 80px 100px;
        font-size: 1.2rem;
    }
}