/* Variables Globales y Reset */
:root {
    --primary-dark: #0f172a;
    --primary-blue: #024CAA;
    --text-light: #f8fafc;
    --text-dark: #334155;

    /* Colores Servicios */
    --srv-blue-dark: #1e3a8a;
    --srv-blue-med: #0284c7;
    --srv-green: #16a34a;
    --srv-orange: #ea580c;
    --srv-purple: #6b21a8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Tipografía y Títulos */
h1,
h2,
h3,
h4 {
    font-weight: 700;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--primary-dark);
}

.text-white {
    color: #fff !important;
}

.text-center {
    text-align: center;
}

.text-blue {
    color: var(--primary-blue);
}

/* Botones */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    font-size: 0.9rem;
}

.btn-blue {
    background-color: var(--primary-blue);
    color: #fff;
}

.btn-blue:hover {
    background-color: #003b8c;
}

.btn-outline {
    border: 2px solid #fff;
    color: #fff;
}

.btn-outline:hover {
    background-color: #fff;
    color: var(--primary-dark);
}

/* Header / Navbar */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s;
    padding: 15px 0;
}

header.scrolled {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    background-image: url('logo.png');
    background-size: cover;
    height: 100px;
    width: 20%;
    background-position: center;
    background-repeat: no-repeat;
    padding: 6px 16px;
    border-radius: 6px;
}

.logo h2 {
    color: #fff;
    font-weight: 800;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
}

.logo span {
    display: block;
    font-size: 0.6rem;
    letter-spacing: 2px;
    font-weight: 400;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    margin: 0 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Fondo del Hero */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.7)),
        url('kvnsbl-crane.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
}

.hero-content {
    color: #fff;
    margin-top: 50px;
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

/* Secciones Generales */
.section-light {
    padding: 80px 0;
    background-color: #fff;
}

.section-dark {
    padding: 80px 0;
    background-color: var(--primary-dark);
}

.border-top {
    border-top: 1px solid #e2e8f0;
}

/* Grid Systems */
.grid {
    display: grid;
    gap: 20px;
}

.grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Tarjetas: Problemas */
.card-problema {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 250px;
}

.card-problema img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
}

.card-overlay {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #fff;
}

.card-overlay i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.card-overlay h3 {
    font-size: 0.9rem;
}

/* Tarjetas: Por qué elegirnos */
.card-elegir {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border-bottom: 4px solid var(--primary-blue);
    color: #fff;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-elegir:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.5);
}

.card-elegir img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transition: transform 0.5s ease;
}

.card-elegir:hover img {
    transform: scale(1.1);
}

.card-elegir::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 10%, rgba(15, 23, 42, 0.7) 50%, rgba(15, 23, 42, 0.45) 100%);
    z-index: 1;
}

.card-elegir-content {
    position: relative;
    z-index: 2;
    padding: 25px 20px;
    width: 100%;
}

