:root{
    --card-width: 200px;
    --gap: 16px;

    --scrollbar-height: 10px;       /* thickness of horizontal scrollbar */
    --scrollbar-thumb-color: rgba(0,0,0,0.35);

    /* button placement: adjust these to "move the buttons about" */
    --btn-h-offset: 8px;            /* distance from left / right edge */
    --btn-v-offset: 0px;            /* vertical offset (positive pushes down) */
}

.carousel {
    position: relative;
    overflow: hidden;
    max-width: 1900px;
    margin: auto;
    padding: 0 32px;
}

.carousel-track {
    display: flex;
    gap: var(--gap);
    padding: 0 12px var(--scrollbar-height) 12px; /* reserve space for scrollbar */
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Firefox hint */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent; /* start transparent (no visible thumb) */
    transition: all .35s ease, opacity .35s ease;
}

/* ---------- WebKit (Chrome / Safari) scrollbar styling ---------- */
.carousel-track::-webkit-scrollbar {
    height: var(--scrollbar-height);
    transition: all .35s ease, opacity .35s ease;
}
.carousel-track::-webkit-scrollbar-track {
    background: transparent;
    transition: all .35s ease, opacity .35s ease;
}
.carousel-track::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0);          /* start fully transparent */
    border-radius: 999px;
    transition: all .35s ease, opacity .35s ease;
}

/* On hover, reveal scrollbar thumb smoothly (WebKit). Firefox fallback below. */
.carousel:hover .carousel-track::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb-color);
}

/* ---------- Firefox (partial support) ---------- */
/* When hovering the carousel, set visible scrollbar color (no smooth animation in FF) */
.carousel:hover .carousel-track {
    scrollbar-color: var(--scrollbar-thumb-color) transparent;
}

/* ---------- Cards ---------- */
.card {
    flex: 0 0 var(--card-width);
    background: #fff;
    color: #000;
    border-radius: 12px;
    padding: 14px;
    text-decoration: none;
}

.product-img {
    position: relative;
    height: 220px;
    width: 220px;
    border-radius: 12px;
    margin-bottom: 8px;
    background-color: rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    justify-content: center;
}


.product-img img{
    height: 100%;
}

.product-img::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.04); /* Adjust opacity as needed */
    border-radius: inherit;
    pointer-events: none;
    transition: background-color 0.3s ease;
}

.card h4{
    font-size: 14px;
    font-weight: 400;
    min-height: 36px;
    line-height: 20px;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* number of lines to show */
            line-clamp: 2; 
    -webkit-box-orient: vertical;
}

.price{
    font-weight: 600;
    font-size: 16px;
    margin: 0;
}

/* ---------- Buttons (movable via CSS variables) ---------- */
.carousel button {
    position: absolute;
    top: calc(50% + var(--btn-v-offset));
    transform: translateY(-50%);
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 999px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
    z-index: 10;
    transition: transform .15s ease, opacity .15s ease;
}
.carousel button:active { transform: translateY(-50%) scale(.96); }

/* left / right positions using variables */
.carousel .prev { left: var(--btn-h-offset); }
.carousel .next { right: var(--btn-h-offset); }

/* optional: make buttons a bit more subtle until hover on carousel */
.carousel button { opacity: 0.9; }
.carousel:not(:hover) button { opacity: 0.75; }

/* Responsive: shrink carousel width on small screens */
@media (max-width: 640px) {
    :root { --carousel-width: 95vw; --card-width: 130px; }

    .product-img {
        height: 150px;
        width: 150px;
    }
}