/* Define colors in root */
:root {
    --servicios-bg-color: #f9f9f9;
    --servicios-text-color: #333;
    --servicios-gradient-start: #007BFF;
    --servicios-gradient-end: #003366;
    --servicios-category-bg: #fff;
    --servicios-shadow-light: rgba(0, 0, 0, 0.1);
    --servicios-shadow-dark: rgba(0, 0, 0, 0.2);
    --servicios-category-heading-bg: #00345e;
    --servicios-carousel-bg: #f5f5f5;
    --servicios-image-border: #e0e0e0;
    --servicios-description-bg: rgba(74, 111, 165, 0.9);
    --servicios-nav-arrow-bg-light: rgba(74, 111, 165, 0.3);
    --servicios-nav-arrow-bg-dark: rgba(74, 111, 165, 0.9);
}

/* Base and Layout */
body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--servicios-bg-color);
    margin: 0;
    padding: 0;
    color: var(--servicios-text-color);
}

.servicios-heading {
    text-align: center;
    background: linear-gradient(45deg, var(--servicios-gradient-start), var(--servicios-gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding: 30px 0;
    font-weight: 600;
}

.servicios-heading::after {
    content: "";
    display: block;
    width: 50%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--servicios-gradient-start), var(--servicios-gradient-end), transparent);
    margin: 20px auto 0 auto;
}

/* Gallery Styles */
.gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 2%;
}

.category {
    width: 80%;
    margin: 20px 0;
    background-color: var(--servicios-category-bg);
    box-shadow: 0 8px 15px var(--servicios-shadow-light);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, width 0.5s ease;
}

.category:hover {
    box-shadow: 0 8px 20px var(--servicios-shadow-dark);
}

.category h2 {
    background-color: var(--servicios-category-heading-bg);
    color: var(--servicios-category-bg);
    text-align: center;
    padding: 20px;
    margin: 0;
    font-weight: 600;
}

.carousel-container {
    overflow: hidden;
    position: relative;
    padding-bottom: 10px;
    background-color: var(--servicios-carousel-bg);
}

.image-carousel {
    display: flex;
    transition: transform 0.5s ease;
    padding: 20px;
    padding-bottom: 10px;
}

/* Image Styles */
.image {
    flex: 0 0 calc(25% - 15px);
    position: relative;
    margin-right: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, flex-basis 0.5s ease, margin-right 0.5s ease;
    border-radius: 12px;
    border: 1px solid var(--servicios-image-border);
    padding: 10px;
    background-color: var(--servicios-category-bg);
    box-shadow: 0 6px 10px var(--servicios-shadow-light);
}

.image:last-child {
    margin-right: 0;
}

.image img {
    max-width: 100%;
    max-height: 180px;
    display: block;
    margin: 0 auto;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.image:hover {
    box-shadow: 0 6px 10px var(--servicios-shadow-light);
}

.image:hover img {
    transform: scale(1.1);
    filter: contrast(120%);
}

.description {
    position: absolute;
    background-color: var(--servicios-description-bg);
    color: var(--servicios-category-bg);
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-weight: 600;
}

.image:hover .description {
    opacity: 1;
}

/* Navigation Arrows */
.navigation-arrows {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: var(--servicios-nav-arrow-bg-light);
    color: var(--servicios-category-bg);
    text-align: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 2;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navigation-arrows.left {
    left: 0px;
    bottom: 0px;
}

.navigation-arrows.right {
    right: 0px;
    bottom: 0px;
}

.navigation-arrows:hover {
    background-color: var(--servicios-nav-arrow-bg-dark);
}

/* Media Queries */
@media (max-width: 1024px) {
    .image {
        flex: 0 0 calc(25% - 15px);
        margin-right: 15px;
    }
}

@media (max-width: 768px) {
    .category {
        width: 100%;
    }

    .image {
        flex: 0 0 calc(33.333% - 10px);
        margin-right: 10px;
    }

    .category h2,
    .navigation-arrows {
        padding: 15px;
    }

    .navigation-arrows {
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .image {
        flex: 0 0 calc(50% - 10px);
        margin-right: 10px;
    }

    .category h2 {
        font-size: 18px;
    }

    h1 {
        font-size: 24px;
        padding: 20px 0;
    }

    .description {
        font-size: 14px;
    }
}