.clients-section {
    padding: 4rem 0;
    background-color: #ffffff;
    position: relative;
}

.clients-container {
    max-width: 80rem;
    /* max-w-7xl */
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

.clients-title {
    /* Refer to global.css for the h1, h2 and h3 clamp styles */
    /* font-size: 2.25rem; */
    font-weight: 800;
    color: #1f2937;
    text-align: center;
    margin-bottom: 2.5rem;
}

/* --- Slider Structure --- */
.slider-wrapper {
    position: relative;
    /* Essential for absolute positioning of buttons */
}

.slider-viewport {
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    background-color: #f9fafb;
    padding: 1rem;
}

/* The movable track element */
.client-logos {
    display: flex;
    /* width: max-content; */
    /* width: 100%; */
    transition: transform 0.4s ease-in-out;
}

/* --- Logo Item Styling --- */
.client-logo {
    padding: 1rem;
    flex-shrink: 0;
    box-sizing: border-box;
    /* Default: Mobile (2 items visible) */
    width: 50%;
}

.client-logo img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    height: 6rem;
    object-fit: contain;
    /* filter: grayscale(100%); */
    /* opacity: 0.7; */
    /* transition: filter 0.3s, opacity 0.3s; */
}

.client-logo img:hover {
    /* filter: grayscale(0%); */
    opacity: 1;
}

/* --- Navigation Buttons --- */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #ffffff;
    padding: 0.75rem;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -2px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.15s;
    z-index: 10;
    /* Hide buttons by default on small screens */
    line-height: 0;
    /* Ensures SVG is perfectly centered */
}

.slider-btn:hover:not(:disabled) {
    background-color: #f3f4f6;
}

.slider-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Position specific buttons */
#prev-btn {
    left: 0;
    /* Shifts button half its width outside the viewport area */
    transform: translate(-50%, -50%);
}

#next-btn {
    right: 0;
    /* Shifts button half its width outside the viewport area */
    transform: translate(50%, -50%);
}

.slider-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #4b5563;
}

.clients-section.page .client-logos {
    width: fit-content;
    flex-wrap: wrap;
    display: flex;
    justify-content: center;
}

.clients-section.page .client-logos .client-logo img {
    height: 8rem;
}

/* --- Responsiveness (Media Queries) --- */

/* Small devices (sm: 640px and up) - 3 items visible, buttons visible */
@media (min-width: 640px) {
    .client-logo {
        width: 33.3333%;
        /* 1/3 width */
    }

    .slider-btn {
        display: block;
    }

    .clients-container {
        padding: 0 1.5rem;
    }

    .client-logo {
        width: unset;
    }
}

/* Large devices (lg: 1024px and up) - 5 items visible */
@media (min-width: 1024px) {
    .client-logo {
        width: 20%;
        /* 1/5 width */
    }

    .clients-container {
        /* padding: 0 2rem; */
    }
}

/* Extra Large devices (xl: 1280px and up) - 6 items visible */
@media (min-width: 1280px) {
    .client-logo {
        width: 16.6666%;
        /* 1/6 width */
    }
}

@media (max-width: 600px) {
    .client-logo {
        width: unset;
    }
    .clients-section.page .client-logos .client-logo img {
        height: 5rem;
    }
}
