/* Header Customization */

.header .header-top {
    background-color: #000 !important;
}

.header .header-top .text-white {
    color: #fff !important;
}

.header .header-top a {
    color: #fff !important;
    text-decoration: none;
    font-size: 12px;
}

.header .header-top a:hover {
    color: var(--bs-primary) !important;
}

.header-middle {
    background-color: #fff !important;
    padding: 12px 0 !important;
}

.main-logo {
    height: 55px !important;
    max-width: 180px;
    object-fit: contain;
}

.search-bar-wrap {
    display: flex;
    border: 2px solid #007bff;
    border-radius: 5px;
    overflow: hidden;
    width: 100%;
}

.search-bar-wrap .category-select {
    border: none;
    background-color: #f8f9fa;
    padding: 0 35px 0 15px;
    border-right: 1px solid #ddd;
    font-size: 14px;
    min-width: 150px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.search-box {
    position: relative;
    z-index: 1050;
}

.search-result-box {
    z-index: 9999 !important;
}

.search-bar-wrap input {
    border: none !important;
    padding: 10px 15px !important;
    flex-grow: 1;
    outline: none !important;
}

.search-bar-wrap .search-btn {
    background-color: #007bff !important;
    color: #fff !important;
    border: none !important;
    padding: 0 25px !important;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.2s;
}

.search-bar-wrap .search-btn:hover {
    background-color: #0056b3 !important;
}

[theme="dark"] .search-bar-wrap input::placeholder {
    color: #777 !important;
}

.header-middle .header-tools {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-middle .header-tool-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    text-decoration: none;
}

.header-middle .header-tool-item i {
    font-size: 24px;
    color: #333;
}

.header-middle .header-tool-item .text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header-middle .header-tool-item .label {
    font-size: 11px;
    color: #777;
}

.header-middle .header-tool-item .value {
    font-size: 14px;
    font-weight: 700;
}

.header-main {
    background-color: #fff !important;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.shop-categories-btn {
    background: transparent !important;
    color: #333 !important;
    border: none !important;
    font-weight: 600 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 0 !important;
}

.main-menu li a {
    color: #333 !important;
    font-weight: 600 !important;
    padding: 15px 15px !important;
    text-transform: capitalize !important;
}

.main-menu li a i {
    font-size: 12px;
    margin-left: 5px;
}

.todays-deal-badge {
    background-color: #db3022;
    color: #fff !important;
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    margin-left: 10px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.todays-deal-badge:hover {
    background-color: #c42a1e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Dark Mode Support */
[theme="dark"] .header-middle,
[theme="dark"] .header-main {
    background-color: #0c0c0c !important;
    border-color: #222 !important;
}

[theme="dark"] .header-middle .header-tool-item i,
[theme="dark"] .header-middle .header-tool-item .value,
[theme="dark"] .header-middle .header-tool-item .dropdown-toggle::after {
    color: #fff !important;
}

[theme="dark"] .header-middle .header-tool-item .label {
    color: #aaa !important;
}

[theme="dark"] .search-bar-wrap {
    border-color: #007bff;
}

[theme="dark"] .search-bar-wrap .category-select {
    background-color: #1a1a1a;
    color: #eee;
    border-right-color: #333;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23fff' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}

[theme="dark"] .search-bar-wrap input {
    background-color: #1a1a1a !important;
    color: #fff !important;
}

[theme="dark"] .shop-categories-btn,
[theme="dark"] .main-menu li a {
    color: #eee !important;
}

[theme="dark"] .logo img {
    filter: brightness(1.2) contrast(1.1);
}

[theme="dark"] .header-main {
    border-top-color: #222 !important;
    border-bottom-color: #222 !important;
}

[theme="dark"] .header-tool-item i {
    color: #fff !important;
}

[theme="dark"] .search-card {
    background-color: #1a1a1a !important;
    border-color: #333 !important;
}

[theme="dark"] .search-card a {
    color: #eee !important;
}

[theme="dark"] .search-card a:hover {
    background-color: #222 !important;
}

/* Category Dropdown Improvements */
.dropdown--menu {
    min-width: 250px !important;
    border-radius: 8px !important;
    padding: 10px 0 !important;
}

.dropdown--menu li {
    padding: 0 !important;
}

.dropdown--menu li a {
    padding: 10px 20px !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #444 !important;
    transition: all 0.2s ease;
}

.dropdown--menu li a:hover {
    background-color: #f8f9fa;
    color: var(--bs-primary) !important;
}

.dropdown--menu .sub-menu {
    top: 0 !important;
    left: 100% !important;
    min-width: 280px !important;
    max-height: 500px;
    overflow-y: auto;
    border-radius: 0 8px 8px 0 !important;
    padding: 10px 0 !important;
    box-shadow: 15px 0 30px rgba(0,0,0,0.1) !important;
}

/* Custom Scrollbar for Sub Menu */
.dropdown--menu .sub-menu::-webkit-scrollbar {
    width: 5px;
}

.dropdown--menu .sub-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dropdown--menu .sub-menu::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.dropdown--menu .sub-menu::-webkit-scrollbar-thumb:hover {
    background: #999;
}

[theme="dark"] .dropdown--menu,
[theme="dark"] .dropdown--menu .sub-menu {
    background-color: #1a1a1a !important;
    border-color: #333 !important;
}

[theme="dark"] .dropdown--menu li a {
    color: #eee !important;
}

[theme="dark"] .dropdown--menu li a:hover {
    background-color: #222;
}

/* Flash Deal Improvements */
.amazon-flash-card .progress-bar {
    transition: width 1s ease-in-out;
}

.menu-item-has-children {
    position: relative;
}

/* Product Card Enhancements */
.product {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.product__new-price {
    color: var(--bs-primary) !important;
    font-size: 1.1rem;
}

.hover-bg-primary:hover {
    background-color: var(--bs-primary) !important;
    color: #fff !important;
}

/* Dark Mode Support for Product Cards */
[theme="dark"] .product {
    background-color: #1a1a1a !important;
    border-color: #333 !important;
}

[theme="dark"] .dark-text-white {
    color: rgba(255, 255, 255, 0.9) !important;
}

[theme="dark"] .product__title a {
    color: rgba(255, 255, 255, 0.9) !important;
}

[theme="dark"] .product__title a:hover {
    color: var(--bs-primary) !important;
}

[theme="dark"] .text-muted {
    color: #aaa !important;
}

/* Sidebar Price Slider Fix for Dark Mode */
[theme="dark"] .range-slider {
    background: #333;
}

[theme="dark"] .range-slider .full-range {
    background: #444;
}

[theme="dark"] .form-control {
    background-color: #222 !important;
    border-color: #444 !important;
    color: #fff !important;
}

[theme="dark"] .dark-bg-222 { background-color: #222 !important; }
[theme="dark"] .dark-text-white { color: #fff !important; }
[theme="dark"] .dropdown-menu { background-color: #222 !important; border-color: #444 !important; }
[theme="dark"] .dropdown-item { color: #eee !important; }
[theme="dark"] .dropdown-item:hover { background-color: #333 !important; color: var(--bs-primary) !important; }
.hover-opacity-100:hover { opacity: 1 !important; }
.transition-all { transition: all 0.3s ease; }
.fs-11 { font-size: 11px; }
.fs-10 { font-size: 10px; }
.fs-14 { font-size: 14px; }
.btn-outline-primary:hover { background-color: #007bff !important; color: #fff !important; }
[theme="dark"] .dropdown-menu { background-color: #222 !important; border: 1px solid #444 !important; }
[theme="dark"] .dropdown-item { color: #eee !important; }
[theme="dark"] .dropdown-item:hover { background-color: #333 !important; color: var(--bs-primary) !important; }
[theme="dark"] .text-dark { color: #fff !important; }
[theme="dark"] .breadcrumb-item, [theme="dark"] .breadcrumb-item a { color: #aaa !important; }
[theme="dark"] .breadcrumb-item.active { color: #fff !important; }
[theme="dark"] .bg-white { background-color: #1a1a1a !important; }
[theme="dark"] .border { border-color: #333 !important; }
[theme="dark"] .card { background-color: #1a1a1a !important; border-color: #333 !important; }
[theme="dark"] .form-control { background-color: #222 !important; border-color: #444 !important; color: #fff !important; }
[theme="dark"] .form-control::placeholder { color: #666 !important; }

/* Mobile Header and Drawer Customization (Mockup Match) */

.mobile-search-bar-container {
    transition: all 0.3s ease;
}

.mobile-search-bar-container .search-bar {
    border-radius: 50px !important;
    background-color: #f8f9fa;
    border: 1px solid #ddd !important;
    padding: 2px 10px;
    height: 42px;
}

.mobile-search-bar-container .search-bar input {
    font-size: 14px;
    padding-left: 15px;
    height: 100%;
}

.mobile-search-bar-container .search-bar button {
    padding-right: 15px;
    height: 100%;
}

/* Drawer Layout Styling */
.aside {
    background-color: #fff !important;
    box-shadow: 5px 0 25px rgba(0,0,0,0.15) !important;
    width: 290px !important;
    max-width: 100%;
}

.aside .aside-body,
.aside .aside-body ul,
.aside .aside-body ul li,
.aside .aside-body .aside-menu-list,
.aside .aside-body .aside-menu-item,
.aside .aside-body .sub_menu,
.aside .aside-body .sub_menu li {
    list-style: none !important;
    list-style-type: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.aside-menu-item {
    border-bottom: 1px solid #f0f0f0;
}

.aside-menu-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    font-weight: 700 !important;
    font-size: 15px;
    color: #1a1a1a !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.aside-menu-link:hover, 
.aside-menu-item.active > .aside-menu-link {
    color: var(--bs-primary) !important;
}

.aside-menu-link i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.aside-menu-item.sub-menu-opened > .aside-menu-link i {
    transform: rotate(90deg);
}

.aside-menu-item .sub_menu {
    list-style: none;
    padding-left: 15px;
    background-color: #fcfcfc;
    border-bottom: 1px solid #f0f0f0;
}

.aside-menu-item .sub_menu li {
    border-bottom: 1px solid #f7f7f7;
}

.aside-menu-item .sub_menu li:last-child {
    border-bottom: none;
}

/* Today's Deal Row in Drawer */
.drawer-deals-row {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    background-color: #fff;
}

/* Phone Support Footer in Drawer */
.drawer-phone-footer {
    background-color: #1a1a1a !important;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    margin-top: auto;
    width: 100%;
}

.drawer-phone-footer i {
    font-size: 20px;
    color: #fff;
}

.drawer-phone-footer a {
    color: #ffc107 !important;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none !important;
}

[theme="dark"] .aside {
    background-color: #0c0c0c !important;
}

[theme="dark"] .aside-menu-link {
    color: #eee !important;
    border-bottom-color: #222;
}

[theme="dark"] .aside-menu-item {
    border-bottom-color: #222;
}

[theme="dark"] .aside-menu-item .sub_menu {
    background-color: #151515;
    border-bottom-color: #222;
}

[theme="dark"] .aside-menu-item .sub_menu li {
    border-bottom-color: #222;
}

[theme="dark"] .drawer-deals-row {
    background-color: #0c0c0c !important;
    border-color: #222;
}

/* Spacing corrections to push Helpline and Drawer footer above the bottom mobile app bar */
.aside {
    padding-bottom: 75px !important;
}

/* Neutralize theme's pseudo-element arrows to eliminate double arrows */
.aside .aside-body li.has-sub-item:after,
.aside .aside-body li.has-sub-item::after {
    display: none !important;
    content: "" !important;
}

/* Prevent customer account and cart blocks from shrinking or wrapping on desktop */
.header-main .list-separator {
    flex-shrink: 0 !important;
}

.login-register,
.login-register button,
.login-register .media-body,
#cart_items,
#cart_items a {
    white-space: nowrap !important;
}

/* Optimize spacing for mid-size desktop viewports (1200px to 1400px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .main-menu li a {
        padding: 15px 8px !important;
        font-size: 13px !important;
    }
    
    .todays-deal-badge {
        padding: 5px 10px !important;
        font-size: 12px !important;
        margin-left: 8px !important;
    }
    
    .header-main .container > .d-flex {
        gap: 8px !important;
    }
}

/* Fix header-top and header-middle cutting/overlapping bugs */
.header-top .nav {
    flex-shrink: 0 !important;
}

.header-middle .header-tools {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.header-tool-item {
    flex-shrink: 0 !important;
}

.compare_list_icon_active i {
    color: var(--bs-primary) !important;
}

@media (min-width: 1200px) and (max-width: 1439px) {
    .header-middle .container > .d-flex {
        gap: 10px !important;
    }
    
    .header-middle .search-box {
        margin-left: 1rem !important;
        margin-right: 1rem !important;
    }
    
    .header-tools {
        gap: 12px !important;
    }
    
    .header-middle .header-tool-item {
        gap: 6px !important;
    }
    
    .header-middle .header-tool-item i {
        font-size: 20px !important;
    }
    
    .header-middle .header-tool-item .label {
        font-size: 10px !important;
    }
    
    .header-middle .header-tool-item .value {
        font-size: 12px !important;
    }
    
    .header-top .nav {
        gap: 12px !important;
    }
    
    .main-logo {
        max-width: 130px !important;
        height: 45px !important;
    }
    
    .search-bar-wrap .category-select {
        min-width: 110px !important;
        font-size: 12px !important;
        padding-left: 8px !important;
        padding-right: 25px !important;
    }
    
    .search-bar-wrap input {
        font-size: 12px !important;
        padding: 8px 10px !important;
    }
    
    .search-bar-wrap .search-btn {
        padding: 0 15px !important;
        font-size: 12px !important;
    }
}

/* --- Page-Level and Mobile Header Responsive Layout Fixes --- */

/* Prevent horizontal scrolling page-wide */
html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Fix Drawer menu off-screen overflow and transition path */
.aside {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    transform: translateX(100%) !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s ease !important;
}

.aside.active {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Mobile viewport padding and alignment fixes */
@media (max-width: 1199px) {
    .header-main .container > .d-flex {
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
    }
    
    .d-xl-none.d-flex.align-items-center.justify-content-between.w-100 {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .header-main {
        overflow-x: hidden !important;
    }
}

/* Hide settings sidebar completely */
.settings-sidebar {
    display: none !important;
}

/* Hide scrollbars globally across all elements while maintaining functionality */
::-webkit-scrollbar {
    display: none !important;
}

html, body {
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
}

/* Neutralize theme's pseudo-element arrows to eliminate double arrows in sidebar */
.products_aside_categories li.has-sub-item:after,
.products_aside_categories li.has-sub-item::after {
    display: none !important;
    content: "" !important;
}