/* ==========================================================================
   Storefront Modern Enhancement Layer (Theme Aster - 2026 Edition)
   Ultra-Fast, Fully Responsive, Modern UI/UX (AliExpress / Salla Style)
   ========================================================================== */

/* ---------- Typography & Base Variables ---------- */
html[dir="rtl"] {
    --bs-body-font-family: "Tajawal", "Mulish", system-ui, -apple-system, sans-serif;
    --title-font: "Tajawal", "Mulish", system-ui, -apple-system, sans-serif;
}
html[dir="rtl"] body {
    font-family: var(--bs-body-font-family);
    letter-spacing: -0.2px;
}
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
    background-color: #f8fafc;
}

/* Custom scrollbar hidden helper */
.custom-scrollbar-hidden {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.custom-scrollbar-hidden::-webkit-scrollbar {
    display: none;
}

/* ---------- 1. Quick Categories Bar (Stories / Pills Style) ---------- */
.quick-categories-section .quick-categories-wrapper {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 4px 20px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.section-quick-title {
    font-size: clamp(1rem, 0.9rem + 0.4vw, 1.25rem);
    font-weight: 800;
    color: #1e293b;
}
.category-icon-pulse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-radius: 8px;
}
.btn-link-modern {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--bs-primary);
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(var(--bs-primary-rgb), 0.08);
    transition: all 0.25s ease;
}
.btn-link-modern:hover {
    background: var(--bs-primary);
    color: #ffffff;
}
.quick-categories-scroll {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
.quick-category-pill {
    flex: 0 0 84px;
    scroll-snap-align: start;
    padding: 8px 4px;
    border-radius: 14px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease;
}
@media (min-width: 768px) {
    .quick-category-pill {
        flex: 1 1 0;
        max-width: 115px;
    }
}
.quick-category-pill:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.04);
    transform: translateY(-4px);
}
.quick-category-icon-box {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 2px solid #ffffff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.quick-category-pill:hover .quick-category-icon-box {
    transform: scale(1.08);
    box-shadow: 0 8px 18px -4px rgba(var(--bs-primary-rgb), 0.25);
    border-color: var(--bs-primary);
}
.quick-category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    transition: transform 0.3s ease;
}
.quick-category-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.3;
    padding: 0 2px;
    transition: color 0.2s ease;
}
.quick-category-pill:hover .quick-category-name {
    color: var(--bs-primary);
}

/* ---------- 2. Trust Features Strip ---------- */
.trust-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
@media (max-width: 991px) {
    .trust-features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}
@media (max-width: 575px) {
    .trust-features-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 6px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .trust-features-grid::-webkit-scrollbar {
        display: none;
    }
    .trust-feature-card {
        flex: 0 0 240px;
        scroll-snap-align: start;
    }
}
.trust-feature-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.trust-feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.08);
}
.trust-icon-box {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
}
.trust-title {
    color: #1e293b;
}

/* ---------- 3. Modern Banner & Desktop Sidebar (AliExpress Style) ---------- */
.home-v2 .banner .card {
    border-radius: 20px;
    box-shadow: 0 6px 24px -8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.home-v2 .banner .dropdown-menu--static {
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    padding: 0.5rem 0;
}
.home-v2 .banner .dropdown-menu--static > li > a {
    padding: 0.65rem 1rem;
    font-weight: 600;
    color: #334155;
    border-radius: 8px;
    margin: 2px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.home-v2 .banner .dropdown-menu--static > li > a:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.08);
    color: var(--bs-primary);
    transform: translateX(-3px);
}
[dir="ltr"] .home-v2 .banner .dropdown-menu--static > li > a:hover {
    transform: translateX(3px);
}
.home-v2 .banner .sub-menu {
    border-radius: 16px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: blur(8px);
    background: #ffffff !important;
    padding: 0.75rem !important;
    min-width: 240px;
}