.card-elegir-content h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.card-elegir-content p {
    font-size: 0.9rem;
    color: #f1f5f9;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Tarjetas: Servicios */
.card-servicio {
    border-radius: 8px;
    overflow: hidden;
    color: #fff;
}

.card-servicio img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.servicio-header {
    padding: 15px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-servicio ul {
    list-style: none;
    padding: 0 20px 20px 20px;
}

.card-servicio ul li {
    font-size: 0.8rem;
    margin-bottom: 8px;
    position: relative;
    padding-left: 12px;
}

.card-servicio ul li::before {
    content: "•";
    position: absolute;
    left: 0;
}

.bg-blue-dark {
    background-color: var(--srv-blue-dark);
}

.bg-blue-medium {
    background-color: var(--srv-blue-med);
}

.bg-green {
    background-color: var(--srv-green);
}

.bg-orange {
    background-color: var(--srv-orange);
}

.bg-purple {
    background-color: var(--srv-purple);
}

/* --- SECCIÓN ANTES Y DESPUÉS --- */
.title-with-lines {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 3rem;
    gap: 15px;
}

.title-with-lines::before,
.title-with-lines::after {
    content: "";
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    flex: 1;
    max-width: 250px;
}

.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 50px;
}

.grid-4-carousel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

.ba-card {
    text-align: center;
}

.ba-image-box {
    position: relative;
    width: 100%;
    height: 220px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background-color: #1e293b;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    user-select: none;
}

.ba-image-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.ba-img-after {
    z-index: 1;
}

.ba-img-before {
    z-index: 2;
    clip-path: polygon(0 0, var(--pos, 50%) 0, var(--pos, 50%) 100%, 0 100%);
}

.ba-badge {
    position: absolute;
    top: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 4;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.ba-badge-before {
    left: 10px;
    background: rgba(15, 23, 42, 0.85);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ba-badge-after {
    right: 10px;
    background: var(--primary-blue);
    color: #fff;
}

.ba-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos, 50%);
    width: 2px;
    background-color: #fff;
    transform: translateX(-50%);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
    z-index: 5;
    pointer-events: none;
}

.ba-button {
    position: absolute;
    top: 50%;
    left: var(--pos, 50%);
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    background-color: var(--primary-blue);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
    z-index: 15;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease;
}

.ba-button:hover {
    transform: translate(-50%, -50%) scale(1.15);
    background-color: #003b8c;
}

.ba-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 10;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.ba-image-box:active .ba-button {
    transform: translate(-50%, -50%) scale(1.15);
    background-color: #003b8c;
}

.ba-card h4 {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.carousel-arrow {
    position: absolute;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.25s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.carousel-arrow:hover {
    background: var(--primary-blue);
    color: #fff;
    transform: scale(1.1);
}

.section-light .carousel-arrow {
    background: #0f172a;
    color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.left-arrow {
    left: 5px;
}

.right-arrow {
    right: 5px;
}

@media (min-width: 1025px) {

    #problemas .carousel-arrow,
    #nosotros .carousel-arrow {
        display: none;
    }
}


/* Experiencia / Trabajamos Para */
.layout-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.subsection-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.2rem;
    color: var(--primary-dark);
}

.grid-4-icons {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.grid-4-icons i {
    color: #94a3b8;
    margin-bottom: 10px;
}

.grid-4-icons p {
    font-size: 0.75rem;
    font-weight: 700;
}

.grid-5-stats {
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    align-items: end;
}

.stat-number {
    font-size: 1.3rem;
    margin: 10px 0 5px 0;
    color: var(--primary-dark);
}

.grid-5-stats p {
    font-size: 0.7rem;
    font-weight: 700;
}

/* Testimonios */
.testimonial-card {
    background: transparent;
    border: 1px solid #334155;
    padding: 30px;
    border-radius: 8px;
    color: #fff;
    position: relative;
}

.quote-icon {
    font-size: 1.5rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.testimonial-card p {
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 20px;
    min-height: 80px;
}

.client-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.client-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.client-info h4 {
    font-size: 1rem;
}

.client-info span {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Footer */
.footer {
    background-color: #020617;
    color: #cbd5e1;
    padding: 60px 0 30px 0;
}

.grid-4-footer {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-brand h2 {
    color: #fff;
    margin-bottom: 15px;
}

.social-icons a {
    color: #fff;
    margin-right: 15px;
    font-size: 1.2rem;
}

.footer-links h4,
.footer-contact h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links ul a:hover {
    color: #fff;
}

.footer-contact p {
    margin-bottom: 10px;
    font-size: 0.9rem;
    display: flex;
    gap: 10px;
}

/* Botón WhatsApp Flotante */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 35px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
    text-decoration: none;
    transition: 0.3s;
}

.whatsapp-float:hover {
    background-color: #128c7e;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1024px) {
    .grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4-carousel {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 20px;
        scroll-behavior: smooth;
        padding-bottom: 15px;
        scrollbar-width: none;
    }

    .grid-4-carousel::-webkit-scrollbar {
        display: none;
    }

    .ba-card {
        flex: 0 0 calc(50% - 10px);
        scroll-snap-align: start;
    }

    .layout-2col {
        grid-template-columns: 1fr;
    }

    .grid-5-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .title-with-lines::before,
    .title-with-lines::after {
        max-width: 100px;
    }
}

@media (max-width: 768px) {

    .nav-links,
    .nav-contact {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .grid-5,
    .grid-3,
    .grid-4-footer {
        grid-template-columns: 1fr;
    }

    .grid-6,
    .grid-4 {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 16px;
        scroll-behavior: smooth;
        padding-bottom: 15px;
        scrollbar-width: none;
    }

    .grid-6::-webkit-scrollbar,
    .grid-4::-webkit-scrollbar {
        display: none;
    }

    .card-problema,
    .card-elegir,
    .ba-card {
        flex: 0 0 100%;
        width: 100%;
        scroll-snap-align: center;
    }

    .carousel-wrapper {
        padding: 0 35px;
    }

    .title-with-lines::before,
    .title-with-lines::after {
        display: none;
    }

    .grid-4-icons {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-5-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    header {
        background-color: var(--primary-dark);
    }
}