/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 99998;
    padding: 8px 0;
}

.mobile-bottom-nav .nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    text-align: center;
    position: relative;
}

.mobile-bottom-nav .nav-item a,
.mobile-bottom-nav .nav-item button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-size: 11px;
    padding: 5px;
    border: none;
    background: none;
    width: 100%;
    transition: color 0.3s;
}

.mobile-bottom-nav .nav-item a:hover,
.mobile-bottom-nav .nav-item button:hover,
.mobile-bottom-nav .nav-item a.active,
.mobile-bottom-nav .nav-item button.active {
    color: #309293;
}

.mobile-bottom-nav .nav-item i {
    font-size: 22px;
    margin-bottom: 3px;
}

.mobile-bottom-nav .nav-item .badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(50%);
    background: #dc3545;
    color: #fff;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Drawer Menu */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    z-index: 999998;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.mobile-drawer.open {
    left: 0;
}

.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999997;
    display: none;
}

.mobile-drawer-overlay.show {
    display: block;
}

.drawer-header {
    padding: 20px;
    background: linear-gradient(135deg, #309293  0%, #73cccd 100%);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header .user-info {
    flex: 1;
}

.drawer-header .user-info h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.drawer-header .user-info p {
    margin: 5px 0 0;
    font-size: 13px;
    opacity: 0.9;
}

.drawer-header .close-drawer {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
}

.drawer-menu {
    padding: 0;
    margin: 0;
    list-style: none;
}

.drawer-menu li {
    border-bottom: 1px solid #f0f0f0;
}

.drawer-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
}

.drawer-menu li a:hover {
    background: #f8f9fa;
}

.drawer-menu li a i {
    font-size: 20px;
    margin-right: 15px;
    width: 25px;
    color: #667eea;
}

.drawer-menu li a span {
    flex: 1;
    font-size: 15px;
}

.drawer-menu li a .badge {
    background: #dc3545;
    color: #fff;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
}

.drawer-footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    margin-top: 20px;
}

.drawer-footer .logout-btn {
    width: 100%;
    padding: 12px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}

.drawer-footer .logout-btn:hover {
    background: #c82333;
}

.drawer-footer .logout-btn i {
    margin-right: 8px;
}

.drawer-footer .login-btn {
    width: 100%;
    padding: 12px;
    background: #73cccd;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.3s;
}

.drawer-footer .login-btn:hover {
    background: #5568d3;
}

.drawer-footer .login-btn i {
    margin-right: 8px;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: relative;
    background: #fff;
    
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    padding: 10px 10px;
}

.mobile-header-logo {
    text-align: center;
    margin-bottom: 8px;
}

.mobile-header-logo a {
    display: inline-block;
}

.mobile-header-logo img {
    max-height: 30px;
    width: auto;
    display: block;
    margin: 0 auto;
}

.mobile-search-bar {
    position: relative;
}

.mobile-search-bar input {
    width: 100%;
    padding: 8px 38px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.3s;
}

.mobile-search-bar input:focus {
    border-color: #667eea;
}

.mobile-search-bar button {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}

.mobile-search-bar button:hover {
    background: #5568d3;
}

.mobile-search-bar button i {
    font-size: 14px;
}

/* Hide header on mobile when bottom nav is active */
@media (max-width: 991px) {
       .mobile-bottom-nav {
        margin: 8px;
   
        display: block;
        border-radius: 60px;
        /* padding: 0px; */
        /* top: 103px; */
        bottom: 10px;
        height: 66px;
        border: solid 1px #000000;
        box-shadow: #309293;
        align-items: stretch;
        align-content: flex-end;
        flex-wrap: nowrap;
        flex-direction: row;
    }
    
    .mobile-header {
        display: block;
    }
    
    /* Hide desktop header on mobile */
    header.header-area,
    .header-area.style-2 {
        display: none !important;
    }
    
    /* Add padding to body to prevent content from being hidden */
    body {
        padding-top: 0;
        padding-bottom: 70px;
    }
    
    /* Adjust main content */
   
    .feature-product-section,
    .suggest-section,
    .product-banner-section {
        margin-top: 0 !important;
        padding-top: 20px !important;
    }
}

/* Category with Subcategories */
.drawer-menu .category-with-sub {
    border-bottom: 1px solid #f0f0f0;
}

.drawer-menu .category-btn {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #333;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
}

.drawer-menu .category-btn:hover {
    background: #f8f9fa;
}

.drawer-menu .category-btn.active {
    color: #667eea;
    background: #f8f9fa;
}

.drawer-menu .category-btn i:first-child {
    margin-right: 15px;
    font-size: 20px;
    width: 25px;
    color: #667eea;
}

.drawer-menu .category-btn span {
    flex: 1;
}

.drawer-menu .category-btn i.sub-chevron {
    font-size: 16px;
    transition: transform 0.3s;
}

.drawer-menu .category-btn.active i.sub-chevron {
    transform: rotate(180deg);
}