/* Hero Carousel */
.home-v2 .banner .swiper-container,
.home-v2 .banner .swiper,
.home-v2 .banner .swiper-slide img {
    border-radius: 18px !important;
}
.home-v2 .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.7);
    opacity: 0.7;
}
.home-v2 .swiper-pagination-bullet-active {
    width: 24px !important;
    border-radius: 10px !important;
    background: var(--bs-primary) !important;
    opacity: 1;
}

/* ---------- 4. Product Cards (Modern Minimalist Luxury) ---------- */
.product,
.store-product,
.slide-shadow {
    border-radius: 16px !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: #ffffff;
}
.slide-shadow:hover,
.product:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 32px -8px rgba(0, 0, 0, 0.12) !important;
    border-color: rgba(var(--bs-primary-rgb), 0.2) !important;
}
.store-product__top,
.product__top {
    border-radius: 14px !important;
    overflow: hidden;
    background: #f8fafc;
}
.store-product__top img,
.product__top img {
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.store-product:hover .store-product__top img,
.product:hover .product__top img {
    transform: scale(1.06);
}

/* Modern Discount Badges */
.discount-badge {
    background: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 0.75rem !important;
    padding: 3px 8px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px -2px rgba(239, 68, 68, 0.45) !important;
    letter-spacing: 0.2px;
}

/* Prices */
.product__new-price {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: var(--bs-primary) !important;
}
.product__old-price {
    font-size: 0.85rem !important;
    opacity: 0.55;
    margin-inline-start: 4px;
}

/* Quick Action Floating Buttons */
.store-product__action,
.product__actions a {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    color: #334155 !important;
}
.store-product__action:hover,
.product__actions a:hover {
    background: var(--bs-primary) !important;
    color: #ffffff !important;
    transform: scale(1.12);
}

/* ---------- 5. Mobile App Bar (Floating Dock Style) ---------- */
@media (max-width: 991px) {
    .app-bar,
    ul.list-unstyled.d-flex.justify-content-around.gap-3.mb-0.position-relative.bg-white.shadow-lg {
        background: rgba(255, 255, 255, 0.92) !important;
        backdrop-filter: blur(16px) saturate(180%);
        -webkit-backdrop-filter: blur(16px) saturate(180%);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05) !important;
    }
    .app-bar a.active {
        color: var(--bs-primary) !important;
    }
    .app-bar a.active svg path {
        fill: var(--bs-primary) !important;
    }
}

/* ---------- 6. Search Bar Enhancements ---------- */
.search-box .select-wrap {
    border-radius: 50px !important;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.2) !important;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.search-box .select-wrap:focus-within {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 4px 20px rgba(var(--bs-primary-rgb), 0.15);
}
.search-box button[type="submit"] {
    border-radius: 50px !important;
    padding: 0 24px;
    font-weight: 700;
}
.search-bar-input-mobile {
    border-radius: 50px !important;
    padding: 10px 18px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    background: #f8fafc !important;
}

/* ---------- 7. Fix Mobile Aside Sidebar & Nested Sub-Menus ---------- */
/* Hide aside completely when not active so submenus never spill over */
.aside:not(.active) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

[dir="rtl"] .aside {
    inset-inline-start: 0;
    right: auto !important;
    left: 0 !important;
    transform: translateX(-100%) !important;
}

[dir="rtl"] .aside.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateX(0) !important;
}

/* Ensure sub-menus in mobile aside accordion stay hidden until parent is opened */
.aside-body .nav ul.sub_menu,
.aside-body .nav .sub_menu {
    display: none;
    list-style: none !important;
    padding-inline-start: 1rem !important;
}

.aside-body .nav li.has-sub-item.sub-menu-opened > ul.sub_menu,
.aside-body .nav li.has-sub-item.sub-menu-opened > .sub_menu {
    display: block;
}

.aside-body .nav li {
    list-style: none !important;
}

/* Ensure desktop static category dropdown keeps sub-menus hidden until hovered */
.home-v2 .banner .dropdown-menu--static li ul,
.dropdown-menu--static li ul {
    display: none;
}
.home-v2 .banner .dropdown-menu--static li:hover > ul,
.dropdown-menu--static li:hover > ul {
    display: block;
}

