:root {
    --primary-dark: #0F172A;
    --text-dark: #1E293B;
    --accent-orange: #D97706;
    --accent-orange-hover: #B45309;
    --bg-light: #FAFAF9;
    --bg-card: #FFFFFF;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- 1. PRELOADER INICIAL --- */
#initial-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #FFFFFF;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loader-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--primary-dark);
}

#initial-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* --- 2. TRANSICIÓN ENTRE SECCIONES --- */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.transition-overlay.active {
    opacity: 1;
    visibility: visible;
}

.giant-gear-icon {
    width: 90px;
    height: 90px;
    color: var(--accent-orange);
    animation: spinGear 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spinGear {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- HEADER Y NAVEGACIÓN RESPONSIVA --- */
header.light-header {
    background-color: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
}

.brand-logo-img {
    height: 45px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 1.8rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-orange);
}

/* Botón Hamburguesa Móvil (Oculto en Escritorio) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--primary-dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.btn-cta {
    background-color: var(--accent-orange);
    color: #FFFFFF;
    padding: 0.6rem 1.4rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.btn-cta:hover {
    background-color: var(--accent-orange-hover);
}

.full-width {
    width: 100%;
}

/* --- HERO SLIDER --- */
.hero-slider {
    position: relative;
    height: 85vh;
    min-height: 550px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
}

.hero-slider .slide.active {
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
    color: var(--primary-dark);
}

.hero-logo-box {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-giant-logo {
    width: 420px;
    max-width: 90%;
    height: auto;
    display: block;
    mix-blend-mode: multiply;
    filter: contrast(1.1);
}

.hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: #0F172A;
}

.hero p {
    font-size: 1.1rem;
    color: #334155;
    margin-bottom: 2rem;
    font-weight: 500;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background-color: #FFFFFF;
    color: var(--primary-dark);
    border: 2px solid var(--primary-dark);
    padding: 0.6rem 1.4rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background-color: var(--primary-dark);
    color: #FFFFFF;
}

/* --- SECCIONES GENERALES --- */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.bg-alt {
    background-color: #F1F5F9;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Nosotros Grid */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.8rem;
}

.about-card {
    background: var(--bg-card);
    padding: 1.8rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.about-card h3 {
    color: var(--primary-dark);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

/* --- MAQUINARIA PESADA SECTION --- */
.machinery-section {
    background-color: #FFFFFF;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.machinery-showcase {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
}

.machinery-info .badge {
    display: inline-block;
    background-color: #FEF3C7;
    color: #92400E;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.machinery-info h3 {
    font-size: 1.8rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.machinery-info p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1.2rem;
}

.machinery-features {
    list-style: none;
    margin-bottom: 1.8rem;
}

.machinery-features li {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 0.7rem;
    position: relative;
    padding-left: 1.4rem;
}

.machinery-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-orange);
    font-weight: bold;
}

.machinery-image-card {
    width: 100%;
    height: 350px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.machinery-img-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

/* --- FILTROS Y TARJETAS DE SERVICIOS --- */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.filter-btn {
    background-color: #FFFFFF;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.filter-btn.active {
    background-color: var(--accent-orange);
    color: #FFFFFF;
    border-color: var(--accent-orange);
}

.services-grid-filtered {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.8rem;
}

.service-card-img {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card-img.hide {
    display: none;
}

.card-image-bg {
    height: 170px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-image-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.6));
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    font-size: 1.2rem;
    color: var(--primary-dark);
    margin-bottom: 0.6rem;
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

.card-content ul {
    list-style: none;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-color);
}

.card-content ul li {
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
    position: relative;
    padding-left: 1.2rem;
}

.card-content ul li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--accent-orange);
    font-weight: bold;
}

/* --- FEATURES SECTION --- */
.features-section {
    background-color: var(--primary-dark);
    color: #FFFFFF;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.feature-item {
    text-align: center;
    padding: 1rem;
}

.feature-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-orange);
    margin-bottom: 0.4rem;
}

/* --- CONTACT SECTION --- */
.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.contact-info h3 {
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin-bottom: 1.2rem;
}

.info-item {
    margin-bottom: 1.2rem;
}

.info-item strong {
    display: block;
    color: var(--primary-dark);
    margin-bottom: 0.2rem;
}

.contact-form {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--bg-light);
}

.form-group textarea {
    resize: vertical;
    height: 100px;
}

/* --- FOOTER --- */
footer {
    background-color: var(--primary-dark);
    color: #94A3B8;
    padding: 1.8rem;
    text-align: center;
    border-top: 1px solid #334155;
    font-size: 0.85rem;
}

/* --- ADAPTABILIDAD MÓVIL (MEDIA QUERIES) --- */
@media (max-width: 900px) {
    .machinery-showcase {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    /* Mostrar botón hamburguesa y ocultar menú tradicional de escritorio */
    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background-color: #FFFFFF;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 3rem;
        gap: 1.5rem;
        transition: left 0.3s ease-in-out;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
        z-index: 999;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links a {
        font-size: 1.2rem;
    }

    .mobile-cta {
        margin-top: 1rem;
        width: 80%;
        text-align: center;
    }

    /* Animación del botón hamburguesa a una "X" */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Ajustes generales de texto y portadas en móviles */
    .hero-giant-logo {
        width: 270px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: 1.7rem;
    }

    .section-container {
        padding: 3rem 1rem;
    }

    .contact-form {
        padding: 1.5rem;
    }
}

/* --- SECCIÓN NUESTRO TRABAJO (VIDEOS) --- */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.8rem;
}

.video-card {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Relación de aspecto 16:9 */
    background-color: #000;
}

.video-wrapper video,
.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.video-info {
    padding: 1.2rem;
}

.video-info h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 0.4rem;
}

.video-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- WIDGET DE WHATSAPP Y BOT INTERACTIVO --- */
.whatsapp-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    font-family: inherit;
}

.wa-float-btn {
    background-color: #25D366;
    color: #FFFFFF;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: transform 0.3s ease, background 0.3s ease;
    position: relative;
}

.wa-float-btn:hover {
    transform: scale(1.1);
    background-color: #20BA5A;
}

.wa-tooltip {
    position: absolute;
    right: 70px;
    background: #0F172A;
    color: #FFF;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.wa-float-btn:hover .wa-tooltip {
    opacity: 1;
}

/* Ventana emergente del Bot */
.wa-chat-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 320px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.wa-chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wa-header {
    background-color: #075E54;
    color: #FFFFFF;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wa-avatar {
    width: 36px;
    height: 36px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
}

.wa-brand h4 {
    font-size: 0.95rem;
    margin: 0;
}

.wa-brand p {
    font-size: 0.75rem;
    margin: 0;
    opacity: 0.8;
}

.wa-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #FFF;
    font-size: 22px;
    cursor: pointer;
}

.wa-body {
    background-color: #E5DDD5;
    padding: 15px;
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wa-msg {
    background: #FFFFFF;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1E293B;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wa-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wa-option-btn {
    background: #FFFFFF;
    border: 1px solid #25D366;
    color: #075E54;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.wa-option-btn:hover {
    background: #DCF8C6;
}

.wa-footer {
    padding: 8px 10px;
    background: #F0F0F0;
    display: flex;
    gap: 6px;
}

.wa-footer input {
    flex-grow: 1;
    border: 1px solid #CCC;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.85rem;
    outline: none;
}

.wa-footer button {
    background: #075E54;
    color: #FFF;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
}

@media (max-width: 480px) {
    .whatsapp-widget {
        bottom: 15px;
        right: 15px;
    }
    .wa-chat-window {
        width: 290px;
    }
}