/* ===================================================================
   Home page - stories / banners / categories / product sections
=================================================================== */

.cw-section-gap { margin-top: 26px; }

/* stories sit right above the banners, no divider needed */
.cw-stories { border-bottom: 0 !important; }

/* ===================== banners ===================== */

.cw-banners { margin-top: 8px; }

.cw-banners__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    padding-inline: 2.5%;
}
.cw-banners__viewport::-webkit-scrollbar { display: none; }
.cw-banners__viewport.is-dragging { scroll-snap-type: none; }

.cw-banners__track { display: flex; gap: 16px; }

.cw-banners__slide {
    flex: 0 0 90%;
    aspect-ratio: 21 / 8;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    scroll-snap-align: center;
    scroll-snap-stop: always;
}
.cw-banners__slide a { display: block; width: 100%; height: 100%; }
.cw-banners__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

.cw-banners__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}
.cw-banners__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: width .2s ease, background .2s ease;
}
.cw-banners__dot.is-active { width: 18px; border-radius: 4px; background: var(--brand); }

@media (min-width: 992px) {
    .cw-banners__slide { aspect-ratio: 21 / 6; }
}

/* ===================== categories ===================== */

.cw-categories__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-inline: 2.5%;
    margin-inline: -2.5%;
}
.cw-categories__viewport::-webkit-scrollbar { display: none; }

.cw-categories__track { display: flex; gap: 18px; width: max-content; }

.cw-category {
    flex: 0 0 auto;
    width: 82px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
.cw-category__cover {
    width: 68px;
    height: 68px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform .2s ease, border-color .2s ease;
}
.cw-category:hover .cw-category__cover { transform: translateY(-3px); border-color: var(--brand); }
.cw-category__cover img { width: 100%; height: 100%; object-fit: cover; }

.cw-category__title {
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.5;
    width: 100%;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(11.5px * 1.5 * 2);
}

@media (min-width: 992px) {
    .cw-categories__viewport { overflow: visible; padding-inline: 0; margin-inline: 0; cursor: default; }
    .cw-categories__track { width: auto; flex-wrap: wrap; gap: 22px 12px; }
    .cw-category { width: calc(10% - 11px); }
    .cw-category__cover { width: 84px; height: 84px; border-radius: 14px; }
    .cw-category__title { font-size: 12.5px; min-height: calc(12.5px * 1.5 * 2); }
}

/* ===================== product sections ===================== */

.cw-products__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.cw-products__title {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.cw-products__icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface);
    border: 1px solid var(--border);
    flex: 0 0 auto;
}
.cw-products__viewall {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--brand);
    flex: 0 0 auto;
}
.cw-products__viewall svg { width: 15px; height: 15px; }

.cw-products__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-inline: 2.5%;
    margin-inline: -2.5%;
    padding-bottom: 4px;
}
.cw-products__viewport::-webkit-scrollbar { display: none; }

.cw-products__track { display: flex; gap: 6px; width: max-content; }

@media (min-width: 992px) {
    .cw-products {
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 18px 20px 20px;
    }
    .cw-products__viewport { padding-inline: 20px; margin-inline: -20px; }
}

/* ---- amazing offer ---- */

.cw-deal__inner {
    background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
    border-radius: var(--radius-md);
    padding: 18px 16px 20px;
    position: relative;
    overflow: hidden;
}

.cw-deal__head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.cw-deal__title { font-size: 17px; font-weight: 800; color: #fff; margin: 0; }
.cw-deal__subtitle { font-size: 11.5px; color: rgba(255, 255, 255, .75); margin: 3px 0 0; }
.cw-deal__viewall {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    flex: 0 0 auto;
}
.cw-deal__viewall svg { width: 14px; height: 14px; }

.cw-deal .cw-products__viewport { padding-inline: 16px; margin-inline: -16px; }
.cw-deal .cw-card { border-color: transparent; }

/* ---- best sellers ---- */

.cw-bestsellers__inner {
    background: linear-gradient(160deg, #6DB929 0%, #5AA01F 100%);
    border-radius: var(--radius-md);
    padding: 18px 16px 20px;
    position: relative;
    overflow: hidden;
}

.cw-bestsellers__head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.cw-bestsellers__title { font-size: 17px; font-weight: 800; color: #fff; margin: 0; }
.cw-bestsellers__subtitle { font-size: 11.5px; color: rgba(255, 255, 255, .85); margin: 3px 0 0; }
.cw-bestsellers__viewall {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, .18);
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    flex: 0 0 auto;
}
.cw-bestsellers__viewall svg { width: 14px; height: 14px; }

.cw-bestsellers .cw-products__viewport { padding-inline: 16px; margin-inline: -16px; }
.cw-bestsellers .cw-card { border-color: transparent; }

/* Desktop banner carousel: make mouse dragging feel like the native mobile swipe. */
@media (min-width: 992px) {
    .cw-banners__viewport {
        cursor: grab;
        user-select: none;
        touch-action: pan-y;
        overscroll-behavior-x: contain;
    }
    .cw-banners__viewport.is-dragging {
        cursor: grabbing;
    }
    .cw-banners__viewport.is-dragging .cw-banners__slide {
        pointer-events: none;
    }
}
