/* =============================================
   nav.css - Sidebar Navigation Redesign
   ============================================= */

/* Page layout container */
.yupoo-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  background: #f8f8fa;
}

/* Sidebar layout */
.yupoo-sidebar {
  width: 260px;
  background: #141416;
  color: #c8c8cb;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid #232326;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 10002;
  transition: transform 0.3s ease;
}

/* Main body content area */
.yupoo-main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top bar (for search & mobile menu trigger) */
.yupoo-topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid #e5e5e9;
  display: flex;
  align-items: center;
  padding: 0 24px;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10001;
}

/* Mobile toggle button */
.mobile-sidebar-toggle {
  display: none;
  font-size: 22px;
  background: none;
  border: none;
  color: #333;
  cursor: pointer;
  padding: 8px;
}

/* Content area container */
.yupoo-content-area {
  padding: 24px;
  flex: 1;
}

/* Logo and shop name inside sidebar */
.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid #232326;
  text-align: center;
}
.sidebar-logo {
  max-height: 34px;
  margin-bottom: 12px;
}
.sidebar-shopname {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User section */
.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid #232326;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-welcome {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #e4e4e7;
}
.user-welcome .username {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.user-welcome .admin-link {
  color: #facc15;
  text-decoration: none;
  font-size: 14px;
}
.logout-btn, .login-btn, .register-btn {
  font-size: 12px;
  text-align: center;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
}
.logout-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
.logout-btn:hover {
  background: #ef4444;
  color: #fff;
}
.auth-buttons {
  display: flex;
  gap: 8px;
}
.login-btn {
  flex: 1;
  background: #27272a;
  color: #e4e4e7;
}
.login-btn:hover {
  background: #3f3f46;
}
.register-btn {
  flex: 1;
  background: #49bc85;
  color: #fff;
}
.register-btn:hover {
  background: #3da874;
}

/* Navigation items */
.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #a1a1aa;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  margin-bottom: 4px;
  transition: all 0.2s;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.nav-item.active {
  color: #49bc85;
}
.nav-icon {
  font-size: 16px;
}

/* Accordion categories group */
.nav-dropdown-group {
  margin-bottom: 4px;
}
.nav-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 6px;
  transition: all 0.2s;
  color: #a1a1aa;
}
.nav-dropdown-header:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.nav-dropdown-group.active > .nav-dropdown-header {
  color: #49bc85;
}
.category-link {
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.submenu-toggle, .series-toggle {
  background: none;
  border: none;
  color: #71717a;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  transition: transform 0.2s;
}
.nav-dropdown-group.active .submenu-toggle {
  transform: rotate(180deg);
}

/* Submenu level 2 (Brands) */
.submenu-content {
  padding-left: 14px;
  margin-top: 2px;
  border-left: 1px dashed #27272a;
  margin-left: 20px;
}
.brand-group-item {
  margin-bottom: 2px;
}
.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 4px;
}
.brand-header:hover {
  background: rgba(255, 255, 255, 0.03);
}
.brand-link {
  color: #8e8e93;
  text-decoration: none;
  font-size: 13px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-group-item.active .brand-link {
  color: #49bc85;
  font-weight: 500;
}
.brand-group-item.active .series-toggle {
  transform: rotate(90deg);
}

/* Submenu level 3 (Series) */
.series-content {
  padding-left: 12px;
  margin-top: 2px;
  border-left: 1px solid #27272a;
  margin-left: 10px;
}
.series-link {
  display: block;
  padding: 4px 10px;
  color: #5c5c60;
  text-decoration: none;
  font-size: 12px;
  border-radius: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.series-link:hover, .series-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.02);
}
.series-link.active {
  color: #49bc85;
}

/* WhatsApp in Sidebar */
.sidebar-whatsapp {
  padding: 16px;
  border-top: 1px solid #232326;
  text-align: center;
}
.sidebar-whatsapp a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #49bc85;
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(73,188,133,.2);
  transition: all 0.2s;
}
.sidebar-whatsapp a:hover {
  background: #3da874;
}

/* Search form topbar styling */
.topbar-search-form {
  display: flex;
  align-items: center;
  border: 1px solid #e5e5e9;
  border-radius: 20px;
  padding: 4px 12px;
  background: #f8f8fa;
  width: 320px;
}
.topbar-search-form input {
  border: none;
  background: none;
  outline: none;
  flex: 1;
  font-size: 13px;
  color: #333;
}
.topbar-search-form button {
  background: none;
  border: none;
  cursor: pointer;
  color: #71717a;
}

/* Backdrop overlay on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10001;
}

/* =============================================
   Responsive Layout Breakpoints
   ============================================= */
@media (max-width: 992px) {
  .yupoo-sidebar {
    transform: translateX(-100%);
  }
  .yupoo-sidebar.open {
    transform: translateX(0);
  }
  .yupoo-main-content {
    margin-left: 0;
  }
  .mobile-sidebar-toggle {
    display: block;
  }
  .sidebar-overlay.open {
    display: block;
  }
  .topbar-search-form {
    width: 240px;
  }
}

@media (max-width: 576px) {
  .yupoo-content-area {
    padding: 16px;
  }
  .topbar-search-form {
    width: 180px;
  }
}
