/* ============================================
   Bigger eCommerce — Home Page
   ============================================ */

.be-home-wrapper {
    width: 100%;
    max-width: var(--be-container, 1370px);
    margin: 0 auto;
    padding: 0 12px;
    font-family: var(--be-font);
    color: var(--be-text);
    box-sizing: border-box;
}
.be-home-wrapper *,
.be-home-wrapper *::before,
.be-home-wrapper *::after {
    box-sizing: border-box;
}

/* ===== Top Section ===== */
.be-top-section {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: stretch;
}

/* ===== Products Banner (Shangji) — top section mode ===== */
.be-top-section.be-top-section--products {
    margin-bottom: 0 !important;
    gap: 0 !important;
    height: 500px;
    min-height: auto !important;
    padding: 0 !important;
}

.be-top-section.be-top-section--products > * {
    height: 100% !important;
    margin: 0 !important;
}

.be-subbanners {
    gap: 0 !important;
}

/* ===== Category Sidebar ===== */
.be-sidebar {
    width: 200px;
    flex: 0 0 200px;
    max-width: 200px;
    background: var(--be-bg-white);
    border-radius: var(--be-radius);
    overflow: visible;
    border: 1px solid var(--be-border-light);
    position: relative;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-self: stretch;
}
.be-sidebar__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--be-brand);
    border-radius: var(--be-radius) var(--be-radius) 0 0;
}
.be-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    flex: 1;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
}
.be-sidebar__item {
    position: relative;
}
.be-sidebar__item > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    font-size: 14px;
    color: var(--be-text);
    text-decoration: none;
    transition: background var(--be-transition-fast), color var(--be-transition-fast);
}
.be-sidebar__item > a:hover {
    background: var(--be-brand-light);
    color: var(--be-brand);
}
.be-sidebar__item-arrow {
    color: var(--be-text-muted);
    font-size: 18px;
}

/* ===== Mega Menu ===== */
.be-megamenu {
    display: none;
    position: fixed;
    min-width: 380px;
    max-width: 90vw;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: var(--be-bg-white);
    border: 1px solid var(--be-border);
    border-radius: var(--be-radius-lg);
    box-shadow: 4px 4px 32px rgba(0,0,0,0.18);
    padding: 20px;
    z-index: 99999;
}
.be-megamenu.is-open {
    display: block;
}
.be-megamenu__inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.be-megamenu__title {
    font-size: 16px;
    font-weight: 800;
    color: var(--be-text);
    margin: 0 0 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--be-brand);
}
.be-megamenu__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.be-megamenu__item a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    font-size: 13px;
    color: var(--be-text-secondary);
    text-decoration: none;
    border-radius: var(--be-radius-sm);
    transition: background var(--be-transition-fast), color var(--be-transition-fast);
}
.be-megamenu__item a:hover {
    background: var(--be-brand-light);
    color: var(--be-brand);
}
.be-megamenu__count {
    font-size: 11px;
    color: var(--be-text-muted);
}
.be-megamenu__viewall {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--be-brand);
    text-decoration: none;
}

/* ===== Banner Carousel ===== */
.be-banner {
    flex: 1;
    position: relative;
    border-radius: var(--be-radius);
    overflow: hidden;
    background: var(--be-bg-white);
    box-shadow: var(--be-shadow);
    min-height: var(--home-banner-height, 360px);
}
.be-banner__track {
    display: flex;
    transition: transform 0.5s ease;
    height: var(--home-banner-height, 360px);
}
.be-banner__slide {
    flex: 0 0 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    position: absolute;
    inset: 0;
}
.be-banner__slide.active {
    opacity: 1;
    position: relative;
}
.be-banner__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.be-banner__slide--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}
.be-banner__placeholder {
    text-align: center;
    color: var(--be-text-muted);
}
.be-banner__placeholder svg {
    margin: 0 auto 12px;
}
.be-banner__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    color: var(--be-text);
    cursor: pointer;
    transition: background var(--be-transition);
    z-index: 5;
}
.be-banner__nav:hover {
    background: rgba(255,255,255,0.95);
}
.be-banner__prev {
    inset-inline-start: 12px;
}
.be-banner__next {
    inset-inline-end: 12px;
}
.be-banner__dots {
    position: absolute;
    bottom: 12px;
    inset-inline-start: 50%;
    transform: translateX(50%);
    display: flex;
    gap: 6px;
    z-index: 5;
}
.be-banner__dot {
    width: 10px;
    height: 10px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background var(--be-transition);
}
.be-banner__dot.active {
    background: var(--be-brand);
}

