/* =========================
   MOBILE MENU (Myntra Style)
========================= */

@media (max-width: 768px) {

  /* ===== SIDEBAR ===== */
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    transition: 0.3s ease;
    overflow-y: auto;
    
  }

  .nav.active {
    right: 0;
  }

  /* ===== RESET STRUCTURE ===== */
  .mobile-menu-slider {
    width: 100%;
  }

  .menu-level {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  /* ===== LEVEL 1 ===== */
  .menu-item {
    border-bottom: 1px solid #eee;
  }

  .menu-row {
    padding: 14px 16px;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
  }

  .menu-link {
    text-decoration: none;
    color: #000;
    font-weight: 500;
  }

  .arrow {
    display: block;
    font-size: 18px;
    transition: transform 0.25s ease;
  }

  /* ===== LEVEL 2 (GROUPS) ===== */
  .menu-level.level-2 {
    display: none;
    background: #fff;
  }

  .menu-item.active > .menu-level.level-2 {
    display: block;
  }

  /* group list */
  .mega-column {
    border-bottom: 1px solid #f1f1f1;
  }

  .mega-title {
    font-size: 14px;
    color: #ff3f6c;
    text-decoration: none;
    font-weight: 600;
  }

  /* ===== LEVEL 3 (SUBGROUPS) ===== */
  .menu-level.level-3 {
    display: none;
    background: #fafafa;
  }

  .mega-column.active > .menu-level.level-3 {
    display: block;
  }

  .menu-level.level-3 li {
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
  }

  .menu-level.level-3 a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
  }

  /* ===== BACK BUTTON ===== */
  .back-btn {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
  }

  /* ===== OVERLAY ===== */
#menuOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(0,0,0,0.4);

  z-index: 999;   /* LOWER than menu */
  display: none;
}

#menuOverlay.active {
  display: block;
}


@media (max-width: 768px) {

  /* LEVEL 2 */
  .menu-level.level-2 {
    display: none !important;
  }

  .menu-item.active > .menu-level.level-2 {
    display: block !important;
  }

  /* LEVEL 3 */
  .menu-level.level-3 {
    display: none !important;
  }

  .mega-column.active > .menu-level.level-3 {
    display: block !important;
  }

}

@media (max-width: 768px) {

  .mega-menu {
    display: none !important;
  }

  .menu-item.active > .mega-menu {
    display: block !important;
  }

  .menu-row:active {
    background: #f5f5f5;
  }

}

@media (max-width: 768px) {

  /* 🔥 RESET MEGA MENU FOR MOBILE */
  .mega-menu {
    position: static !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;

    width: 100% !important;
    max-width: 100% !important;

    display: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  /* SHOW WHEN ACTIVE */
  .menu-item.active > .mega-menu {
    display: block !important;
  }

}

@media (max-width: 768px) {

  .mega-menu {
    grid-template-columns: 1fr !important;
  }

}




@media (max-width: 768px) {

  .arrow {
    transition: 0.3s;
  }

  /* rotate arrow when open */
  .menu-item.active > .menu-row .arrow {
    transform: rotate(90deg);
  }

  .mega-column.active > .menu-row .arrow {
    transform: rotate(90deg);
  }

}


@media (max-width: 768px) {

  .mobile-menu-banner img {
    width: 100%;
    height: auto;
    border-bottom: 1px solid #eee;
  }

}


@media (max-width: 768px) {

  .mobile-static-menu {
    margin-top: 15px;
    padding: 10px 15px;
    border-top: 8px solid #f5f5f5; /* 🔥 separator */
  }

  .mobile-static-menu a {
    display: block;
    padding: 12px 0;
    text-decoration: none;
    color: #555;
    font-size: 14px;
  }

  .mobile-static-menu a:hover {
    color: #ff3f6c;
  }

  .tag {
    font-size: 10px;
    color: #ff3f6c;
    border: 1px solid #ff3f6c;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
  }

}

@media (max-width: 768px) {

  .menu-item {
    border-bottom: 1px solid #f1f1f1;
  }

  .menu-level.level-3 li {
    padding-left: 25px;
    font-size: 14px;
    color: #666;
  }

}


@media (max-width: 768px) {

  .nav {
    display: flex;
    flex-direction: column;
    height: 100vh;
  }

  /* TOP BANNER */
  .mobile-menu-banner {
    flex-shrink: 0;
  }



  /* STATIC MENU AT BOTTOM */
  .mobile-static-menu {
    flex-shrink: 0;
    border-top: 8px solid #f5f5f5;
    padding: 10px 15px;
    background: #fff;
  }

}

.mobile-menu-banner {
  display: block;
  background: #fff;
  z-index: 1;
}

.mobile-menu-banner img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 768px) {

  .nav {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;   /* 🔥 IMPORTANT */
  }

  .mobile-menu-banner {
    flex-shrink: 0;
  }

  .mobile-menu-slider {
    flex: 1;
    overflow-y: auto;   /* only this scrolls */
  }

  .mobile-static-menu {
    flex-shrink: 0;
    background: #fff;
  }

}

@media (max-width: 768px) {

  .nav {
    position: fixed !important;
    top: 0 !important;
    right: -100%;
    height: 100vh;
    width: 85%;
    z-index: 1000;

    margin: 0 !important;
  }

}

@media (max-width: 768px) {

  /* 🔥 RESET NAV COMPLETELY */
  .nav {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important;   /* ONLY THIS */
  }

  /* TOP BANNER */
  .mobile-menu-banner {
    flex-shrink: 0;
  }

  /* SCROLLABLE MENU ONLY */
  .mobile-menu-slider {
    flex: 1;
    overflow-y: auto;
    min-height: 0;   /* 🔥 CRITICAL FIX */
  }

  /* STATIC MENU ALWAYS VISIBLE */
  .mobile-static-menu {
    flex-shrink: 0;
    display: block !important;
    background: #fff;
    border-top: 10px solid #f5f5f5;
    padding: 12px 16px;
  }

}

.arrow {
  padding-left: 10px;
  cursor: pointer;
}
.menu-row {
  position: relative;
}

.arrow {
  position: absolute;
  right: 15px;
}


@media (max-width: 768px) {

  /* LEVEL 2 animation */
  .menu-level.level-2 {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
  }

  .menu-item.active > .menu-level.level-2 {
    max-height: 1000px; /* big enough */
    opacity: 1;
  }

  /* LEVEL 3 animation */
  .menu-level.level-3 {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
  }

  .mega-column.active > .menu-level.level-3 {
    max-height: 1000px;
    opacity: 1;
  }

}

.logo {
  margin: 0;
}

.container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  color: #333;
  cursor: pointer;
  transition: 0.2s;
}

.icon:hover {
  color: #ff3f6c;
}