/* =========================================================
   COMPREHENSIVE FRONT-PAGE MOBILE RESPONSIVE OPTIMIZATIONS
   ========================================================= */

/* 1. Global Viewport & Container Reset */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    .container, .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
        max-width: 100% !important;
    }
    .__inline-61 {
        gap: 16px !important;
    }
    .section-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin-bottom: 8px !important;
    }
    .section-header h2, .section-header .h2,
    .feature-product-title, .categories-title, .seller-list-title h2,
    .arrival-title, .for-feature-title {
        font-size: 16px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        margin: 0 !important;
    }
    .view-all-btn-text, .view-btn-text {
        font-size: 12px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
    }
}

/* 2. Mobile Header & Search Bar */
.navbar-stuck-toggler {
    display: none !important;
}

@media screen and (max-width: 991px) {
    .topbar {
        padding: 4px 0 !important;
        font-size: 12px !important;
    }
    
    .navbar-sticky.mobile-head {
        position: sticky !important;
        top: 0 !important;
        z-index: 1020 !important;
        background: #ffffff !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
        padding: 4px 0 !important;
        border-bottom: 1px solid #edf2f7 !important;
    }
    
    .mobile-head .navbar {
        padding: 4px 0 !important;
        min-height: 52px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .mobile-head .navbar > .container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    /* Left: Hamburger Button + Logo */
    .mobile-head .d-block.d-md-none {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        margin: 0 !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .mobile-head .navbar-toggler {
        padding: 6px 8px !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
        background: #f8fafc !important;
        font-size: 16px !important;
        line-height: 1 !important;
        color: #1e293b !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
    }
    
    .mobile-head .navbar-toggler-icon {
        width: 18px !important;
        height: 18px !important;
    }
    
    .mobile-head .navbar-brand {
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .mobile-head .navbar-brand img {
        height: 32px !important;
        max-width: 110px !important;
        width: auto !important;
        object-fit: contain !important;
    }
    
    /* Right: Toolbar Icons */
    .mobile-head .navbar-toolbar {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 0 !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
        margin-left: auto !important;
    }
    
    .mobile-head .navbar-toolbar .navbar-tool {
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .mobile-head .navbar-toolbar .navbar-tool-icon-box {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        border-radius: 50% !important;
        background: #f1f5f9 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
        color: #334155 !important;
        transition: all 0.2s ease !important;
    }
    
    .mobile-head .navbar-toolbar .navbar-tool-icon-box i,
    .mobile-head .navbar-toolbar .navbar-tool-icon-box svg {
        font-size: 16px !important;
        width: 16px !important;
        height: 16px !important;
    }
    
    .mobile-head .navbar-toolbar .navbar-tool-label {
        position: absolute !important;
        top: -2px !important;
        right: -4px !important;
        width: 18px !important;
        height: 18px !important;
        border-radius: 50% !important;
        background: var(--web-primary, #0d6efd) !important;
        color: #ffffff !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        line-height: 18px !important;
        text-align: center !important;
        padding: 0 !important;
        border: 1.5px solid #ffffff !important;
    }
    
    /* CRITICAL FIX: Hide search bar by default on mobile */
    .search-form-mobile:not(.active) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: fixed !important;
        top: -200px !important;
    }
    
    /* Search Bar Popup/Overlay when active */
    .search-form-mobile.active {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        width: 100vw !important;
        background: #ffffff !important;
        z-index: 999999 !important;
        padding: 12px 14px !important;
        box-shadow: 0 6px 25px rgba(0,0,0,0.18) !important;
        margin: 0 !important;
    }
    
    .search-form-mobile .search-bar-input {
        height: 42px !important;
        border-radius: 8px !important;
        border: 1.5px solid var(--web-primary, #0d6efd) !important;
        font-size: 14px !important;
        padding: 8px 14px !important;
        background: #f8fafc !important;
    }
    
    .close-search-form-mobile {
        padding: 8px 12px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #64748b !important;
        cursor: pointer !important;
    }
    
    /* Mobile Navigation Drawer */
    #navbarCollapse {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 290px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        background: #ffffff !important;
        z-index: 100000 !important;
        padding: 20px 16px !important;
        box-shadow: 4px 0 25px rgba(0,0,0,0.15) !important;
        overflow-y: auto !important;
    }
    
    #navbarCollapse .tio-clear {
        font-size: 22px !important;
        color: #334155 !important;
    }
    
    #navbarCollapse .nav-item {
        border-bottom: 1px solid #f1f5f9 !important;
        padding: 4px 0 !important;
    }
    
    #navbarCollapse .nav-link {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #1e293b !important;
        padding: 10px 0 !important;
    }
}

/* 3. Top Banner & Hero Slider */
@media (max-width: 768px) {
    .__top-slider-images {
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    .__slide-img, .__slide-img-170 {
        min-height: 140px !important;
        max-height: 200px !important;
        height: auto !important;
        border-radius: 8px !important;
        object-fit: cover !important;
        width: 100% !important;
    }
    .hero-slider .owl-dots {
        position: relative !important;
        bottom: 8px !important;
        margin-top: -24px !important;
        z-index: 5;
    }
    .hero-slider .owl-dot span {
        width: 6px !important;
        height: 6px !important;
        margin: 2px !important;
    }
}

/* 4. Category Slider */
@media (max-width: 768px) {
    .categories--slider .__cate-item {
        padding: 4px !important;
        margin: 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    .categories--slider .__cate-item .__img {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        max-width: 60px !important;
        min-height: 60px !important;
        max-height: 60px !important;
        border-radius: 50% !important;
        overflow: hidden !important;
        background: #f4f6f8 !important;
        border: 1px solid #e9ecef !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 auto !important;
    }
    .categories--slider .__cate-item .__img img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 50% !important;
    }
    .categories--slider .__cate-item h3 {
        font-size: 11px !important;
        line-height: 1.3 !important;
        font-weight: 600 !important;
        text-align: center !important;
        color: #212529 !important;
        margin-top: 6px !important;
        margin-bottom: 0 !important;
        max-width: 72px !important;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;
        overflow: hidden !important;
    }
    .categories--slider .owl-nav {
        display: none !important;
    }
}

/* 5. Deal of the Day & Recommended Product */
@media (max-width: 768px) {
    .deal_of_the_day {
        border-radius: 12px !important;
        padding: 12px !important;
        margin-bottom: 16px !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
    }
    .deal_of_the_day h2 {
        font-size: 15px !important;
        padding: 6px 0 !important;
    }
    .recommended-product-card {
        padding: 8px !important;
    }
    .recommended-product-card .__pt-20 {
        padding-top: 0 !important;
    }
    .recommended-product-card .position-relative {
        width: 100% !important;
        max-width: 220px !important;
        margin: 0 auto !important;
    }
    .recommended-product-card img {
        max-height: 180px !important;
        width: 100% !important;
        object-fit: contain !important;
        border-radius: 8px !important;
    }
    .deal_of_the_day .for-discount-value {
        position: absolute !important;
        top: 6px !important;
        left: 6px !important;
        right: auto !important;
        margin: 0 !important;
        font-size: 11px !important;
        padding: 3px 6px !important;
        border-radius: 4px !important;
        z-index: 2 !important;
    }
    .deal_of_the_day .btn--primary {
        width: 100% !important;
        font-size: 14px !important;
        padding: 8px 16px !important;
        border-radius: 8px !important;
    }
    .latest-product-margin {
        margin-top: 8px !important;
    }
}

/* 6. Flash Deals & Countdown Timer */
@media (max-width: 768px) {
    .__featured-deal-wrap, .flash_deal {
        padding: 12px 8px !important;
        border-radius: 10px !important;
    }
    .featured_deal_title, .flash_deal_title {
        font-size: 16px !important;
        font-weight: 700 !important;
        margin-bottom: 2px !important;
    }
    .cz-countdown {
        gap: 4px !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
    }
    .cz-countdown .cz-countdown-value {
        font-size: 12px !important;
        padding: 3px 6px !important;
        min-width: 28px !important;
        border-radius: 4px !important;
        text-align: center !important;
    }
    .cz-countdown .cz-countdown-label {
        font-size: 9px !important;
        line-height: 1 !important;
    }
    .cz-countdown .cz-countdown-days,
    .cz-countdown .cz-countdown-hours,
    .cz-countdown .cz-countdown-minutes,
    .cz-countdown .cz-countdown-seconds {
        margin: 0 !important;
        border-radius: 4px !important;
        padding: 2px !important;
    }
}

/* 7. Standardized Product Cards across all Carousels and Grids */
@media (max-width: 768px) {
    .product-single-hover,
    .flash_deal_product,
    .__product-card,
    .deal_latest_product .product-card,
    .new_arrival_product_item,
    .feature-product .owl-item,
    .new-arrivals-product .owl-item {
        border-radius: 10px !important;
        overflow: hidden !important;
        background: #ffffff !important;
        border: 1px solid #f0f3f6 !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04) !important;
        margin-bottom: 4px !important;
    }
    
    .product-single-hover .inline_product,
    .flash_deal_product_pic,
    .deal_latest_product .product-card .card-header,
    .new_arrival_product_pic,
    .featured_product_pic {
        height: 140px !important;
        max-height: 140px !important;
        min-height: 140px !important;
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #f9fafb !important;
        overflow: hidden !important;
        padding: 4px !important;
        border-radius: 8px 8px 0 0 !important;
    }
    
    .product-single-hover .inline_product img,
    .flash_deal_product_pic img,
    .deal_latest_product .product-card .card-header img,
    .new_arrival_product_pic img,
    .featured_product_pic img {
        max-height: 130px !important;
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        margin: 0 auto !important;
    }
    
    .single-product-details,
    .flash_deal_product_details,
    .featured_product_details {
        padding: 8px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    
    .single-product-details a.text-capitalize,
    .flash_deal_product_details .flash-product-title a,
    .featured_product-title .ptr,
    .product-title1,
    .flash-product-title a {
        font-size: 12px !important;
        line-height: 1.35 !important;
        height: 32px !important;
        max-height: 32px !important;
        font-weight: 500 !important;
        color: #1a1a1a !important;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin-bottom: 4px !important;
    }
    
    .flash-product-price,
    .featured_product-price .ptp,
    .single-product-details .product-price,
    .text-accent {
        font-size: 13px !important;
        font-weight: 700 !important;
        color: var(--web-primary, #0d6efd) !important;
        margin-top: 0 !important;
    }
    
    .single-product-details del,
    .flash-product-price del,
    .featured_product-price del {
        font-size: 10px !important;
        color: #999 !important;
        margin-right: 4px !important;
    }
    
    .for-discount-value {
        position: absolute !important;
        top: 6px !important;
        left: 6px !important;
        right: auto !important;
        margin: 0 !important;
        font-size: 10px !important;
        padding: 2px 5px !important;
        border-radius: 3px !important;
        z-index: 2 !important;
        line-height: 1.2 !important;
    }
    
    .rating-show {
        font-size: 10px !important;
        margin-bottom: 2px !important;
    }
    .rating-show i {
        font-size: 11px !important;
    }
}

/* 8. Brands Slider */
@media (max-width: 768px) {
    .brand-slider {
        margin-top: 6px !important;
    }
    .__brand-item {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 60px !important;
        padding: 6px 10px !important;
        background: #ffffff !important;
        border: 1px solid #eef2f5 !important;
        border-radius: 8px !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.03) !important;
    }
    .__brand-item img {
        max-height: 42px !important;
        max-width: 80% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        margin: 0 auto !important;
    }
}

/* 9. Top Sellers / Vendor Cards */
@media (max-width: 768px) {
    .others-store-card {
        border-radius: 10px !important;
        overflow: hidden !important;
        border: 1px solid #eef2f5 !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04) !important;
        margin-bottom: 4px !important;
    }
    .other-store-banner {
        height: 75px !important;
    }
    .other-store-logo {
        width: 44px !important;
        height: 44px !important;
        margin-top: -22px !important;
        border: 2px solid #fff !important;
    }
    .others-store-card .info {
        padding-top: 4px !important;
    }
    .others-store-card .info h3,
    .others-store-card .info .h5 {
        font-size: 13px !important;
        font-weight: 600 !important;
        margin-bottom: 2px !important;
    }
    .others-store-card .info-area {
        padding: 6px 8px !important;
    }
    .others-store-card .info-item h5 {
        font-size: 13px !important;
    }
    .others-store-card .info-item p {
        font-size: 10px !important;
    }
}

/* 10. Promotional Banners & Footer Banners */
@media (max-width: 768px) {
    .footer_banner_img {
        max-height: 140px !important;
        height: auto !important;
        border-radius: 8px !important;
        object-fit: cover !important;
        width: 100% !important;
        margin: 4px 0 !important;
    }
    .promotional-banner-slider .owl-dots {
        margin-top: 4px !important;
    }
}

/* 11. Mobile Carousel Navigation Controls */
@media (max-width: 768px) {
    .owl-carousel .owl-nav button.owl-prev,
    .owl-carousel .owl-nav button.owl-next {
        width: 28px !important;
        height: 28px !important;
        font-size: 14px !important;
        line-height: 28px !important;
        border-radius: 50% !important;
        background: rgba(255,255,255,0.9) !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.15) !important;
        color: #333 !important;
    }
    .owl-carousel .owl-dots .owl-dot span {
        width: 6px !important;
        height: 6px !important;
        margin: 2px !important;
    }
}

/* 12. Quick Buy Modal, Sticky Bottom Bar & WhatsApp Button Fixes */
.product-details-sticky {
    z-index: 990 !important;
}

#quickBuyModal,
#quickViewModal,
.modal {
    z-index: 100050 !important;
}

.modal-backdrop {
    z-index: 100040 !important;
}

#quickBuyModal .modal-dialog {
    max-width: 750px;
    margin: 1.25rem auto 3.5rem auto !important;
}

#quickBuyModal .modal-body {
    padding-bottom: 35px !important;
}

