/* ========================================
   IMPORTS Y VARIABLES
======================================== */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&family=Open+Sans:ital,wght@0,700;1,700&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --primary: #1a6bb3;
    --sectionPadding: 80px 0;
    --headerColor: #1a1a1a;
}

/* ========================================
   RESET Y ESTILOS BASE
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding-top: 2rem;
    font-family: "Open Sans", sans-serif;
    background-color: #e5e5e7;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: visible;
}

header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    position: fixed;
}

/* ========================================
   NAVEGACIÓN
======================================== */
.main-nav {
    background-color: #fbfbfb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.logo {
    z-index: 1001;
}

.logo img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ========== Botón Hamburguesa ========== */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
    background: none;
    border: none;
    padding: 5px;
}

.hamburger span,
.hamburger .bar {
    width: 28px;
    height: 3px;
    background-color: #1a1a1a;
    margin: 4px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
    display: block;
}

/* Animación del botón hamburguesa cuando está activo */
.hamburger.active span:nth-child(1),
.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2),
.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3),
.hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ========== Menú de Navegación ========== */
.nav-menu {
    list-style: none;
    display: flex;
    gap: 40px;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-decoration: none;
    color: #1a1a1a;
    font-family: "Lexend", sans-serif;
    font-weight: 500;
    font-size: 16px;
    padding: 8px 0;
    position: relative;
    transition: all 0.3s ease;
    display: block;
}

.nav-menu a:hover {
    color: #4574ba;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: #4574ba;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* ========================================
   SECCIÓN STATS (ABOUT US)
======================================== */
#stats-1687 {
    background-color: #ffffff;
    padding: clamp(3rem, 6vw, 5rem) 20px;
}

#stats-1687 .cs-container {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(3rem, 7vw, 6.25rem);
}

#stats-1687 .cs-wrapper {
    width: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: clamp(3rem, 6vw, 4rem);
}

#stats-1687 .cs-content {
    text-align: left;
    width: 100%;
    max-width: 33.875rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#stats-1687 .cs-topper {
    display: inline-block;
    font-size: clamp(0.875rem, 2vw, 1rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 1rem;
}

#stats-1687 .cs-title {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2em;
    margin: 0 0 1.5rem 0;
    color: var(--headerColor);
}

#stats-1687 .cs-text {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    line-height: 1.6em;
    margin: 0 0 1.5rem 0;
    color: #666;
}

#stats-1687 .cs-button-solid {
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 700;
    line-height: clamp(2.5rem, 5.5vw, 3.5rem);
    text-align: center;
    text-decoration: none;
    min-width: 9.375rem;
    margin: 0;
    padding: 0 1.5rem;
    background-color: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    display: inline-block;
    position: relative;
    z-index: 1;
    transition: background-color 0.3s ease;
}

#stats-1687 .cs-button-solid:hover {
    background-color: #0d4d8c;
}

#stats-1687 .cs-picture {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: clamp(20rem, 50vw, 37.5rem);
    margin: 0;
    display: block;
    position: relative;
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#stats-1687 .cs-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* ========================================
   SECCIÓN SERVICIOS
======================================== */
.seccion-servicios {
    background-color: #ffffff;
    padding: clamp(3rem, 6vw, 5rem) 20px;
}

.contenedor-cards {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.titulo-principal {
    font-weight: 600;
    color: #1a1a1a;
    font-family: "Open Sans", sans-serif;
    text-align: center;
    padding: 35px 20px;
    margin-bottom: 20px;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    line-height: 1.4;
}

.tarjetas-contenedor {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
    justify-items: center;
}

.card {
    width: 100%;
    max-width: 350px;
    background-color: #162a60;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    background-color: #162a60;
    padding: 20px;
}

.card-title {
    color: #ffffff;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 600;
    margin-bottom: 15px;
}

.card-text {
    color: #ffffff;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    margin-bottom: 20px;
    opacity: 0.9;
}

.card .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    padding: 8px 20px;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.card .btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.seccion-servicios h5 {
    color: #ffffff;
}

.boton-centro {
    display: flex;
    justify-content: center;
    padding: 20px 0 40px;
}

.btn-mas-servicios {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-mas-servicios:hover {
    background-color: #0056b3;
}

/* ========================================
   SECCIÓN RED/MAPA
======================================== */
.seccion-red {
    background-color: #ffffff;
    padding: clamp(3rem, 6vw, 5rem) 20px;
}

.contenedor-mapa {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.contenido {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px 0;
}

.mapa {
    width: 100%;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.mapa img {
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
    display: block;
}

.provincias {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.provincia {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    border-left: 5px solid #ddff00;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.provincia:hover {
    transform: translateX(5px);
}

.provincia h3 {
    color: #061747;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
}

.provincia p {
    color: #666;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
}

/* ========================================
   SERVICES 1354
======================================== */
#services-1354 {
    padding: clamp(3rem, 6vw, 5rem) 20px;
    position: relative;
    z-index: 10;
}

#services-1354 .cs-container {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: clamp(3rem, 6vw, 4rem);
}

#services-1354 .cs-content {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#services-1354 .cs-topper {
    color: #767676;
    font-size: clamp(0.875rem, 2vw, 1rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

#services-1354 .cs-title {
    max-width: 25ch;
    margin: 0;
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2em;
    color: var(--headerColor);
}

#services-1354 .cs-card-group {
    margin: 0;
    padding: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(1rem, 2vw, 1.25rem);
}

#services-1354 .cs-item {
    text-align: center;
    list-style: none;
    width: 100%;
    height: 19.0625rem;
    margin: 0;
    padding: 0;
    background-color: #000;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0px 12px 80px 0px rgba(26, 26, 26, 0.08);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}

#services-1354 .cs-item:hover .cs-background:before {
    background-color: var(--primary);
    opacity: 0.84;
}

#services-1354 .cs-item:hover .cs-background img {
    transform: scale(1.2);
}