/* ===== Shangji (Products Banner) ===== */
.be-top-section--products .be-shangji {
    flex: 1;
}
.be-shangji {
    display: block;
    width: 100%;
    max-width: 922px;
    background-color: #ffffff;
    border-radius: var(--be-radius);
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    font-family: var(--be-font);
    border: 1px solid var(--be-border-light);
    box-shadow: var(--be-shadow);
}
.be-shangji__head {
    display: block;
    padding: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--be-text);
    border-bottom: 1px solid var(--be-border-light);
    box-sizing: border-box;
}
.be-shangji__head-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    text-decoration: none;
}
.be-shangji__head-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--be-text);
}
.be-shangji__head-more {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--be-brand);
}
.be-shangji__container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    box-sizing: border-box;
}
.be-shangji__card {
    display: flex;
    flex-direction: column;
    background-color: var(--be-bg-gray);
    border-radius: var(--be-radius);
    overflow: hidden;
    min-height: 188px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
}
.be-shangji__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #e4e7ed;
}
.be-shangji__card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    text-decoration: none;
    border-bottom: 1px solid var(--be-border-light);
}
.be-shangji__card-icon {
    color: var(--be-brand);
    display: flex;
}
.be-shangji__card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--be-text);
}
.be-shangji__list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 8px;
}