#quickBuyModal #quickBuySubmitBtn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    padding: 14px 20px !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35) !important;
    cursor: pointer !important;
}

#quickBuyModal #quickBuySubmitBtn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    transform: translateY(-1px);
}

/* Hide floating elements and sticky bar when modal is open */
body.modal-open .floating-whatsapp-widget,
body.modal-open .product-details-sticky,
body.modal-open .floating-btn-grp,
body.modal-open .wa-widget-send-button {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.floating-whatsapp-widget {
    z-index: 990 !important;
}

/* Floating WhatsApp Button Positioning */
.floating-btn-grp {
    position: fixed !important;
    bottom: 20px !important;
    right: 15px !important;
    z-index: 995 !important;
    transition: bottom 0.3s ease !important;
}

.floating-btn-grp.has-product-details-sticky {
    bottom: 85px !important;
}

@media (max-width: 768px) {
    .floating-btn-grp {
        bottom: 20px !important;
        right: 12px !important;
    }
    .floating-btn-grp.has-product-details-sticky {
        bottom: 80px !important;
    }
    .wa-messenger-svg-whatsapp {
        width: 46px !important;
        height: 46px !important;
    }
    .product-details-sticky {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        border-radius: 16px 16px 0 0 !important;
    }
    .product-details-sticky-bottom {
        gap: 8px !important;
    }
    .product-details-sticky .media h6 {
        font-size: 13px !important;
        max-width: 220px !important;
    }
}

