/* --- VARIABLES DE COLOR --- */
:root {
    --rojo: #D32F2F;        /* Rojo Komatsu/Industrial */
    --amarillo: #FFC107;    /* Amarillo Caterpillar */
    --gris-oscuro: #212121; /* Gris Acero */
    --gris-claro: #F5F5F5;
    --blanco: #FFFFFF;
    --negro: #000000;
}

/* --- RESET Y BASES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--blanco);
    color: var(--gris-oscuro);
    line-height: 1.6;
}

h1, h2, h3, .logo {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- HEADER --- */
header {
    background-color: var(--gris-oscuro);
    color: var(--blanco);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 5px solid var(--amarillo);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    padding: 1rem 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 15px; 
}

.logo img {
    height: 50px; 
    width: auto;
    object-fit: contain;
}

.logo span { color: var(--rojo); }

/* Navegación Desktop */
nav ul {
    display: flex;
    gap: 25px;
}

nav a {
    font-weight: 500;
    font-size: 1.1rem;
    position: relative;
}

nav a:hover {
    color: var(--amarillo);
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--rojo);
    bottom: -5px;
    left: 0;
    transition: 0.3s;
}

nav a:hover::after { width: 100%; }

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- HERO SECTION --- */
.hero {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), 
                url('https://images.unsplash.com/photo-1581092334651-ddf26d9a09d0?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
    background-size: cover;
    background-position: center;
    height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--blanco);
    padding: 0 20px;
}

.hero-content {
    max-width: 800px;
    animation: fadeIn 1.5s ease;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 2px 2px 0px var(--negro);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: #ddd;
}

.btn {
    display: inline-block;
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--rojo);
    color: var(--blanco);
}

.btn-primary:hover {
    background-color: var(--amarillo);
    color: var(--negro);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

/* --- BOTÓN NEÓN AMARILLO (INICIO) --- */
.btn-neon {
    display: inline-block;
    background-color: var(--gris-oscuro);
    color: var(--blanco);
    padding: 18px 40px;
    font-size: 1.2rem;
    font-family: 'Oswald', sans-serif;
    font-weight: bold;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    margin-top: 3.5rem;
}

.btn-neon:hover {
    background-color: var(--negro);
    color: var(--amarillo);
    border-color: var(--amarillo);
    box-shadow: 0 0 15px var(--amarillo), 0 0 35px var(--amarillo);
    transform: scale(1.05);
}

/* --- BOTÓN NEÓN WHATSAPP (GALERÍA) --- */
.btn-whatsapp-neon {
    display: inline-block;
    background-color: #25D366; /* Verde original WhatsApp */
    color: var(--blanco);
    padding: 18px 40px;
    font-size: 1.2rem;
    font-family: 'Oswald', sans-serif;
    font-weight: bold;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    border: 2px solid var(--blanco); /* Bordes Blancos */
    margin-bottom: 3.5rem;
}

.btn-whatsapp-neon:hover {
    background-color: #128C7E;
    color: var(--blanco);
    border-color: #25D366;
    box-shadow: 0 0 20px #25D366, 0 0 40px #25D366; /* Iluminación Verde Neón */
    transform: scale(1.05);
}

/* --- SECCIONES --- */
.section {
    padding: 5rem 0;
}

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

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--gris-oscuro);
    line-height: 1;
}

.section-subtitle {
    font-family: 'Oswald', sans-serif;
    color: var(--rojo);
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    display: block;
    margin-bottom: 1rem;
}

.divider {
    width: 80px;
    height: 5px;
    background: var(--amarillo);
    margin: 0 auto;
}

/* --- PRODUCTOS DESTACADOS (INDEX) --- */
.bg-light { background-color: var(--gris-claro); }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

.card {
    background: var(--blanco);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: 0.3s;
    position: relative;
    border-top: 4px solid transparent;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-top: 4px solid var(--amarillo);
}

.card-img {
    height: 220px;
    width: 100%;
    object-fit: cover;
    background-color: #ddd;
}

.card-body {
    padding: 1.5rem;
    text-align: center;
}

.card h3 {
    margin-bottom: 0.5rem;
    color: var(--rojo);
}

