/* Basic reset */
body {
    margin: 0;
    font-family: sans-serif;
    background-color: #f4f4f4;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none; /* Hidden by default */
}

@media (max-width: 768px) {
    body {
        padding-bottom: 70px; /* Add padding to the bottom to prevent content from being hidden by the nav bar */
    }

    .bottom-nav {
        display: block; /* Show on mobile */
        font-family: 'iranyekan';
    }

    .header .mega-menu-bpshop-em5 {
        display: none !important;
    }

    .vmenu-ak1 {
        display: none !important;
    }
}

/* --- Bottom Nav Bar Item Layout --- */
.bottom-nav-list {
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    height: 100%;
}

.bottom-nav-item {
    text-align: center;
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #555;
    padding: 8px 4px;
    transition: color 0.2s;
}

.bottom-nav-link:hover,
.bottom-nav-link.active {
    color: #AE0F26;
}

.bottom-nav-link .material-icons {
    font-size: 24px;
    margin-bottom: 4px;
}

.bottom-nav-link span {
    font-size: 12px;
}


/* --- Redesigned Mobile Menu Styles --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
}


.mobile-menu-overlay .mobile-menu-content {
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    background-color: #f7f7f7;
}

.mobile-menu-close-button {
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 30px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    z-index: 10; /* Ensure it's above other content */
    padding: 15px; /* Increase touch area */
    box-sizing: content-box;
    width: 30px;
    height: 30px;
    text-align: center;
}

.mobile-menu-overlay .category-container {
    position: relative; /* Needed for absolute positioning of the close button */
    display: flex;
    direction: ltr; 
    width: 100%;
    height: 100%; /* Make container take full height of content area */
    background-color: #ffffff;
    /* border: 1px solid #e0e0e0; */ /* Removing borders for full-screen look */
    /* border-radius: 8px; */ /* Removing border-radius */
    overflow: hidden;
    box-shadow: none !important; /* Removing shadow */
}

.mobile-menu-overlay .main-categories {
    width: 110px;
    background-color: #f9f9f9;
    border-left: 1px solid #e0e0e0;
    padding: 48px 0;
    flex-shrink: 0;
    overflow-y: auto;
}

.mobile-menu-overlay .category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    text-align: center;
    position: relative;
    transition: background-color 0.2s ease-in-out;
}

.mobile-menu-overlay .category-item:hover {
    background-color: #f0f0f0;
}

.mobile-menu-overlay .category-item i {
    font-size: 22px;
    margin-bottom: 8px;
    color: #666;
    transition: color 0.2s ease-in-out;
}

.mobile-menu-overlay .category-item span {
     line-height: 1.4;
     font-family: 'iranyekan';
}

.mobile-menu-overlay .category-item.active {
    background-color: #fff;
}

.mobile-menu-overlay .category-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    width: 3px;
    background-color: #AE0F26;
    border-radius: 3px 0 0 3px;
}

.mobile-menu-overlay .category-item.active i,
.mobile-menu-overlay .category-item.active span {
    color: #AE0F26;
}

.mobile-menu-overlay .category-details-wrapper {
    flex-grow: 1;
    overflow-y: auto;
}

.mobile-menu-overlay .category-details {
    padding: 20px;
    direction: rtl;
}

.mobile-menu-overlay .all-products-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
}

.mobile-menu-overlay .all-products-link i {
    font-size: 12px;
}

.mobile-menu-overlay .main-title {
    font-size: 16px;
    color: #333;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-overlay .accordion-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-overlay .accordion-menu li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 4px;
    text-decoration: none;
    color: #444;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
    transition: color 0.2s ease-in-out;
    font-family: 'iranyekan';
}

.mobile-menu-overlay .accordion-menu li:last-child a {
    border-bottom: none;
}

.mobile-menu-overlay .accordion-menu li a:hover {
    color: #AE0F26;
}

.mobile-menu-overlay .accordion-menu li a i {
    color: #999;
    font-size: 12px;
    transition: transform 0.3s ease-in-out;
}

.mobile-menu-overlay .accordion-menu li.open > a i {
    transform: rotate(180deg);
}

.mobile-menu-overlay .submenu-level-3 {
    list-style: none;
    padding-right: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}

.mobile-menu-overlay .accordion-menu li.open > .submenu-level-3 {
    max-height: 1000px; /* Arbitrary large value */
}

.mobile-menu-overlay .submenu-level-3 li a {
    font-size: 13px;
    color: #666;
    padding: 12px 4px;
    border-bottom: none;
    border-top: 1px solid #f5f5f5;
}

/* Loading State */
body.loading .bottom-nav {
    display: none;
}

.bottom-nav-loader {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px; /* Same as body padding-bottom */
    background-color: #ffffff;
    z-index: 1001;
}

body.loading .bottom-nav-loader {
    display: block;
}

.loader-ellipsis {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    color: #888;
    line-height: 1;
    padding-bottom: 40px;
}

.loader-ellipsis span {
    animation-name: blink;
    animation-duration: 1.4s;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
}

.loader-ellipsis span:nth-child(2) {
    animation-delay: .2s;
}

.loader-ellipsis span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes blink {
    0% {
        opacity: .2;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: .2;
    }
}
