/* ---------------------------------------------
   BASE WRAPPER
--------------------------------------------- */
.custom-mega-menu-content {
    display: flex;
    width: 100%;
	height: 100dvh;          /* iPhone-safe full height */
    max-height: 100dvh;
    background: white;
    border-radius: 4px;
    overflow: hidden;
	overflow-y: auto;
}

/* ---------------------------------------------
   SIDEBAR
--------------------------------------------- */
.mega-menu-sidebar {
    width: 350px;
    background: #ffffff;
    border-right: 1px solid #dee2e6;
    padding: 15px 10px;
    display: grid;
    gap: 8px;
    min-height: 300px;
}

.sidebar-category {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.sidebar-category a {
    display: block;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-category a:hover {
    background: #000000;
    border-radius: 10px;
    color: #ffffff;
}

.sidebar-category.has-children a:hover {
    font-size: 16px;
}

/* Parent arrow (Level 1 sidebar arrow) */
.arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.sidebar-category:hover .arrow {
    transform: translateY(-50%) rotate(90deg);
    color: #ffffff;
}

/* ---------------------------------------------
   DESKTOP MAIN CONTENT
--------------------------------------------- */
.mega-menu-content {
    padding: 20px;
    overflow: hidden;
}

.mega-submenu { 
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.submenu-grid {
    display: flex;
    gap: 30px;
}

.submenu-column {
    flex: 1;
    min-width: 150px;
}

.submenu-item {
    display: block;
    padding: 8px 0;
    font-size: 15px;
    font-weight: 500;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
}

.submenu-item:hover {
    color: #007bff;
    padding-left: 5px;
}

/* Desktop hover show */
.sidebar-category:hover + .mega-menu-content .mega-submenu,
.mega-menu-content .mega-submenu:hover {
    display: block;
}

/* ---------------------------------------------
   MOBILE SUBMENU (Level 1 → Level 2)
--------------------------------------------- */
.mobile-submenu {
    display: none;
    background: #fff;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    border-radius: 0 10px;
}

.mobile-submenu.expanded {
    display: block;
}

/* ---------------------------------------------
   LEVEL-2 CHEVRON (Clothes, Accessories)
--------------------------------------------- */
.sub-arrow {
    float: right;
    font-size: 22px;
    margin-left: 8px;
    color: #6c757d;
    transition: transform 0.25s ease;
}

/* Rotate on expansion */
.submenu-group.expanded .sub-arrow {
    transform: translateY(-50%) rotate(90deg);
}

/* ---------------------------------------------
   LEVEL-3 (Grandchildren) ACCORDION (Mobile)
--------------------------------------------- */
@media (max-width: 768px) {
    .submenu-children {
        display: none;
    }

    .submenu-group.expanded .submenu-children {
        display: block;
    }
}

/* ---------------------------------------------
   RESPONSIVE (Mobile behavior)
--------------------------------------------- */
@media (min-width: 769px) {
    .mobile-submenu {
        display: none !important;
    }
}

@media (max-width: 768px) {

    .custom-mega-menu-content {
        flex-direction: column;
        height: 100dvh;          /* iPhone-safe full height */
    max-height: 100dvh;
        overflow-y: auto;
    }

    .mega-menu-sidebar {
        width: 100%;
        border-right: none;
        padding: 10px;
    }

    .sidebar-category {
        width: 100%;
        margin-bottom: 4px;
        border-bottom: 1px solid #f8f9fa;
    }

    .sidebar-category a {
        padding: 15px 20px;
    }

    .mega-menu-content {
        display: none;
    }

    .mobile-submenu {
        border-bottom: 1px solid #f8f9fa;
    }

    .submenu-grid {
        padding: 15px 0px;
        flex-wrap: wrap;
        gap: 0;
    }

    .submenu-column {
        flex: 1 1 100%;
        min-width: 200px;
    }

    .submenu-item {
        padding: 5px 20px !important;
        font-size: 15px;
    }
}

@media (max-width: 480px) {

    .sidebar-category a {
        padding: 12px 15px;
        font-size: 13px !important;
    }

    .submenu-item {
        padding: 5px 20px !important;
        font-size: 14px;
    }
}

/* ---------------------------------------------
   ACTIVE STATES
--------------------------------------------- */
.sidebar-category.active a {
    background: #000000 !important;
    color: white !important;
    border-radius: 10px;
}
/* ============================================
   MAKE LEVEL-2 CHEVRON CLICKABLE AREA MUCH LARGER
   WITHOUT CHANGING HTML
=============================================== */

/* Parent link gets more padding on the right */
.submenu-parent-link {
    padding-right: 60px !important; /* make room for hitbox */
    position: relative;
}

/* Chevron stays visually the same, but is centered in its tap zone */
.submenu-parent-link .sub-arrow {
    position: absolute;
    right: 18px; 
	font-weight: 700;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    z-index: 3;
    pointer-events: auto;
    transition: transform 0.25s ease;
}

/* HUGE invisible tap zone overlay */
.submenu-parent-link .sub-arrow::before {
    content: "";
    position: absolute;
    top: 50%;
    right: -20px;

    /* The invisible tap area */
    width: 60px;       /* ← wide tap zone */
    height: 50px;      /* ← tall tap zone */

    transform: translateY(-50%);

    /* Let JS click handler detect this */
    pointer-events: auto;

    /* No visible effect */
    background: transparent;
}

/* Rotate on expansion */
.submenu-group.expanded .sub-arrow {
    transform: translateY(-50%) rotate(90deg);
}

/* Prevent hover from turning into link hover highlight */
.submenu-parent-link:hover .sub-arrow::before {
    background: transparent !important;
}