/* General Styles */
body {
    font-family: 'Arial', sans-serif;
    margin: 0; /* eliminar margen por defecto del navegador */
    padding: 0; /* asegurar ancho completo en mobile */
}

/* Button Styles */
.btn-primary-custom {
    background: linear-gradient(135deg, #0056b3, #007bff);
    border: none;
    padding: 12px 40px;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Hero Section */
.hero-section {
    height: 500px;
    color: white;
}

.carousel-item {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../images/hero-bg.svg');
    background-size: cover;
    background-position: center;
    height: 500px;
}

.carousel-item h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.carousel-item h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #f8f9fa;
}

.carousel-item ul li {
    font-size: 1.2rem;
    color: #ffffff;
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
}

.carousel-indicators {
    bottom: 30px;
}

/* Ocultar indicadores del carrusel en móvil */
@media (max-width: 768px) {
    .carousel-indicators { display: none; }
}

/* Services Cards */
.services-section .card {
    transition: transform 0.3s ease;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.services-section .card:hover {
    transform: translateY(-5px);
}

.services-section .card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.services-section .card-title {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.services-section .list-unstyled {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.services-section .list-unstyled li {
    margin-bottom: 0.75rem;
    color: #666;
}

.services-section .btn-primary {
    background-color: #007bff;
    border: none;
    padding: 0.5rem 2rem;
    margin-top: auto;
    align-self: start;
    border-radius: 50px;
}

/* Map Section */
.map-section {
    margin-bottom: 0;
    line-height: 0;
}

.map-section iframe {
    margin-bottom: 0;
}

/* Improvement Section */
.improvement-section {
    background-color: #f8f9fa;
}

.improvement-section h2 {
    color: #333;
}

.improvement-section .lead {
    color: #666;
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    color: #FFF;
    transform: scale(1.1);
}

/* Footer */
.footer {
    background-color: #343a40;
}

.footer a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #007bff !important;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

/* Responsive Adjustments */
/* Banner text box (mobile) */
.banner .banner-text {
    margin-top: 0; /* eliminar espacio entre imagen y caja */
    padding: 1rem 1.25rem;
    border-radius: 12px;
}

/* CTA button inside banners: white background, blue text */
.banner .btn-primary-custom {
    background: #ffffff;
    color: #1c71a1 !important;
    border: none;
    font-weight: 700;
}

/* Desktop adjustments: limitar ancho y evitar salto de línea en subtítulos */
@media (min-width: 769px) {
    .banner .banner-text {
        max-width: 700px;           /* no ocupar todo el ancho */
        width: 60vw;                /* proporcional a viewport */
        margin: 0 auto;             /* centrar bajo la imagen */
    }
    .banner .banner-text h2 {
        white-space: normal;        /* permitir salto de línea */
        overflow: visible;          /* sin recorte */
        text-overflow: clip;        /* sin elipsis */
        line-height: 1.3;           /* lectura cómoda en múltiples líneas */
        margin-bottom: 0.75rem;     /* menos separación bajo el subtítulo */
    }
}
.banner .btn-primary-custom:hover {
    background: #f5f5f5;
    color: #15577d !important;
}

/* Navbar buttons: evitar desplazamiento al hacer hover/active/focus */
.navbar .btn-primary-custom:hover,
.navbar .btn-primary-custom:focus,
.navbar .btn-primary-custom.active {
    transform: none;
    box-shadow: none;
}

/* Navbar Desktop: restaurar tamaño compacto de botones dentro del nav */
.navbar .btn-primary-custom {
  padding: 0.25rem 0.5rem !important; /* aún más compacto en nav */
  font-size: 0.95rem;
  line-height: 1.4;
  border-radius: 0.375rem; /* evitar pill gigante en nav */
}

/* Navbar: reducir espacio vertical para recuperar altura previa */
.navbar {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Navbar: tamaño del logo y paddings compactos */
.navbar-brand img {
  height: 28px;
  width: auto;
  display: inline-block; /* evita bloque alto innecesario */
}
@media (min-width: 992px) {
  .navbar-brand img { height: 32px; }
}
.navbar-nav .nav-link {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
.navbar-toggler {
  padding: 0.25rem 0.5rem;
  font-size: 1rem;
}

/* Evitar espacio por elementos inline */
.banner picture,
.banner .banner-image {
    display: block;
}

@media (max-width: 768px) {
    /* Layout móvil sin forzar tamaños: imagen a ancho natural, alto automático */
    .hero-section,
    .carousel-item {
        height: auto;
        min-height: 0;
    }
    .banner {
        display: block;
        height: auto;
    }
    .banner picture {
        display: block;
        height: auto;
    }
    .banner .banner-image {
        display: block;
        width: auto;           /* no forzar 100% */
        max-width: 100%;       /* no escalar por encima del contenedor */
        height: auto;          /* alto automático según proporción */
        object-fit: contain;   /* evitar recortes y mantener proporción */
        margin: 0 auto;        /* centrar si es más angosta que el contenedor */
    }

    .carousel-item h1 {
        font-size: 2rem;
    }

    .carousel-item h2 {
        font-size: 1.5rem;
    }

    .carousel-item ul li {
        font-size: 1rem;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 25px;
        bottom: 20px;
        right: 20px;
    }

    /* En mobile, la caja debajo del banner debe ser un degradado */
    .banner .banner-text {
        height: 35vh; /* caja fija */
        background: linear-gradient(180deg, #1e80b9, #1c71a1);
        color: #ffffff;
        border-radius: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Offcanvas móvil a pantalla completa */
#mobileMenu {
    --bs-offcanvas-width: 100%; /* ocupar ancho del viewport sin provocar scroll horizontal */
}

/* Evitar impacto del offcanvas en el layout cuando está cerrado */
.offcanvas:not(.show) {
  visibility: hidden;
}

/* Evitar scroll horizontal global en mobile y desktop */
html, body {
  max-width: 100%;
  overflow-x: clip; /* evita scroll horizontal sin recortar vertical */
  width: 100%;
}

/* Asegurar cálculo de ancho predecible */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Evitar desbordes de imágenes y multimedia */
img, picture, video, canvas, svg, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Footer: limitar tamaño de logos e iconos para evitar que se agranden */
footer img {
  max-height: 40px;
  height: auto !important;
  width: auto !important;
  display: inline-block; /* no ocupar todo el ancho del contenedor */
}
@media (min-width: 992px) {
  footer img { max-height: 48px; }
}

/* Clamp de ancho en contenedores comunes en móvil */
@media (max-width: 768px) {
  section, .hero-section, .hero-banner, .hero-overlay, .container, .row {
    max-width: 100%;
    overflow-x: hidden;
  }
  /* Neutralizar márgenes negativos de Bootstrap que generan desbordes */
  .row {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }
  /* Asegurar paddings simétricos del contenedor */
  .container, .container-fluid {
    padding-right: 12px;
    padding-left: 12px;
  }
  /* Evitar gap derecho cuando no hay offcanvas/modal abierto */
  body:not(.modal-open):not(.offcanvas-open) {
    padding-right: 0 !important;
  }
  /* Evitar que carruseles generen overflow horizontal */
  .carousel, .carousel-inner {
    overflow: hidden;
  }
}

/* Postulaciones hero: usar el mismo comportamiento que la home */
/* (se remueve overlay absoluto para mantener consistencia con la home) */
/* Ajuste: en Postulaciones el título debe ir dentro del banner (overlay) */
.jobs-hero .banner { position: relative; }
@media (min-width: 769px) {
  .jobs-hero .banner .banner-text {
    position: absolute;
    top: 50%;
    left: 5%;
    transform: translateY(-50%);
    text-align: left;
    color: #ffffff;
    max-width: 700px;
    width: 60vw;
  }
}

/* Postulaciones: estilo de tarjetas y botones */
.job-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.job-card .card-body {
  padding: 1.25rem 1.5rem;
}

.btn-outline-primary-custom {
  background: #ffffff;
  color: #1c71a1;
  border: 2px solid #1c71a1;
  padding: 10px 18px;
  font-weight: 500;
}
.btn-outline-primary-custom:hover {
  background: #eaf4fb;
  color: #15577d;
}

.btn-primary-custom.w-100 {
  padding: 12px 24px; /* asegurar buen alto cuando es full width */
}
/* Clientes - tamaños y espaciado */
.clients-section .client-logo {
  max-height: 60px;
}
@media (min-width: 992px) { /* lg y superior */
  .clients-section .client-logo {
    max-height: 70px;
  }
}
@media (max-width: 576px) { /* xs */
  .clients-section .client-logo {
    max-height: 50px;
  }
}
.clients-section .client-item {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
/* Página de Contacto - estilos mejorados */
.contact-section {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
}
.contact-image {
  border-radius: 1rem;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  width: 100%;
  height: auto;
}
@media (min-width: 768px) { /* md+ */
  .contact-image {
    height: auto;         /* controlado por JS para igualar al formulario */
    object-fit: cover;    /* recorte suave si supera el alto */
  }
}
.contact-form-card {
  border: 1px solid #eee;
  border-radius: 1rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}
.contact-form-card .card-body {
  padding: 0.75rem 0.9rem; /* compactar aún más padding vertical */
}
.contact-form .form-control,
.contact-form .form-select {
  padding: 0.55rem 0.8rem; /* inputs más compactos */
  border-radius: 0.5rem;
}
.contact-form .mb-3 {
  margin-bottom: 0.5rem !important; /* reducir más la separación entre campos */
}
.contact-form .form-label {
  margin-bottom: 0.35rem; /* etiqueta más cercana al campo */
}
.contact-form textarea.form-control {
  min-height: 90px; /* altura más contenida del textarea */
}