/* ============================================
   Click-to-Expand Navigation for Sheeel Theme
   Enhanced with replacement functionality
============================================ */

/* NEW: Smooth replacement animations */
.level0.nav {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.level0.nav.level1-replacement,
.level1.nav.level2-replacement {
    animation: slideInFromRight 0.3s ease-out;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* NEW: Persistent home button styling */
.persistent-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--sheeel-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    margin-left: 10px;
}

.persistent-home-btn:hover {
    background: var(--sheeel-secondary);
    transform: scale(1.1);
}

/* NEW: Enhanced back button styling */
.nav-back {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.nav-back .category-back {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    margin: 0 10px;
    background: var(--sheeel-primary);
    border: 1px solid var(--sheeel-primary);
    border-radius: 6px;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-back .category-back:hover {
    background: var(--sheeel-secondary);
    border-color: var(--sheeel-secondary);
    color: #ffffff !important;
}

.nav-back .category-back:active {
    transform: scale(0.97);
}

/* NEW: Replacement navigation styling */
.level1-replacement,
.level2-replacement {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
    flex-wrap: wrap;
}

.level1-replacement > li,
.level2-replacement > li {
    display: inline-block;
}

.level1-replacement > li > a,
.level1-replacement > li > span,
.level2-replacement > li > a,
.level2-replacement > li > span {
    display: inline-block;
    padding: 8px 16px;
    color: var(--sheeel-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--sheeel-primary);
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

.level1-replacement > li:hover > a,
.level1-replacement > li:hover > span,
.level2-replacement > li:hover > a,
.level2-replacement > li:hover > span {
    background: var(--sheeel-primary);
    color: white;
    border-color: var(--sheeel-primary);
}

/* Main Navigation Layout */
.navigation-items {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-categories {
    flex: 1;
}

/* Contact Us Separate */
.contact-nav-item {
    margin-left: 20px;
}

.contact-nav-item .contact-link {
    color: var(--sheeel-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.contact-nav-item .contact-link:hover {
    background: var(--sheeel-primary);
    color: white;
}

/* Level 0 - Main Categories */
.level0.nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
    /* Anchor for submenus */
    /* Removed padding-bottom transition as we now push #content */
}

/* Override existing styles that might trap the submenu */
.level0>li,
.main-categories .level0.top-lvl {
    position: static !important;
    /* CRITICAL: Allows submenu to span full width of parent UL */
    margin-bottom: 0;
}

/* Main Categories */
.main-categories .level0>li>.category-link {
    display: block;
    padding: 8px 16px;
    font-size: 14px !important;
    /* Force Uniform 14px */
    color: var(--sheeel-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--sheeel-primary);
    white-space: nowrap;
}

/* Level 1 Subcategories */
.submenu.level1>li>a,
.submenu.level1>li>span {
    display: inline-block;
    padding: 8px 16px;
    color: var(--sheeel-primary);
    /* Grape color text */
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px !important;
    /* Force Uniform 14px */
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--sheeel-primary);
    /* Bordered like parent */
    border-radius: 8px;
    /* Match parent radius */
    white-space: nowrap;
    cursor: pointer;
}

/* Level 2 Subcategories */
.submenu.level2>li>a,
.submenu.level2>li>span {
    display: inline-block;
    padding: 8px 16px;
    /* Matched Level 0/1 */
    color: var(--sheeel-primary);
    text-decoration: none;
    font-size: 14px !important;
    /* Force Uniform 14px - matched Level 0/1 */
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--sheeel-primary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Increased specificity to ensure overrides */
.main-categories .level0>li:hover>.category-link,
.main-categories .level0>li.open>.category-link,
.main-categories .level0>li.active-category>.category-link,
.main-categories .level0>li.current-menu-item>.category-link,
.main-categories .level0>li:focus-within>.category-link {
    background: var(--sheeel-primary) !important;
    color: #ffffff !important;
    border-color: var(--sheeel-primary) !important;
}

/* Extra specificity override for hover */
.main-categories .level0 li:hover .category-link,
.main-categories ul.level0 li:hover .category-link {
    background: var(--sheeel-primary) !important;
    color: #ffffff !important;
}

/* Ensure child elements (text/icons) also inherit white */
.main-categories .level0>li:hover>.category-link *,
.main-categories .level0>li.open>.category-link *,
.main-categories .level0>li.active-category>.category-link *,
.main-categories .level0>li.current-menu-item>.category-link * {
    color: #ffffff !important;
}

/* Level 1 - Subcategories as Horizontal Bar */
.submenu.level1 {
    display: none;
    /* Hidden by default */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    margin-top: 10px;
    padding: 10px 0;
    /* Add padding for the bar look */
    flex-wrap: wrap;
    gap: 10px;
    z-index: 100;
    background: rgba(201, 28, 94, 0.08);
    /* Light grape/pink wash for the bar */
    border-top: 1px solid rgba(201, 28, 94, 0.15);
}

/* Show when parent is open */
.toggle-category.open>.submenu.level1 {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: none !important;
}

.submenu.level1>li {
    display: inline-block;
    position: static;
}

.submenu.level1>li>a,
.submenu.level1>li>span {
    display: inline-block;
    padding: 8px 16px;
    color: var(--sheeel-primary);
    /* Grape color text */
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--sheeel-primary);
    /* Bordered like parent */
    border-radius: 8px;
    /* Match parent radius */
    white-space: nowrap;
    cursor: pointer;
}

.submenu.level1>li:hover>a,
.submenu.level1>li.open>a,
.submenu.level1>li:hover>span,
.submenu.level1>li.open>span {
    background: var(--sheeel-primary);
    /* Filled on hover */
    color: white;
    border-color: var(--sheeel-primary);
}

/* Level 2 - Sub-subcategories as Secondary Horizontal Bar */
/* Level 2 - Sub-subcategories as Secondary Horizontal Bar */
.submenu.level2 {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    margin-top: 10px;
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 101;
    background: rgba(201, 28, 94, 0.12);
    /* Slightly darker wash */
    border-top: 1px solid rgba(201, 28, 94, 0.15);
}

.submenu.level1>li.open>.submenu.level2 {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: none !important;
}



.submenu.level2>li:hover>a,
.submenu.level2>li:hover>span {
    background: var(--sheeel-primary);
    color: white;
    opacity: 1;
}

/* PUSH EFFECT ON CONTENT */
/* Ensure transition is smooth */
/* PUSH EFFECT ON NAVIGATION CONTAINER */
/* Ensure transition is smooth */
.level0.nav {
    /* ... existing props maintained by cascade usually, but here we enforce transition */
    transition: margin-bottom 0.3s ease;
}

/* Using body classes toggled by JS */
body.menu-open-l1 .level0.nav {
    margin-bottom: 60px;
    /* Space for L1 bar */
}

body.menu-open-l2 .level0.nav {
    margin-bottom: 120px;
    /* Space for L1 + L2 bars */
}

/* Mobile Responsive adjustment */
@media (max-width: 991px) {
    .navigation-items {
        flex-direction: column;
        align-items: stretch;
    }

    .level0.nav {
        flex-direction: column;
    }

    .level0>li {
        position: relative;
        /* Revert to relative for mobile dropdown */
        width: 100%;
    }

    .submenu.level1 {
        position: static;
        width: auto;
        padding: 10px 15px;
        margin-top: 0;
        background: #f5f5f5;
        border-radius: 4px;
    }

    .submenu.level2 {
        position: static;
        width: auto;
        padding: 10px 0;
        margin-top: 0;
    }

    .level0>li>.category-link {
        border-radius: 4px;
        margin-bottom: 5px;
    }

    .main-categories {
        display: none;
    }

    .main-categories.active {
        display: block;
    }
}

/* Breadcumb integration */
.breadcrumb-nav {
    background: var(--sheeel-bg);
    padding: 15px 0;
    border-bottom: 1px solid var(--sheeel-border);
}

.breadcrumb-nav .breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--sheeel-secondary);
}

.breadcrumb-nav .breadcrumb a {
    color: var(--sheeel-primary);
    text-decoration: none;
}

.breadcrumb-nav .breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-nav .breadcrumb .separator {
    color: var(--sheeel-muted);
}