/********** Template CSS Optimizado - Versión Responsive **********/

/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

/*** Back to Top ***/
.back-to-top {
    position: fixed;
    display: none;
    right: 45px;
    bottom: 45px;
    z-index: 99;
}

@media (max-width: 768px) {
    .back-to-top {
        right: 20px;
        bottom: 20px;
    }
}

/*** Botones ***/
.btn {
    transition: .5s;
}

.btn-square {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}

.btn-link {
    transition: .5s;
}

/*** Navbar ***/
.sticky-top {
    top: -150px;
    transition: .5s;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar {
    padding: 15px 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 18px;
}

.navbar .navbar-nav .nav-link {
    margin-left: 30px;
    padding: 0;
    outline: none;
    color: var(--bs-dark);
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--bs-primary)
}

/* Gradiente para navbar */
.navbar-gradient-bg {
    background: linear-gradient(135deg,
            white 0%,
            white 30%,
            #223983 40%,
            #223983 100%);
}

.navbar-gradient-bg .navbar-nav .nav-link {
    color: white !important;
}

.navbar-gradient-bg .navbar-nav .nav-link.active {
    color: white !important;
    font-weight: bold;
}

.navbar-gradient-bg .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-gradient-bg .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Responsive Navbar */
@media (max-width: 991.98px) {
    .navbar .navbar-nav .nav-link {
        margin-left: 0;
        padding: 12px 0;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-gradient-bg .navbar-collapse {
        background: #223983;
        margin-top: 15px;
        border-radius: 10px;
        padding: 15px;
    }
    
    .navbar-gradient-bg .navbar-nav .nav-link {
        color: white !important;
    }
    
    .navbar-gradient-bg .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
}

@media (max-width: 576px) {
    .navbar {
        padding: 10px 0;
    }
    
    .navbar-gradient-bg {
        background: linear-gradient(135deg,
            white 0%,
            white 40%,
            #223983 50%,
            #223983 100%);
    }
    .navbar-brand img {
        width: 100px !important;
    }
}

/*** Hero Header ***/
.hero-header {
    margin-top: -100px;
    padding-top: 150px;
    background: url(../img/hero-bg.jpg) top center no-repeat;
    background-size: cover;
}

.header-carousel {
    position: relative;
    padding: 25px 90px 25px 0;
}
.header-carousel img {
    max-height: 600px; /* Controla la altura máxima */
    width: 100%;
    object-fit: cover; /* La imagen se recorta suavemente para llenar el espacio */
    object-position: center; /* Centra el recorte */
}

.header-carousel::before {
    position: absolute;
    content: "";
    top: 0;
    right: 0;
    width: calc(25% + 45px);
    height: 100%;
    background: #223983;
    z-index: -1;
}

.header-carousel .owl-dots {
    position: absolute;
    top: 50%;
    right: 38px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-carousel .owl-dot {
    position: relative;
    display: inline-block;
    margin: 5px 0;
    width: 15px;
    height: 15px;
    border: 2px solid var(--bs-white);
    transition: .5s;
}

.header-carousel .owl-dot.active {
    height: 30px;
    background: var(--bs-white);
}

/* Responsive Hero */

@media (min-width: 1400px) {
    .header-carousel img {
        max-height: 700px; /* Más grande en pantallas muy grandes */
    }
}

@media (max-width: 1200px) {
    .header-carousel img {
        max-height: 500px;
    }
}

@media (max-width: 992px) {
    .header-carousel {
        padding: 20px 70px 20px 0;
    }
    .header-carousel img {
        max-height: 450px;
    }
    
    .header-carousel::before {
        width: calc(20% + 40px);
    }
}

@media (max-width: 768px) {
    .hero-header {
        margin-top: -80px;
        padding-top: 120px;
    }
    
    .header-carousel {
        padding: 15px 60px 15px 0;
    }
    
    .header-carousel::before {
        width: calc(18% + 35px);
    }
    
    .header-carousel .owl-dots {
        right: 25px;
    }
    
    .header-carousel .owl-dot {
        width: 12px;
        height: 12px;
        margin: 4px 0;
    }
    
    .header-carousel .owl-dot.active {
        height: 25px;
    }
}

@media (max-width: 576px) {
    .hero-header {
        margin-top: -70px;
        padding-top: 110px;
    }
    
    .header-carousel {
        padding: 10px 50px 10px 0;
    }
    
    .header-carousel::before {
        width: calc(15% + 30px);
    }
    
    .header-carousel .owl-dots {
        right: 15px;
    }
}

/*** Hero con texto superpuesto ***/
.hero-carousel-container {
    position: relative;
    width: 100%;
}

.hero-text-overlay {
    position: absolute;
    bottom: -100px; /* Margen inferior desde el borde de la imagen */
    left: 50%;
    transform: translateX(-50%); /* Centrado horizontal */
    width: auto;
    max-width: 800px;
    padding: 30px 40px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    z-index: 10;
    text-align: center; /* Centrar el texto */
}

.hero-text-overlay h1 {
    font-size: 3.5rem;
    margin-bottom: 0 !important; 
    line-height: 1.3;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}
/* Responsive Hero Overlay */
@media (max-width: 1200px) {
    .hero-text-overlay {        
        max-width: 700px;
        padding: 25px 35px;
    }
    
    .hero-text-overlay h1 {
        font-size: 3rem;
    }
}

@media (max-width: 992px) {
    .hero-text-overlay {
        bottom: -50px;
        max-width: 600px;
        padding: 20px 30px;
    }
    
    .hero-text-overlay h1 {
        font-size: 2.5rem;
    }
    
    .hero-text-overlay h5 {
        font-size: 1.1rem;
        padding: 12px 25px !important;
    }
}

@media (max-width: 768px) {
    .hero-text-overlay {
        position: relative;
        left: 0;
        top: 0;
        transform: none;
        max-width: 100%;
        margin: 20px 15px 0;
        padding: 25px;
        background: rgba(255, 255, 255, 0.8);
        text-align: center;
    }
    
    .hero-text-overlay h1 {
        font-size: 2rem;
    }
    
    .hero-text-overlay h5 {
        font-size: 1rem;
        display: inline-block !important;
    }
}

@media (max-width: 576px) {
    .hero-text-overlay {
        padding: 15px 20px;
    }
    
    .hero-text-overlay h1 {
        font-size: 1.8rem;
    }
    
    .hero-text-overlay h5 {
        font-size: 0.9rem;
        padding: 10px 20px !important;
    }
}

/*** Certificaciones ***/
.certification-icon {
    width: 40px;
    height: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: block;
}

.certification-link {
    display: inline-block;
    text-decoration: none;
    color: inherit;
}

.certification-link:hover .certification-icon {
    transform: scale(1.1);
    opacity: 0.9;
}

.certification-link:hover {
    color: #223983;
}

/* Responsive Certificaciones */
@media (max-width: 992px) {
    .row.g-5.align-items-center.animated.fadeIn {
        justify-content: center;
    }
    
    .col-lg-4 {
        margin-bottom: 20px;
    }
    
    .d-flex.align-items-center {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .certification-icon {
        width: 35px;
    }
    
    .col-lg-4 h5 {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .certification-icon {
        width: 30px;
    }
    
    .col-lg-4 h5 {
        font-size: 0.9rem;
    }
}

/*** Testimonial ***/
.testimonial-img {
    position: relative;
    padding: 45px 0 45px 90px;
}

.testimonial-img::before {
    position: absolute;
    content: "";
    top: 0;
    left: 0;
    width: calc(50% + 45px);
    height: 100%;
    background: #223983;
    z-index: -1;
}

.testimonial-text h5 {
    position: relative;
    padding-left: 45px;
}

.testimonial-text h5::before {
    position: absolute;
    content: "";
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 40px;
    height: 2px;
    background: #223983;
}

.testimonial-carousel .owl-dots {
    position: absolute;
    height: 17px;
    bottom: 0;
    right: 0;
    left: auto;
}

.testimonial-carousel .owl-dot {
    position: relative;
    display: inline-block;
    margin-left: 10px;
    width: 15px;
    height: 15px;
    background: var(--bs-white);
    border: 2px solid #223983;
    transition: .5s;
}

.testimonial-carousel .owl-dot.active {
    width: 30px;
    background: #223983;
}

/* Responsive Testimonial */
@media (max-width: 992px) {
    .testimonial-img {
        padding: 30px 0 30px 60px;
    }
    
    .testimonial-item .row {
        flex-direction: column;
    }
    
    .testimonial-item .col-md-8,
    .testimonial-item .col-md-4 {
        width: 100%;
    }
    
    .testimonial-text {
        padding: 30px;
        text-align: center;
    }
    
    .testimonial-text h3 {
        margin-bottom: 15px;
    }
}

@media (max-width: 768px) {
    .testimonial-img {
        padding: 20px 0 20px 40px;
    }
    
    .testimonial-img::before {
        width: calc(45% + 30px);
    }
    
    .testimonial-carousel .owl-dots {
        left: 0;
        right: auto;
        bottom: -30px;
    }

    .testimonial-carousel .owl-dot {
        margin-right: 10px;
        margin-left: 0;
    }
    
    .testimonial-text h5 {
        padding-left: 0;
    }
    
    .testimonial-text h5::before {
        display: none;
    }
}

@media (max-width: 576px) {
    .testimonial-img {
        padding: 15px 0 15px 30px;
    }
    
    .testimonial-img::before {
        width: calc(40% + 20px);
    }
    
    .testimonial-text {
        padding: 20px;
    }
    
    .testimonial-text h3 {
        font-size: 1.5rem;
    }
    
    .testimonial-text p {
        font-size: 0.9rem;
    }
}

/*** Footer ***/
.footer .btn.btn-link {
    display: block;
    margin-bottom: 10px;
    padding: 0;
    text-align: left;
    color: rgba(255, 255, 255, .5);
    font-weight: normal;
    transition: .3s;
    text-decoration: none;
}

.footer .btn.btn-link:hover {
    color: var(--bs-white);
    letter-spacing: 1px;
    box-shadow: none;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
}

/* Responsive Footer */
@media (max-width: 992px) {
    .footer .row {
        justify-content: center;
    }
    
    .footer .col-lg-4 {
        margin-bottom: 30px;
        text-align: center;
    }
    
    .footer .btn.btn-link {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .footer .container {
        padding: 20px !important;
    }
    
    .footer h5 {
        font-size: 1.2rem;
        margin-bottom: 15px !important;
    }
    
    .footer p {
        font-size: 0.9rem;
    }
    
    .footer .btn.btn-link {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
}

@media (max-width: 576px) {
    .footer .container {
        padding: 15px !important;
    }
    
    .footer h5 {
        font-size: 1.1rem;
    }
    
    .footer p {
        font-size: 0.85rem;
    }
    
    .footer .btn.btn-link {
        font-size: 0.85rem;
    }
}
/*** Service Cards - Matriz 2x3 con imágenes ***/
.service-card {
    background: transparent;
    height: 450px;
    perspective: 1000px;
    cursor: pointer;
    margin-bottom: 20px;
}

.service-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.service-card:hover .service-card-inner {
    transform: rotateY(180deg);
}

.service-card-front, .service-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.service-card-front {
    background: white;
    color: #333;
    border: 1px solid rgba(34, 57, 131, 0.1);
}

.service-card-back {
    background: #223983;
    color: white;
    transform: rotateY(180deg);
}

.service-image {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #223983;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.service-card:hover .service-image img {
    transform: scale(1.1);
}

.service-card-front h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #223983;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.4;
}

.service-card-front p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
    font-family: Arial, Helvetica, sans-serif;
    margin-bottom: 10px;
}

.service-card-back h4 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-family: Arial, Helvetica, sans-serif;
}

.service-card-back p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
    font-family: Arial, Helvetica, sans-serif;
}

.btn-service {
    display: inline-block;
    padding: 10px 25px;
    background: white;
    color: #223983;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: Arial, Helvetica, sans-serif;
    border: 2px solid white;
    margin-top: 10px;
}

.btn-service:hover {
    background: transparent;
    color: white;
    transform: translateX(5px);
}

/* Responsive para las cards */
@media (max-width: 1200px) {
    .service-card {
        height: 420px;
    }
    
    .service-image {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 992px) {
    .service-card {
        height: 400px;
    }
    
    .service-card-front h3 {
        font-size: 1.2rem;
    }
    
    .service-card-back h4 {
        font-size: 1.2rem;
    }
    
    .service-image {
        width: 90px;
        height: 90px;
    }
}

@media (max-width: 768px) {
    .service-card {
        height: 380px;
    }
    
    .service-image {
        width: 80px;
        height: 80px;
        margin-bottom: 15px;
    }
    
    .service-card-front h3 {
        font-size: 1.1rem;
    }
    
    .service-card-front p,
    .service-card-back p {
        font-size: 0.85rem;
    }
    
    .btn-service {
        padding: 8px 20px;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .service-card {
        height: 350px;
    }
    
    .service-card-front,
    .service-card-back {
        padding: 20px 15px;
    }
    
    .service-image {
        width: 130px;
        height: 130px;
        margin-bottom: 12px;
    }
    
    .service-card-front h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .service-card-front p {
        font-size: 0.8rem;
        line-height: 1.4;
    }
}
/*** About Page - Versión mejorada para imagen vertical ***/
.about-image-wrapper {
    position: relative;
    padding-right: 30px;
    padding-bottom: 30px; /* Añadido para mejor proporción */
}

.about-image-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0; /* Cambiado de top a bottom */
    right: 0; /* Cambiado de right 10px a right 0 */
    width: 85%; /* Un poco más ancho */
    height: 85%; /* Un poco más alto */
    border: 3px solid #223983;
    border-radius: 20px;
    z-index: -1;
    opacity: 0.3;
}

.about-image-wrapper img {
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(34, 57, 131, 0.15);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
    width: 100%; /* Asegura que ocupe el ancho del contenedor */
    height: auto;
    max-height: 500px; /* Limita la altura máxima */
    object-fit: cover; /* Recorta suavemente si es necesario */
}

/* Para pantallas grandes */
@media (min-width: 1400px) {
    .about-image-wrapper img {
        max-height: 550px;
    }
}

/* Para laptops */
@media (max-width: 1200px) {
    .about-image-wrapper img {
        max-height: 450px;
    }
}

.about-image-wrapper:hover img {
    transform: scale(1.02);
}

/*** Certificaciones Cards ***/
.certification-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(34, 57, 131, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.certification-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(34, 57, 131, 0.2);
}

.certification-image-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 40px 20px;
    text-align: center;
    border-bottom: 3px solid #223983;
}

.certification-logo {
    width: 120px;
    height: auto;
    transition: transform 0.3s ease;
}

.certification-card:hover .certification-logo {
    transform: scale(1.1);
}

.certification-content {
    padding: 25px 20px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.certification-content h4 {
    color: #223983;
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
}

.certification-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    font-family: Arial, Helvetica, sans-serif;
    flex-grow: 1;
}

.btn-certification {
    display: inline-block;
    padding: 12px 25px;
    background: #223983;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: Arial, Helvetica, sans-serif;
    border: 2px solid #223983;
    margin-top: auto;
}

.btn-certification:hover {
    background: white;
    color: #223983;
    letter-spacing: 0.5px;
}

.btn-certification i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.btn-certification:hover i {
    transform: translateX(5px);
}

/* Responsive */
@media (max-width: 992px) {
    .certification-image-wrapper {
        padding: 30px 15px;
    }
    
    .certification-logo {
        width: 100px;
    }
    
    .certification-content h4 {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .certification-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .certification-image-wrapper {
        padding: 25px 15px;
    }
    
    .certification-logo {
        width: 90px;
    }
    
    .certification-content {
        padding: 20px 15px;
    }
    
    .certification-content h4 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .certification-description {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .btn-certification {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .certification-image-wrapper {
        padding: 20px 10px;
    }
    
    .certification-logo {
        width: 80px;
    }
}
/*** Contact Page ***/
.map-container {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid #f8f9fa;
}

.map-container iframe {
    border-radius: 8px;
}

/* Responsive Contact */
@media (max-width: 991.98px) {
    .map-container {
        height: 400px !important;
        margin-bottom: 30px;
    }
}

@media (max-width: 767.98px) {
    .map-container {
        height: 350px !important;
    }
    
    .contact-info-item {
        text-align: center;
    }
}

@media (max-width: 576px) {
    .map-container {
        height: 300px !important;
    }
}

/*** Service Page ***/
.service-item {
    position: relative;
    padding: 30px 25px;
    transition: .5s;
}

/* Responsive Service */
@media (max-width: 992px) {
    .service-item {
        padding: 25px 20px;
        margin-bottom: 20px;
    }
    
    .service-item .service-img h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .service-item {
        padding: 20px 15px;
    }
    
    .service-item .service-img h3 {
        font-size: 1.2rem;
    }
    
    .service-item p {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .service-item {
        padding: 15px 12px;
    }
    
    .service-item .service-img h3 {
        font-size: 1.1rem;
        padding: 0 8px 5px 0;
    }
    
    .service-item p {
        font-size: 0.9rem;
    }
}

/*** About Page ***/
.about-img {
    position: relative;
    overflow: hidden;
}

/* Responsive About */
@media (max-width: 768px) {
    .about-img {
        margin-bottom: 30px;
    }
    
    .about-img .row {
        justify-content: center;
    }
    
    .about-img .col-6 {
        padding: 0 5px;
    }
}

/*** Utilidades ***/
.bg-primary {
    background-color: #223983 !important;
}

.text-primary {
    color: #223983 !important;
}

.wow {
    visibility: hidden;
}

/* Ajustes generales responsivos */
@media (max-width: 768px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    h1.display-1 {
        font-size: 2.5rem;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    h1.display-1 {
        font-size: 2rem;
    }
    
    .py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    .mb-5 {
        margin-bottom: 1.5rem !important;
    }
}