/* Level 1 Button */
.drawer-menu .category-btn.level-1 {
    padding: 15px 20px;
}

/* Level 2 Button */
.drawer-menu .category-btn.level-2 {
    padding: 12px 20px 12px 50px;
    font-size: 14px;
}

.drawer-menu .category-btn.level-2 i:first-child {
    font-size: 18px;
    width: 20px;
    margin-right: 10px;
}

.drawer-menu .category-btn.level-2 i.sub-chevron {
    font-size: 14px;
}

/* Subcategory List (Level 2 Container) */
.drawer-menu .subcategory-list {
    background: #f8f9fa;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.drawer-menu .subcategory-with-child {
    border-bottom: 1px solid #e9ecef;
}

.drawer-menu .subcategory-with-child:last-child {
    border-bottom: none;
}

/* Subcategory Link (Level 2 without children) */
.drawer-menu .subcategory-link {
    display: flex;
    align-items: center;
    padding: 12px 20px 12px 50px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s;
}

.drawer-menu .subcategory-link:last-child {
    border-bottom: none;
}

.drawer-menu .subcategory-link:hover {
    background: #fff;
    color: #667eea;
    padding-left: 55px;
}

.drawer-menu .subcategory-link i {
    margin-right: 10px;
    font-size: 14px;
}

/* Child List (Level 3 Container) */
.drawer-menu .child-list {
    background: #fff;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Child Link (Level 3) */
.drawer-menu .child-link {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 70px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s;
}

.drawer-menu .child-link:last-child {
    border-bottom: none;
}

.drawer-menu .child-link:hover {
    background: #f8f9fa;
    color: #667eea;
    padding-left: 75px;
}

.drawer-menu .child-link i {
    margin-right: 8px;
    font-size: 12px;
}

/* Desktop - hide mobile bottom nav */
@media (min-width: 992px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    
    .mobile-drawer {
        display: none !important;
    }
    
    .mobile-drawer-overlay {
        display: none !important;
    }
}


/* Mobile Header Section (Welcome Page Only) */
.mobile-header-section {
    background: #fff;
}

/* Mobile Logo Section (scrolls away) */
.mobile-logo-section {
    background: #fff;
    padding: 15px 0;
    text-align: center;
}

.mobile-logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-page-logo {
    max-height: 153px;
  margin-top: -50px;
    width: 208px;
}

/* Mobile Search Section (becomes sticky on scroll) */
.mobile-search-section {
    background: #fff;
    padding: 12px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 15px;
    transition: all 0.3s ease;
    margin-top: -50px;
}

.mobile-search-section.sticky {
    position: fixed !important;
    top:50px !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999999 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    animation: slideDown 0.3s ease;
    background: #fff !important;
    padding: 8px 0 !important;
}

/* Sticky Logo (only visible when search is sticky) */
.sticky-logo {
    display: none;
    align-items: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.sticky-logo img {
    max-height: 35px;
    height: auto;
    width: auto;
}

.mobile-search-section.sticky .sticky-logo {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-search-wrapper {
    max-width: 100%;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1;
}

.mobile-search-input {
    width: 100%;
    padding: 12px 50px 12px 15px;
    border: 2px solid #309293;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.mobile-search-input:focus {
    border-color: #309293;
    box-shadow: 0 0 0 3px rgba(48, 146, 147, 0.1);
}

.mobile-search-btn {
    position: absolute;
    right: 5px;
    background: #309293;
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.mobile-search-btn:hover {
    background: #267677;
    transform: scale(1.05);
}

.mobile-search-btn i {
    font-size: 16px;
}

/* Spacer when search is sticky */
.search-spacer {
    display: none;
    height: 0;
    transition: height 0.3s ease;
}

/* Hide on desktop */
@media (min-width: 992px) {
    .mobile-header-section {
        display: none !important;
    }
}


/* Dynamic Search Results Dropdown */
.mobile-search-wrapper {
    position: relative;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 999999;
    margin-top: 5px;
}

.search-results-list {
    padding: 0;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: #333;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
    margin-right: 12px;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-price {
    font-size: 13px;
    color: #309293;
    font-weight: 600;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.search-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.search-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


/* Mobile Search Wrapper - Normal State (full width search) */
.mobile-search-wrapper {
    position: relative;
}

#mobileSearchForm {
    width: 100%;
}

/* Sticky Logo (hidden by default) */
.sticky-logo {
    display: none;
    align-items: center;
    flex-shrink: 0;
}

.sticky-logo img {
    max-height: 35px;
    height: auto;
    width: auto;
}

/* When Sticky - Show Logo and Adjust Layout */
.mobile-search-section.sticky .mobile-search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-search-section.sticky .sticky-logo {
    display: flex;
    animation: fadeInLogo 0.3s ease;
}

.mobile-search-section.sticky #mobileSearchForm {
    flex: 1;
}

@keyframes fadeInLogo {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
