/* ========================================
   MOBILE & RESPONSIVE IMPROVEMENTS
   ======================================== */

/* Remove gap between slider and categories */
.slider-section {
    padding: 15px 0 0 0 !important;
    margin: 0 0 0 0 !important;
}

/* Remove bottom padding/margin from slider section */
.slider-section .container,
.slider-section .row {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Reduce gap for homeproduct section */
.homeproduct {
    margin-top: 0 !important;
    padding-top: 15px !important;
}

/* Remove margin-bottom from sec_title only in homeproduct (Categories) section */
.homeproduct .sec_title {
    margin-bottom: 0 !important;
}

/* Mobile Header Improvements */
.mobile-header {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
}

.mobile-header .menu-bag {
    position: relative;
}

.mobile-header .menu-bag .margin-shopping {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(105, 11, 186, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.mobile-header .menu-bag .margin-shopping:hover {
    background: rgba(105, 11, 186, 0.2);
}

.mobile-header .menu-bag .margin-shopping i {
    font-size: 20px;
    color: #690BBA;
}

.mobile-header .menu-bag .margin-shopping span {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #690BBA;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Mobile Search Improvements */
.mobile-header .main-search.mobile-search {
    margin: 10px 0 0 0;
    padding: 0 15px;
    position: relative;
    z-index: 999999 !important;
}

.mobile-header .main-search.mobile-search form {
    border: 2px solid #690BBA;
    height: 44px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(105, 11, 186, 0.1);
}

.mobile-header .main-search.mobile-search form:focus-within {
    box-shadow: 0 4px 12px rgba(105, 11, 186, 0.2);
}

/* Critical: Mobile search results must appear above everything */
.mobile-header .main-search.mobile-search .search_result {
    position: relative !important;
    z-index: 999999 !important;
}

.mobile-header .main-search.mobile-search .search_product {
    position: absolute !important;
    z-index: 999999 !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    top: 5px !important;
    width: 100% !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    max-height: 400px !important;
    overflow-y: auto !important;
}

/* Mobile Menu Improvements */
.mobile-menu {
    background: #ffffff;
}

.mobile-menu-logo {
    padding: 20px 20px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-close {
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    color: #690BBA;
}

/* Fix Slider Container */
.home-slider-container {
    margin: 0 !important;
    padding: 0 !important;
}

.main_slider {
    margin: 0 !important;
}

.main_slider .slider-item {
    margin: 0 !important;
}

.main_slider .slider-item img {
    width: 100%;
    border-radius: 8px;
}

/* Category Section Spacing */
.category-section {
    margin-top: 20px !important;
    padding-top: 0 !important;
}

/* Hot Deal Section Spacing */
.hot-deal-section,
.section {
    margin-top: 20px !important;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .slider-section {
        padding: 10px 0 0 0 !important;
    }

    .slider-section .container {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    /* Reduce gaps on mobile */
    .slider-section {
        padding: 5px 0 0 0 !important;
        margin-bottom: 0 !important;
    }

    .slider-section .container,
    .slider-section .row {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .homeproduct {
        margin-top: 0 !important;
        padding-top: 10px !important;
    }

    .category-section,
    .hot-deal-section,
    .section {
        margin-top: 10px !important;
        padding-top: 0 !important;
    }

    /* Mobile header spacing */
    .mobile-header {
        padding: 8px 0;
    }

    .mobile-header .menu-logo img {
        max-height: 50px;
    }

    /* Mobile search */
    .mobile-header .main-search.mobile-search {
        margin: 8px 0 0 0;
    }

    .mobile-header .main-search.mobile-search form {
        height: 42px;
    }
}

@media (max-width: 576px) {
    /* Further reduce gaps on small mobile */
    .slider-section {
        padding: 0 !important;
        margin: 0 !important;
    }

    .slider-section .container,
    .slider-section .row {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .homeproduct {
        margin-top: 0 !important;
        padding-top: 8px !important;
    }

    .category-section,
    .hot-deal-section,
    .section {
        margin-top: 8px !important;
        padding-top: 0 !important;
    }

    /* Mobile cart button */
    .mobile-header .menu-bag .margin-shopping {
        width: 36px;
        height: 36px;
    }

    .mobile-header .menu-bag .margin-shopping i {
        font-size: 18px;
    }

    .mobile-header .menu-bag .margin-shopping span {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    /* Mobile search */
    .mobile-header .main-search.mobile-search form {
        height: 40px;
    }

    .mobile-header .menu-logo img {
        max-height: 45px;
    }
}

/* Offcanvas Cart Trigger */
.menu-bag {
    cursor: pointer;
}

.menu-bag .margin-shopping {
    transition: all 0.3s ease;
}

.menu-bag:active .margin-shopping {
    transform: scale(0.95);
}
