/* --- Horizontal shelf base --- */
.card-shelf-block {
    position: relative;
    margin-bottom: 3rem;
}

.card-shelf-wrapper {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 1.5rem;
    padding-inline: 1.5rem;
}

/* Row of cards */
.card-shelf {
    display: flex;
    flex-wrap: nowrap;
    padding-bottom: 1rem;
}

/* Each card item */
.shelf-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

/* Responsive card widths */
.card-shelf .card {
    width: min(80vw, 320px); /* large on mobile, cap at 320px */
}

@media (min-width: 768px) {
    .card-shelf .card {
        width: 320px;
    }
}

@media (min-width: 1200px) {
    .card-shelf .card {
        width: 360px;
    }
}

/* Arrow buttons */
.shelf-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    border: none;
    border-radius: 999px;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, opacity 0.2s ease;
}

.shelf-arrow-left {
    left: 0.75rem;
}

.shelf-arrow-right {
    right: 0.75rem;
}

.shelf-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.05);
}

.shelf-arrow.is-disabled {
    opacity: 0.2;
    pointer-events: none;
}

/* Optional: hide scrollbar on WebKit */
.card-shelf-wrapper::-webkit-scrollbar {
    display: none;
}

/* Shelf header (title row) */
.shelf-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-inline: 1.5rem;
    margin-bottom: 0.5rem;
}

.shelf-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
}