/* Two short, independently scrollable selections on the homepage. */
.home-modern .home-product-shelves {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.home-modern .home-product-shelves--single {
    grid-template-columns: minmax(0, 1fr);
}

.home-modern .home-shelf {
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--home-border);
    border-radius: 18px;
    background: var(--home-surface);
}

.home-modern .home-shelf__header,
.home-modern .home-shelf__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-modern .home-shelf__header {
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--home-border);
}

.home-modern .home-shelf__header h2 {
    margin: 0;
    color: var(--home-text);
    font-size: clamp(16px, 1.45vw, 21px);
    font-weight: 850;
    line-height: 1.6;
}

.home-modern .home-shelf__more,
.home-modern .home-shelf__controls:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.home-modern .home-shelf__more {
    min-height: 36px;
    padding-inline: 6px;
    color: var(--home-text);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.home-modern .home-shelf__more:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.home-modern .home-shelf__controls:not([hidden]) {
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--home-border);
    border-radius: 9px;
}

.home-modern .home-shelf__controls button {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 0;
    background: var(--home-surface);
    color: var(--home-text);
    cursor: pointer;
}

.home-modern .home-shelf__controls button + button {
    border-inline-start: 1px solid var(--home-border);
}

.home-modern .home-shelf__controls button:disabled {
    opacity: .42;
    cursor: default;
}

.home-modern .home-shelf__controls button:not(:disabled):hover {
    background: var(--home-primary-soft);
}

.home-modern .home-shelf__track {
    --shelf-gap: 9px;
    display: flex;
    align-items: stretch;
    gap: var(--shelf-gap);
    margin: 0;
    padding: 1px 0 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    touch-action: pan-x pan-y pinch-zoom;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--home-primary-medium) transparent;
    list-style: none;
}

@media (any-pointer: fine) {
    .home-modern .home-shelf__track.can-drag,
    .home-modern .home-shelf__track.can-drag .home-shelf__card {
        cursor: grab;
        user-select: none;
    }
}

.home-modern .home-shelf__track.is-dragging {
    scroll-snap-type: none;
    scroll-behavior: auto;
}

.home-modern .home-shelf__track.is-dragging,
.home-modern .home-shelf__track.is-dragging .home-shelf__card {
    cursor: grabbing;
}

.home-modern .home-shelf__item {
    display: flex;
    flex: 0 0 calc((100% - 2 * var(--shelf-gap)) / 3);
    min-width: 0;
    margin: 0;
    padding: 0;
    scroll-snap-align: start;
}

.home-modern .home-product-shelves--single .home-shelf__item {
    flex-basis: calc((100% - 5 * var(--shelf-gap)) / 6);
}

.home-modern .home-shelf__card {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--home-border);
    border-radius: 13px;
    background: var(--home-surface-raised);
    color: var(--home-text);
}

.home-modern .home-shelf__card:hover {
    border-color: var(--home-primary-medium);
}

.home-modern .home-shelf :focus-visible {
    outline: 2px solid var(--home-text);
    outline-offset: -3px;
}

.home-modern .home-shelf__media {
    position: relative;
    display: grid;
    height: clamp(94px, 9vw, 132px);
    place-items: center;
    margin: 6px 6px 0;
    overflow: hidden;
    border-radius: 8px;
    background: var(--home-media);
}

.home-modern .home-shelf__media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 7px;
    object-fit: contain;
}

.home-modern .home-shelf__placeholder {
    color: var(--home-muted);
    font-size: 25px;
}

.home-modern .home-shelf__badge {
    position: absolute;
    top: 6px;
    inset-inline-start: 6px;
    padding: 3px 6px;
    border-radius: 8px;
    background: var(--home-sale-soft);
    color: var(--home-sale-deep);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
}

.home-modern .home-shelf__badge--out {
    background: var(--home-secondary-soft);
    color: var(--home-text);
}

.home-modern .home-shelf__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 5px;
    padding: 8px 10px 10px;
}

.home-modern .home-shelf__title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--home-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
}

.home-modern .home-shelf__prices {
    display: grid;
    gap: 2px;
    margin-top: auto;
    color: var(--home-text);
    text-align: left;
    font-feature-settings: inherit;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.home-modern .home-shelf__prices del {
    color: var(--home-muted);
    font-size: 11px;
    line-height: 1.4;
}

.home-modern .home-shelf__price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
}

.home-modern .home-shelf__price-row strong {
    min-width: 0;
    color: var(--home-text);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
}

.home-modern .home-shelf__price-row small {
    flex: none;
    color: var(--home-muted);
    font-size: 11px;
}

@media (max-width: 991px) {
    .home-modern .home-product-shelves {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .home-modern .home-shelf__item,
    .home-modern .home-product-shelves--single .home-shelf__item {
        flex-basis: calc((100% - 3 * var(--shelf-gap)) / 4);
    }
}

@media (max-width: 575px) {
    .home-modern .home-shelf {
        padding: 10px;
        border-radius: 16px;
    }

    .home-modern .home-shelf__item,
    .home-modern .home-product-shelves--single .home-shelf__item {
        flex-basis: calc((100% - var(--shelf-gap)) / 2);
    }
}
