/* ============================================================
   MOBILE DRAWER NAVIGATION SYSTEM
   Stack-based multi-level navigation (Amazon/Myntra/Flipkart style)
   ============================================================ */

/* ── Mobile Navbar: 3-column flexbox layout ── */
.cs-mobile-nav {
  height: 56px;
}

/* Logo: takes all middle space, text-align left so it starts right after hamburger */
.cs-mobile-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary) !important;
  text-decoration: none !important;
  white-space: nowrap;
  letter-spacing: -0.3px;
  /* flex-grow-1 class from Bootstrap handles the grow */
}

/* Compact icon style for mobile right-side icons */
.cs-nav-icon-sm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-decoration: none !important;
  color: var(--text-primary);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
}
.cs-nav-icon-sm i {
  font-size: 1.15rem;
  color: var(--text-primary);
  transition: color 0.2s;
}
.cs-nav-icon-sm span:not(.cs-badge) {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  text-align: center;
  line-height: 1;
}
.cs-nav-icon-sm:hover i,
.cs-nav-icon-sm:hover span { color: var(--primary); }



.cs-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background .2s ease;
  z-index: 1200;
}
.cs-hamburger:hover { background: rgba(255,63,108,.08); }
.cs-hamburger .bar {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 10px;
  transition: all .35s cubic-bezier(.4,0,.2,1);
  transform-origin: center;
}
.cs-hamburger.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cs-hamburger.open .bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.cs-hamburger.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Overlay ── */
.cs-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 1100;
  pointer-events: none;
  transition: background .3s ease;
}
.cs-drawer-overlay.active {
  background: rgba(0, 0, 0, 0.55);
  pointer-events: all;
}

/* ── Drawer Container ── */
.cs-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100dvh;
  background: #fff;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(-100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: 4px 0 32px rgba(0,0,0,.18);
  border-radius: 0 16px 16px 0;
  will-change: transform;
}
.cs-drawer.open {
  transform: translateX(0);
}

/* ── Drawer Header ── */
.cs-drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--secondary);
  color: #fff;
  flex-shrink: 0;
  min-height: 64px;
}
.cs-drawer-header .brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
}
.cs-drawer-close {
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.cs-drawer-close:hover { background: rgba(255,255,255,.22); }

/* ── Drawer Search ── */
.cs-drawer-search-wrap {
  padding: 10px 16px;
  background: #f8f8f8;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cs-drawer-search {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 8px 16px 8px 38px;
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color .2s;
  outline: none;
}
.cs-drawer-search:focus { border-color: var(--primary); }
.cs-drawer-search-wrap .search-icon {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 13px;
  pointer-events: none;
}

/* ── Screens Stack Viewport ── */
.cs-drawer-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ── Individual Screens ── */
.cs-drawer-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.cs-drawer-screen.active {
  transform: translateX(0);
}
.cs-drawer-screen.slide-out-left {
  transform: translateX(-30%);
}

/* ── Screen Sub-Header (Back button) ── */
.cs-screen-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  min-height: 50px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cs-screen-back {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 20px;
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .2s;
  flex-shrink: 0;
}
.cs-screen-back:hover { background: #fff5f7; }
.cs-screen-header .screen-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}
.cs-screen-header .screen-view-all {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.cs-screen-header .screen-view-all:hover { text-decoration: underline; }

/* ── Nav List ── */
.cs-drawer-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.cs-drawer-list::-webkit-scrollbar { width: 0; }

/* ── Nav Item ── */
.cs-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  cursor: pointer;
  transition: background .15s ease;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-bottom: 1px solid rgba(0,0,0,.04);
  text-decoration: none;
  color: var(--text-primary);
}
.cs-drawer-item:last-child { border-bottom: none; }
.cs-drawer-item:hover, .cs-drawer-item:active { background: #fafafa; }
.cs-drawer-item:active { background: #fff5f7; }

/* ── Item Icon ── */
.cs-drawer-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

/* ── Item Text ── */
.cs-drawer-item-text {
  flex: 1;
  min-width: 0;
}
.cs-drawer-item-text .item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-drawer-item-text .item-sub {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 1px;
}

/* ── Badge ── */
.cs-drawer-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}

/* ── Right Arrow ── */
.cs-drawer-item .arrow {
  color: var(--text-light);
  font-size: 12px;
  flex-shrink: 0;
  transition: transform .2s;
}
.cs-drawer-item:hover .arrow { transform: translateX(2px); color: var(--primary); }

/* ── Section Divider inside Drawer ── */
.cs-drawer-section-label {
  padding: 10px 18px 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
}

/* ── Drawer Footer ── */
.cs-drawer-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cs-drawer-footer a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all .2s;
}
.cs-drawer-footer a:hover { background: #fff5f7; color: var(--primary); }
.cs-drawer-footer a i { font-size: 14px; }

/* ── Tablet: Wider Drawer ── */
@media (min-width: 600px) and (max-width: 1023px) {
  .cs-drawer { width: 380px; }
}

/* ── Mobile only: show hamburger ── */
@media (max-width: 1023px) {
  .cs-hamburger { display: flex !important; }
  /* Hide the default bootstrap toggler */
  .navbar-toggler { display: none !important; }
  /* Hide desktop mega nav */
  #mainNav { display: none !important; }
}

/* ── Desktop: hide drawer-related ── */
@media (min-width: 1024px) {
  .cs-hamburger { display: none !important; }
  .cs-drawer-overlay,
  .cs-drawer { display: none !important; }
  #mainNav { display: flex !important; }
}

/* ── Breadcrumb trail ── */
.cs-drawer-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 18px;
  background: #f8f8f8;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
  flex-shrink: 0;
  scrollbar-width: none;
}
.cs-drawer-breadcrumb::-webkit-scrollbar { display: none; }
.cs-drawer-breadcrumb span {
  font-size: 11px;
  color: var(--text-light);
  flex-shrink: 0;
}
.cs-drawer-breadcrumb span.crumb {
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
}
.cs-drawer-breadcrumb span.divider { color: var(--border); }

/* ── Touch swipe hint ── */
.swipe-hint {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60px;
  background: var(--primary);
  border-radius: 10px 0 0 10px;
  opacity: 0;
  animation: swipeHintPulse 2s ease 1s forwards;
}
@keyframes swipeHintPulse {
  0%   { opacity: 0; }
  30%  { opacity: .6; }
  70%  { opacity: .6; }
  100% { opacity: 0; }
}

/* ── 'No results' state ── */
.cs-drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-light);
  text-align: center;
}
.cs-drawer-empty i { font-size: 3rem; margin-bottom: 12px; opacity: .4; }
.cs-drawer-empty p { font-size: 13px; margin: 0; }
