/* Estilos adicionales para imágenes de servicios y galería */

/* Service Images */
.service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 24px;
    filter: brightness(0.88) contrast(1.1);
    transition: all 0.5s ease;
}

/* Hidroneumático: imagen con fondo blanco, usar contain para que se vea completa */
.service-card-flip:first-child .service-image {
    object-fit: contain;
    object-position: center center;
    background-color: #1a1a2e;
    padding: 16px;
    filter: brightness(1) contrast(1.05);
}

.service-card-front {
    overflow: hidden;
    position: relative;
}

.service-card-front:hover .service-image {
    filter: brightness(1) contrast(1.15);
    transform: scale(1.06);
}

/* Fix para select opaco */
.form-group select {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
}

.form-group select option {
    background: #18181B;
    color: #FFFFFF;
}

/* =====================================================
   GALLERY SECTION - CLEAN EDITORIAL LAYOUT
   ===================================================== */
.gallery {
    padding: 120px 0;
    background: var(--bg-primary);
    position: relative;
    z-index: 1;
}

/* === MAIN GRID: 3 columns, uniform rows === */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    gap: 16px;
}

/* === Each gallery item === */
.gallery-item {
    position: relative;
    height: 260px;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(59, 130, 246, 0.08);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s ease,
        border-color 0.4s ease;
}

/* Featured items: slightly taller for visual rhythm */
.gallery-item.featured {
    height: 340px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: brightness(0.9) saturate(1.1);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.4s ease;
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 48px rgba(59, 130, 246, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.5);
    border-color: rgba(59, 130, 246, 0.35);
}

.gallery-item:hover img {
    transform: scale(1.08);
    filter: brightness(1) saturate(1.2);
}

/* === Overlay === */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 10, 0.92) 0%,
            rgba(0, 0, 10, 0.4) 40%,
            transparent 70%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
}

.gallery-overlay h4 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.gallery-overlay p {
    color: rgba(147, 197, 253, 0.9);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* === Category badge on each item === */
.gallery-item::before {
    content: attr(data-category);
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    background: rgba(59, 130, 246, 0.85);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-item:hover::before {
    opacity: 1;
    transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-item.featured {
        height: 280px;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .gallery-item,
    .gallery-item.featured {
        height: 220px;
    }
}