/* 通用橫向滾動商品區塊（本週最夯 / 即將售罄 等） */

/* 兩塊上下堆疊：與左側 banner 等高、平均分配 */
.hscroll-stack {
    gap: 12px;
    min-height: 0;
}

.hscroll-stack > * {
    flex: 1 1 0;
    min-height: 0;
}

.hscroll-container {
    background: linear-gradient(135deg, #d71804 0%, #d16708 100%);
    border-radius: 12px;
    padding: 8px 10px 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hscroll-container.almost-sold-out-container {
    background: linear-gradient(135deg, #2c2c2c 0%, #5a5a5a 100%);
}

.hscroll-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    padding: 0 2px;
    flex: 0 0 auto;
}

.hscroll-title {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    flex: 1;
}

.hscroll-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

.hscroll-wrapper.dragging {
    cursor: grabbing;
}

.hscroll-track {
    display: flex;
    gap: 8px;
    height: 100%;
    align-items: stretch;
    will-change: transform;
    user-select: none;
}

/* 圖片以「高度」決定大小，aspect-ratio 1 → 寬度自動 = 高度 → 完美正方形 */
.hscroll-item {
    flex: 0 0 auto;
    height: 100%;
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

.hscroll-item a {
    display: block;
    height: 100%;
    width: 100%;
    text-decoration: none;
}

.hscroll-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    pointer-events: none;
    display: block;
}

.hscroll-empty {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
}

@media (max-width: 991px) {
    /* 手機版恢復為固定高度的橫排（不需與左側等高） */
    .hscroll-stack {
        flex: none !important;
    }
    .hscroll-stack > * {
        flex: none !important;
    }
    .hscroll-container {
        height: 150px;
        margin-bottom: 12px;
    }
    .hscroll-title {
        font-size: 13px;
    }
}
