/*
 * Component: Mobile Menu (Drawer & Panels)
 */

/* Drawer Styling */
.wsdt-mobile-drawer {
  position: fixed;
  top: 0;
  left: -400px; /* Off-canvas position */
  width: 350px;
  max-width: 85%;
  height: 100vh;
  background: var(--bg-gray-light);
  z-index: var(--z-drawer);
  transition: left 0.4s ease-in-out;
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
  display: block;
  padding-top: 0;
  overflow-y: auto;
}

.wsdt-mobile-drawer.is-open {
  left: 0;
}

/* Overlay (The dark background) */
.wsdt-mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  visibility: hidden;
  z-index: var(--z-overlay);
}

.wsdt-mobile-overlay.is-active {
  visibility: visible;
}

/* --- Panel System (Flattened Structure) --- */
.wsdt-mobile-panels {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Individual Panel */
.wsdt-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-gray-light);
  transition: transform 0.4s ease-in-out, visibility 0.4s;
  overflow-y: auto;
  z-index: 1;
  transform: translateX(100%); /* Default: Hidden to the right */
  visibility: hidden;
}

/* Active Panel (Visible) */
.wsdt-panel.is-active {
  transform: translateX(0);
  visibility: visible;
  z-index: 10;
}

/* Parent Panel (Slid Left - Parallax) */
.wsdt-panel.is-slid-left {
  transform: translateX(-30%);
  visibility: hidden;
  z-index: 1;
}

/* --- Menu Lists inside Panels --- */
.wsdt-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  width: 100%;
}

/* List Items */
.wsdt-panel ul li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  display: flex;
  align-items: stretch;
}

.wsdt-panel ul li:last-child {
  border-bottom: none;
}

/* Links Styling */
.wsdt-panel ul li a {
  font-size: var(--font-size-base);
  color: var(--color-primary);
  text-transform: none;
  font-weight: 700;
  display: block;
  flex: 1;
  padding: 12px 30px;
  position: relative;
  z-index: 1;
  text-decoration: none;

  /* Link Fill Animation Logic */
  background: linear-gradient(
    to right,
    var(--color-secondary) 50%,
    transparent 50%
  );
  background-size: 200% 100%;
  background-position: var(--bg-slide-pos-start);
  transition: background-position 0.4s ease-in-out, color 0.3s ease;
}

.wsdt-panel ul li a:hover {
  background-position: var(--bg-slide-pos-end);
  color: var(--text-on-dark) !important;
}

/* No Scroll */
body.no-scroll {
  overflow: hidden;
}

/* Toggle Button Styling */
.wsdt-submenu-toggle {
  position: relative;
  display: flex;
  width: 50px;
  height: auto;
  background: transparent;
  border: none;
  border-left: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  z-index: 10;
  justify-content: center;
  align-items: center;
}

.wsdt-submenu-toggle::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  transform: rotate(-45deg);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.wsdt-submenu-toggle:hover::after {
  border-color: var(--color-secondary);
}

/* Navbar Styling (Back Button + Title) */
.wsdt-panel-navbar {
  display: flex;
  align-items: center;
  padding: 15px 10px;
  background: var(--bg-gray-medium);
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 0;
}

.wsdt-back-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  margin-right: 10px;
  display: flex;
  align-items: center;
}

.wsdt-back-btn::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(135deg);
  color: var(--color-primary);
}

.wsdt-panel-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
  text-transform: uppercase;
}