/* ===== Sub-banners ===== */
.be-subbanners {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 200px;
}
.be-subbanner {
    flex: 1;
    border-radius: var(--be-radius);
    overflow: hidden;
    box-shadow: var(--be-shadow);
}
.be-subbanner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== User Card ===== */
.be-usercard {
    width: 320px;
    flex: 0 0 320px;
    height: 362px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(180deg, #fce5c7, #fff4e9 23%, rgba(253,245,236,0) 33%), linear-gradient(180deg, var(--be-brand-light), #fffdfc);
    border-radius: var(--be-radius);
    box-sizing: border-box;
    position: relative;
    box-shadow: var(--be-shadow);
}
.be-usercard__head {
    padding: 20px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.be-usercard__greeting {
    display: flex;
    align-items: center;
}
.be-usercard__greeting a {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
}
.be-usercard__assets {
    display: flex;
    align-items: center;
    gap: 12px;
}
.be-usercard__assets a {
    font-size: 13px;
    color: #1a1a1a;
    text-decoration: none;
}
.be-usercard__shortcuts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}
.be-usercard__shortcuts a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #333;
    text-decoration: none;
    padding: 8px 0;
    border-radius: var(--be-radius);
}
.be-usercard__shortcuts svg {
    width: 22px;
    height: 22px;
    stroke: #1a1a1a;
    fill: none;
    stroke-width: 2;
}
.be-usercard__guide {
    background: #fff;
    border-radius: var(--be-radius);
    padding: 16px;
    margin: 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.be-usercard__slogan {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
}
.be-usercard__features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.be-usercard__feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
}
.be-usercard__feature svg {
    width: 16px;
    height: 16px;
    stroke: var(--be-brand);
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}
.be-usercard__login {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    background: linear-gradient(90deg, #ff7a18 0%, var(--be-brand) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--be-radius-pill);
    text-decoration: none;
}

/* ===== بطاقة كوبون الترحيب ===== */
.be-wcoupon {
    transform: scale(0.8);
    transform-origin: center center;
    margin: 0px auto;
}
.be-wcoupon__inner {
    display: flex;
    align-items: stretch;
    gap: 10px;
    background: linear-gradient(135deg, var(--be-brand-light) 0%, #fff7ed 100%);
    border: 1.5px dashed var(--be-brand);
    border-radius: var(--be-radius);
    padding: 12px;
    position: relative;
    overflow: hidden;
}
.be-wcoupon__inner::before,
.be-wcoupon__inner::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--be-bg-white, #fff);
    border: 1.5px solid var(--be-brand);
    border-radius: 50%;
}
.be-wcoupon__inner::before { top: 50%; inset-inline-start: -8px; transform: translateY(-50%); }
.be-wcoupon__inner::after { top: 50%; inset-inline-end: -8px; transform: translateY(-50%); }
.be-wcoupon__icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--be-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}
.be-wcoupon__body {
    flex: 1;
    min-width: 0;
}
.be-wcoupon__desc {
    font-size: 12px;
    color: var(--be-text-secondary);
    margin: 0 0 8px;
    line-height: 1.5;
}
.be-wcoupon__code-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.be-wcoupon__code {
    flex: 1;
    display: inline-block;
    background: #fff;
    border: 1px dashed var(--be-brand);
    border-radius: var(--be-radius-sm);
    padding: 5px 10px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 13px;
    color: var(--be-brand);
    text-align: center;
    letter-spacing: 1px;
    user-select: all;
}
.be-wcoupon__copy {
    flex-shrink: 0;
    background: var(--be-bg-white, #fff);
    border: 1px solid var(--be-border);
    border-radius: var(--be-radius-sm);
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--be-text-secondary);
    cursor: pointer;
    transition: all var(--be-transition-fast);
}
.be-wcoupon__copy:hover {
    border-color: var(--be-brand);
    color: var(--be-brand);
}
.be-wcoupon__copy.is-copied {
    background: var(--be-success, #00a32a);
    border-color: var(--be-success, #00a32a);
    color: #fff;
}
.be-wcoupon__btn {
    display: block;
    text-align: center;
    background: var(--be-brand);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px;
    border-radius: var(--be-radius-sm);
    text-decoration: none;
    transition: background var(--be-transition-fast);
}
.be-wcoupon__btn:hover {
    background: var(--be-brand-deep, var(--be-brand));
}

/* ===== وضع الصورة القابلة للنقر ===== */
.be-wcoupon__img-wrap {
    display: block;
    border-radius: var(--be-radius);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 1.5px solid var(--be-border);
    transition: border-color var(--be-transition-fast), box-shadow var(--be-transition-fast);
}
.be-wcoupon__img-wrap:hover {
    border-color: var(--be-brand);
    box-shadow: var(--be-shadow);
}
.be-wcoupon__img-wrap img {
    display: block;
    width: 100%;
    height: auto;
}
.be-wcoupon__img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 91, 0, 0);
    transition: background var(--be-transition-fast);
    pointer-events: none;
}
.be-wcoupon__img-wrap:hover::after {
    background: rgba(255, 91, 0, 0.08);
}
.be-wcoupon__img-wrap.is-copying::after {
    background: rgba(0, 163, 42, 0.15);
}
.be-wcoupon__img-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--be-success, #00a32a);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--be-radius-pill);
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    transition: opacity var(--be-transition-fast);
    pointer-events: none;
    z-index: 2;
}
.be-wcoupon__img-wrap.is-copying .be-wcoupon__img-toast {
    opacity: 1;
}

/* ===== Category Grid ===== */
.be-catgrid__count {
    font-size: 11px;
    color: var(--be-text-muted);
}

/* ===== Doors ===== */
.be-doors {
    width: 100%;
    height: 64px;
    display: flex;
    overflow: hidden;
    margin-bottom: 12px;
    border-radius: var(--be-radius);
    background: var(--be-bg-white);
    box-shadow: var(--be-shadow-sm);
}
.be-doors__scroll {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}
.be-doors__scroll::-webkit-scrollbar {
    display: none;
}
.be-doors__item {
    flex: 0 0 auto;
    min-width: 212px;
}
.be-doors__item--divided {
    border-inline-start: 1px solid var(--be-border-light);
}
.be-doors__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 16px;
    height: 64px;
    text-decoration: none;
}
.be-doors__left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.be-doors__title {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.be-doors__subtitle {
    font-size: 12px;
    color: var(--be-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.be-doors__right {
    flex-shrink: 0;
}
.be-doors__right img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--be-radius);
}

/* ===== Home Promo Banner ===== */
.be-home-promo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: var(--be-radius);
}
.be-home-promo__icon {
    display: flex;
    align-items: center;
    color: var(--be-brand);
}
.be-home-promo__text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--be-text);
}
.be-home-promo__link {
    font-size: 13px;
    font-weight: 700;
    color: var(--be-brand);
    text-decoration: none;
    white-space: nowrap;
}