#services-1354 .cs-link {
    text-decoration: none;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

#services-1354 .cs-h3 {
    font-size: clamp(1.25rem, 3vw, 1.5625rem);
    line-height: 1.2em;
    font-weight: bold;
    text-align: inherit;
    margin: 0;
    color: white;
    transition: color 0.3s;
}

#services-1354 .cs-span {
    display: block;
}

#services-1354 .cs-background {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

#services-1354 .cs-background:before {
    content: "";
    position: absolute;
    display: block;
    height: 100%;
    width: 100%;
    background-color: #000;
    opacity: 0.4;
    top: 0;
    left: 0;
    z-index: 1;
    transition: background-color 0.3s, opacity 0.3s;
}

#services-1354 .cs-background img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}

/* ========================================
   BOTÓN 6
======================================== */
.button-center {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.cs-button-6 {
    text-align: center;
    font-size: clamp(0.9rem, 2vw, 1rem);
    line-height: clamp(2.5rem, 8vw, 3.5rem);
    text-decoration: none;
    font-weight: 700;
    min-width: 10.875rem;
    color: #0056b3;
    padding: 0 1.5rem;
    background-color: #fff;
    border: 2px solid #0056b3;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
    transition: color 0.3s;
}

.cs-button-6:before {
    content: "";
    width: 0.375rem;
    height: 100%;
    background: #0056b3;
    opacity: 1;
    position: absolute;
    display: block;
    bottom: 0;
    left: 0;
    transition: width 0.3s;
    z-index: -1;
}

.cs-button-6 .cs-icon {
    width: 1.5rem;
    height: auto;
}

.cs-button-6 .cs-icon path {
    transition: fill 0.3s;
}

.cs-button-6:hover {
    color: #fff;
}

.cs-button-6:hover:before {
    width: 100%;
}

.cs-button-6:hover .cs-icon path {
    fill: #fff;
}

/* ========================================
   CAROUSEL BOOTSTRAP
======================================== */

/* ========================================
   FOOTER
======================================== */
.footer {
    background-color: #1a1a2e;
    color: #e4e4e4;
    padding: clamp(2rem, 4vw, 2.5rem) 20px 20px;
    font-family: Arial, sans-serif;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 20px;
}

.footer-section {
    margin-bottom: 20px;
}

.footer-section h3 {
    color: #1a6bb3;
    margin-bottom: 15px;
    font-size: clamp(1rem, 3vw, 1.2rem);
    border-bottom: 2px solid #ffcc00;
    padding-bottom: 5px;
}

.footer-section p {
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    line-height: 1.5;
    margin-bottom: 10px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #e4e4e4;
    text-decoration: none;
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #1a6bb3;
    text-decoration: underline;
}

.footer-section.contact i {
    margin-right: 8px;
    color: #1a6bb3;
}

.social-links a {
    display: inline-block;
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-right: 15px;
    color: #e4e4e4;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #1a6bb3;
}

.footer-bottom {
    border-top: 1px solid #333;
    text-align: center;
    padding-top: 15px;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
}

/* ========================================
   MEDIA QUERIES
======================================== */

/* ========== Tablets y Móviles (hasta 768px) ========== */
@media only screen and (max-width: 768px) {
    .main-nav {
        padding: 15px 20px;
    }

    .logo img {
        width: 120px;
        height: auto;
    }

    /* Mostrar botón hamburguesa */
    .hamburger {
        display: flex;
    }

    /* Menú móvil */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #fbfbfb;
        width: 100%;
        text-align: center;
        transition: left 0.3s ease-in-out;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
        gap: 0;
        z-index: 999;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        padding: 15px 0;
        border-bottom: 1px solid #e0e0e0;
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        font-size: 18px;
        padding: 15px 20px;
        width: 100%;
    }

    .nav-menu a::after {
        display: none;
    }

    #stats-1687 .cs-wrapper {
        display: flex;
        flex-direction: column;
    }

    #services-1354 .cs-card-group {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-section h3 {
        border-bottom: none;
        padding-bottom: 10px;
    }
}

/* ========== Tablets (768px - 1024px) ========== */
@media only screen and (min-width: 768px) {
    #stats-1687 .cs-wrapper {
        display: grid;
        align-items: center;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    #stats-1687 .cs-content {
        padding: 2rem 0;
    }
    
    #stats-1687 .cs-picture {
        order: 1;
    }

    #services-1354 .cs-card-group {
        grid-template-columns: repeat(2, 1fr);
    }

    .contenido {
        flex-direction: row;
        gap: 40px;
        align-items: stretch;
    }
    
    .mapa, .provincias {
        flex: 1;
    }
    
    .mapa img {
        min-height: 400px;
    }
}

/* ========== Desktop (1024px+) ========== */
@media only screen and (min-width: 1024px) {
    .main-nav {
        padding: 15px 60px;
    }
    
    #services-1354 .cs-content {
        text-align: left;
        align-items: flex-start;
    }
    
    #services-1354 .cs-card-group {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== Móviles pequeños (hasta 480px) ========== */
@media only screen and (max-width: 480px) {
    .main-nav {
        padding: 10px 15px;
    }

    .logo img {
        width: 100px;
        height: auto;
    }

    .nav-menu {
        top: 60px;
    }
    
    .tarjetas-contenedor {
        grid-template-columns: 1fr;
    }
    
    .card {
        max-width: 100%;
    }
    
    .provincia {
        padding: 20px;
    }

    #services-1354 .cs-card-group {
        grid-template-columns: 1fr;
    }
}