/* ============================================
   FALLBACK IMAGES - CSS Backgrounds
   Si no existen las imágenes físicas, se usarán estos gradientes
   ============================================ */

/* Hero Slider Backgrounds - With images and overlay */
.hero-slide:nth-child(1) {
    background-image:
        linear-gradient(135deg, rgba(30, 58, 138, 0.5) 0%, rgba(220, 38, 38, 0.3) 100%),
        url('images/hero-1.jpg');
    background-color: #1E3A8A;
}

.hero-slide:nth-child(2) {
    background-image:
        linear-gradient(135deg, rgba(245, 158, 11, 0.5) 0%, rgba(30, 58, 138, 0.3) 100%),
        url('images/hero-2.jpg');
    background-color: #1E3A8A;
}

.hero-slide:nth-child(3) {
    background-image:
        linear-gradient(135deg, rgba(220, 38, 38, 0.5) 0%, rgba(30, 41, 59, 0.3) 100%),
        url('images/hero-3.jpg');
    background-color: #1E3A8A;
}

.hero-slide:nth-child(4) {
    background-image:
        linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(245, 158, 11, 0.3) 100%),
        url('images/hero-4.jpg');
    background-color: #1E3A8A;
}

/* Service Card Backgrounds - Transporte */
.service-card:nth-child(1) .service-image {
    background-image:
        linear-gradient(135deg, rgba(30, 58, 138, 0.8) 0%, rgba(220, 38, 38, 0.6) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"><rect fill="%231E3A8A" width="800" height="600"/><path d="M100 300 L200 250 L300 300 L400 250 L500 300 L600 250 L700 300" stroke="rgba(255,255,255,0.1)" stroke-width="2" fill="none"/></svg>');
    background-size: cover;
    background-position: center;
}

/* Service Card Backgrounds - Maquinaria */
.service-card:nth-child(2) .service-image {
    background-image:
        linear-gradient(135deg, rgba(245, 158, 11, 0.8) 0%, rgba(30, 58, 138, 0.6) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"><rect fill="%23F59E0B" width="800" height="600"/><circle cx="200" cy="300" r="80" fill="rgba(255,255,255,0.1)"/><circle cx="600" cy="300" r="80" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
    background-position: center;
}

/* Service Card Backgrounds - Obras Civiles */
.service-card:nth-child(3) .service-image {
    background-image:
        linear-gradient(135deg, rgba(220, 38, 38, 0.8) 0%, rgba(30, 58, 138, 0.6) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"><rect fill="%23DC2626" width="800" height="600"/><rect x="300" y="200" width="200" height="300" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
    background-position: center;
}

/* Alternative: Use actual images if they exist */
/* Uncomment these lines when you add real images */

/*
.service-card:nth-child(1) .service-image {
    background-image: linear-gradient(135deg, rgba(30, 58, 138, 0.7) 0%, rgba(220, 38, 38, 0.5) 100%), url('images/transporte.jpg');
}

.service-card:nth-child(2) .service-image {
    background-image: linear-gradient(135deg, rgba(245, 158, 11, 0.7) 0%, rgba(30, 58, 138, 0.5) 100%), url('images/maquinaria.jpg');
}

.service-card:nth-child(3) .service-image {
    background-image: linear-gradient(135deg, rgba(220, 38, 38, 0.7) 0%, rgba(30, 58, 138, 0.5) 100%), url('images/obras.jpg');
}
*/

/* Policy Card Image Fallbacks */
.policy-card .policy-image img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Ensure all images have a background while loading */
.policy-image,
.certification-badge,
.service-image {
    background-color: #F1F5F9;
}

/* Loading state for images */
img:not([src]) {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