/* ===== Sections ===== */
.be-section {
    margin-bottom: 12px;
    background: var(--be-bg-white);
    border-radius: var(--be-radius-lg);
    padding: 16px;
    box-shadow: var(--be-shadow-sm);
}
.be-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.be-section__title {
    font-size: 18px;
    font-weight: 800;
    color: var(--be-text);
    margin: 0;
}
.be-section__more {
    font-size: 13px;
    font-weight: 600;
    color: var(--be-brand);
    text-decoration: none;
}

/* ===== Products Grid ===== */
.be-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

/* ===== Recommend Section ===== */
.be-reco {
    margin-bottom: 12px;
    background: var(--be-bg-white);
    border-radius: var(--be-radius-lg);
    box-shadow: var(--be-shadow-sm);
    overflow: hidden;
}
.be-reco__catwrap {
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--be-border-light);
}
.be-reco__catscroll {
    display: flex;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    height: 48px;
}
.be-reco__catscroll::-webkit-scrollbar {
    display: none;
}
.be-reco__catscroll.grabbing {
    cursor: grabbing;
    user-select: none;
}
.be-reco__catitem {
    flex: 0 0 auto;
    padding: 0 16px;
    height: 48px;
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--be-text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--be-transition), border-color var(--be-transition);
    border-bottom: 3px solid transparent;
}
.be-reco__catitem:hover {
    color: var(--be-brand);
}
.be-reco__catitem.is-active {
    color: var(--be-brand);
    font-weight: 700;
    border-bottom-color: var(--be-brand);
}
.be-reco__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 48px;
    background: linear-gradient(to right, transparent, var(--be-bg-white) 40%);
    color: var(--be-text);
    cursor: pointer;
    z-index: 5;
    position: absolute;
    top: 0;
}
.be-reco__arrow--right {
    right: 0;
    justify-content: flex-end;
    padding-right: 8px;
}
.be-reco__arrow--left {
    left: 0;
    justify-content: flex-start;
    padding-left: 8px;
    background: linear-gradient(to left, transparent, var(--be-bg-white) 40%);
}
.be-reco__body {
    padding: 16px;
    min-height: 200px;
    position: relative;
}
.be-reco__grid {
    display: grid;
    gap: 12px;
}
.be-reco__loading-text {
    text-align: center;
    padding: 16px 0;
    color: var(--be-text-muted);
    font-size: 14px;
}

/* ===== Services Bar ===== */
.be-services-bar {
    background: var(--be-bg-white);
    border-radius: var(--be-radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--be-shadow-sm);
}
.be-services-bar__inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.be-services-bar__item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--be-text);
    font-size: 14px;
    font-weight: 600;
}
.be-services-bar__item svg {
    color: var(--be-brand);
    flex-shrink: 0;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .be-sidebar {
        display: none;
    }
    .be-subbanners {
        display: none;
    }
}
@media (max-width: 768px) {
    .be-home-wrapper {
        padding: 0 8px;
    }
    .be-top-section {
        flex-direction: column;
    }
    .be-top-section--products {
        display: none !important;
    }
    .be-top-section--products .be-shangji {
        display: none;
    }
    .be-usercard {
        width: 100%;
        flex: 0 0 auto;
        height: auto;
    }
    .be-shangji__container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .be-shangji__list {
        grid-template-columns: repeat(2, 1fr);
    }
    .be-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .be-reco__grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }
    .be-section__title {
        font-size: 16px;
    }
    .be-services-bar__inner {
        gap: 12px;
    }
    .be-services-bar__item {
        font-size: 12px;
    }
}

/* Mobile 480px */
@media (max-width: 480px) {
    .be-shangji__container {
        grid-template-columns: 1fr;
    }
}