.tag {
    background: var(--gris-oscuro);
    color: var(--amarillo);
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
    font-weight: bold;
}

/* =========================================
   GALERÍA MOSAICO INTELIGENTE
========================================= */
.gallery-mosaic {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 250px;
    grid-auto-flow: dense;
    gap: 3px;
    background-color: var(--blanco);
    border: 3px solid var(--blanco);
}

.mosaic-item {
    position: relative;
    overflow: hidden;
    background-color: #eaeaea;
    opacity: 0;
    transform: translateY(60px); 
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mosaic-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.mosaic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.mosaic-item:hover img {
    transform: scale(1.08);
}

.span-col-2 { grid-column: span 2; }
.span-row-2 { grid-row: span 2; }

.mosaic-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: white;
    padding: 20px 15px 15px 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    text-align: center;
}

.mosaic-item:hover .mosaic-info {
    transform: translateY(0);
}

.mosaic-info h4 { margin: 5px 0 0 0; font-size: 1.2rem; color: var(--blanco); text-transform: uppercase; }
.mosaic-info .code { color: var(--amarillo); font-weight: bold; font-family: 'Oswald', sans-serif; letter-spacing: 1px; font-size: 0.95rem; }


/* --- MARCAS Y CONTACTO --- */
.brands-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem; 
    max-width: 1100px;
    margin: 0 auto;
}

.brand-logo {
    width: 160px;  
    height: 90px;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.7); 
    transition: all 0.4s ease-in-out;
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
}

.brand-logo:hover {
    filter: grayscale(0%) opacity(1); 
    transform: scale(1.15); 
    box-shadow: 0 0 25px rgba(255, 193, 7, 0.7); 
    background-color: rgba(255, 255, 255, 0.9); 
    z-index: 10;
}

.contact-section {
    background-color: var(--gris-oscuro);
    color: var(--blanco);
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    width: 90%;
    max-width: 1000px;
    margin: auto;
}

.contact-info h3 {
    color: var(--amarillo);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-item i {
    color: var(--rojo);
    font-size: 1.5rem;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.map-box {
    background: #333;
    height: 300px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; 
}

footer {
    background: var(--negro);
    color: #777;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* --- WHATSAPP --- */
.whatsapp-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.whatsapp-main-btn {
    position: relative; /* Importante para el pulso */
    width: 75px;
    height: 75px;
    background-color: #25d366;
    color: white;
    border-radius: 50%;
    border: none;
    font-size: 40px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* EFECTO PULSO RESTAURADO */
.whatsapp-main-btn::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #25d366;
    opacity: 0.7;
    z-index: -1;
    animation: pulse-whatsapp 2s infinite;
}

@keyframes pulse-whatsapp {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.6); opacity: 0; }
}

.whatsapp-main-btn:hover {
    transform: scale(1.15);
    background-color: #1ebe57;
}

.whatsapp-menu {
    display: none;
    flex-direction: column;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    margin-bottom: 20px;
    overflow: hidden;
    width: 240px;
    animation: slideUp 0.4s ease forwards;
}

.whatsapp-menu.show {
    display: flex;
}

.wa-option {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    text-decoration: none;
    color: #222;
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    font-weight: 700;
    transition: background 0.3s;
    border-bottom: 1px solid #f0f0f0;
}

.wa-option:last-child { border-bottom: none; }
.wa-option:hover { 
    background: #f4f4f4; 
    color: #25d366; 
}

.wa-option i {
    font-size: 32px;
    margin-right: 15px;
    color: #555;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .menu-toggle { display: block; }
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--gris-oscuro);
        position: absolute;
        top: 70px;
        left: 0;
        padding: 20px;
        text-align: center;
        z-index: 999;
    }
    nav ul.active { display: flex; }
    
    .brand-logo { width: 130px; margin-bottom: 10px; }
    .brands-container { gap: 1rem; }
    
    .gallery-mosaic {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-auto-rows: 150px;
    }

    .whatsapp-main-btn { width: 65px; height: 65px; font-size: 35px; }
    .whatsapp-menu { width: 200px; }
    .wa-option { font-size: 18px; padding: 15px; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}