/* ===== Main ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer.collapsed ~ .main {
  margin-left: 80px;
}

.drawer ~ .main {
  margin-left: 280px;
}

/* ===== Premium Drawer ===== */
.drawer {
  width: 260px;
  background: linear-gradient(180deg, #1a1d29 0%, #0f111a 100%);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 1000;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Collapse drawer */
.drawer.collapsed {
  width: 80px;
}

/* Expand drawer on hover */
.drawer.collapsed:hover {
  width: 260px;
}

/* Show hidden text when hovered */
.drawer.collapsed:hover .store-name,
.drawer.collapsed:hover li span {
  display: inline;
  animation: fadeInText 0.3s ease-in-out;
}

@keyframes fadeInText {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Adjust logo margin back */
.drawer.collapsed:hover .store-logo {
  margin-right: 12px;
}

/* Collapsed drawer (icon-only) */
.drawer.collapsed .store-name,
.drawer.collapsed li span {
  display: none;
}

.drawer.collapsed .store-logo {
  margin-right: 0;
}

.store-header img {
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* ===== PREMIUM NAVIGATION ITEMS ===== */

/* Make li a full clickable tile with enhanced animations */
.drawer ul li {
  margin-bottom: 6px;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  position: relative;
  animation: fadeInUp 0.6s ease-out backwards;
}

/* Sequential animation delays */
.drawer ul li:nth-child(1) { animation-delay: 0.05s; }
.drawer ul li:nth-child(2) { animation-delay: 0.1s; }
.drawer ul li:nth-child(3) { animation-delay: 0.15s; }
.drawer ul li:nth-child(4) { animation-delay: 0.2s; }
.drawer ul li:nth-child(5) { animation-delay: 0.25s; }
.drawer ul li:nth-child(6) { animation-delay: 0.3s; }
.drawer ul li:nth-child(7) { animation-delay: 0.35s; }
.drawer ul li:nth-child(8) { animation-delay: 0.4s; }

/* FADE IN WITH SUBTLE SCALE ANIMATION */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Anchor inside li with premium effects */
.drawer ul li a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #a0aec0;
  width: 100%;
  padding: 14px 16px;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.3px;
}

/* Animated gradient background on hover */
.drawer ul li a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.1));
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  border-radius: 10px;
}

.drawer ul li a:hover::before {
  width: 100%;
}

/* Left accent bar on hover */
.drawer ul li a::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 3px 3px 0;
}

.drawer ul li a:hover::after {
  height: 60%;
}

/* Enhanced hover effect */
.drawer ul li a:hover {
  background: rgba(102, 126, 234, 0.08);
  color: #ffffff;
  padding-left: 20px;
}

/* Icon animation on hover */
.drawer ul li a:hover i {
  transform: scale(1.2) rotate(8deg);
  color: #667eea;
}

/* Active item with premium gradient */
.drawer ul li.active a {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  position: relative;
}

.drawer ul li.active a::before {
  width: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
}

.drawer ul li.active a::after {
  height: 100%;
  width: 4px;
  background: rgba(255, 255, 255, 0.4);
}

.drawer ul li.active a:hover {
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateX(2px);
}

.drawer ul li.active a i {
  color: #ffffff;
}

.drawer ul li.active a:hover i {
  color: #ffffff;
  transform: scale(1.15) rotate(5deg);
}

/* Icon spacing with enhanced transitions */
.drawer ul li a i {
  margin-right: 14px;
  font-size: 18px;
  width: 22px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Span positioning */
.drawer ul li a span:not(.badge-nouveau) {
  position: relative;
  z-index: 1;
  flex: 1;
}

/* Premium badge with glow effect */
.badge-nouveau {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  animation: pulseGlow 2s infinite;
  box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4), 0 0 20px rgba(245, 87, 108, 0.2);
  position: relative;
  z-index: 1;
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4), 0 0 20px rgba(245, 87, 108, 0.2);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(245, 87, 108, 0.6), 0 0 30px rgba(245, 87, 108, 0.4);
  }
}

/* Collapsed drawer adjustments */
.drawer.collapsed ul li a {
  justify-content: center;
  padding: 14px 12px;
}

.drawer.collapsed ul li a i {
  margin-right: 0;
}

.drawer.collapsed ul li a:hover {
  padding-left: 12px;
}

/* Restore icon margin on hover when collapsed */
.drawer.collapsed:hover ul li a i {
  margin-right: 14px;
}

.drawer.collapsed:hover ul li a {
  justify-content: flex-start;
  padding-left: 16px;
}

.drawer.collapsed:hover ul li a:hover {
  padding-left: 20px;
}

/* ===== END PREMIUM NAVIGATION ===== */

/* Premium Store Header */
.store-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  height: 60px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.store-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  margin-right: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s;
}

.store-logo:hover {
  transform: scale(1.05) rotate(5deg);
}

/* ### Drawer LOGO ### */

/* When drawer is collapsed */
.drawer.collapsed .logo-full { display: none; }
.drawer.collapsed .logo-collapsed { display: block; }
 
/* When drawer is expanded */
.drawer .logo-full { display: block; }
.drawer .logo-collapsed { display: none; }

/* When collapsed but hovered (fake expanded) */
.drawer.collapsed:hover .logo-full { display: block; }
.drawer.collapsed:hover .logo-collapsed { display: none; }

.store-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #a0aec0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Navigation */
.drawer ul {
  list-style: none;
  margin-top: 24px;
  padding: 0 12px;
  flex-grow: 1;
}

/* Premium Footer with gradient */
.drawer-footer {
  padding: 20px 16px;
  text-align: center;
  font-size: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
  opacity: 0.9;
}

.drawer-footer .version {
  font-size: 11px;
  color: #718096;
  font-weight: 500;
}

/* Topbar layout */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1100;
}

.topbar .left-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logo {
  height: 35px;
  width: auto;
}

/* Right section */
.topbar .right-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Circle buttons (mobile only) */
.circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.circle-store-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffefef;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.circle-btn i {
  font-size: 16px;
  color: #374151;
}

.circle-store-btn i {
  font-size: 16px;
  color: var(--color-primary);
}

.circle-btn:hover {
  background: #e2e8f0;
}

.circle-store-btn:hover {
  background: #e2e8f0;
}

/* Desktop only */
.desktop-only { display: flex; }

/* Mobile only */
.mobile-only { display: none; }

/* Logo size */
.topbar-logo {
  height: 35px;
  width: auto;
}

/* Default: hidden on desktop */
.topbar-logo { display: none; }

/* Mobile search bar (hidden by default) */
.mobile-search-bar {
  display: none;
  align-items: center;
  padding: 13.5px 12px;
  background: #fff;
  color: #000;
  box-shadow: 0 4px 12px var(--color-shadow);
  z-index: 1200;
}

.mobile-search-bar i {
  font-size: 18px;
  margin-right: 10px;
  cursor: pointer;
  color: #000;
}

.mobile-search-bar input {
  flex: 1;
  padding: 12px 10px;
  height: 44px;
  border: none;
  border-radius: 6px;
  background: #f9f9f9;
  color: #000;
  font-size: 14px;
  box-sizing: border-box;
}

.mobile-search-bar input::placeholder {
  color: #888;
}

.mobile-search-bar input:focus {
  background: #e2e8f0;
  outline: none;
}

.store-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  display: none;
  min-width: 220px;
  padding: 10px;
  z-index: 2000;
}

.dropdown-menu.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  border-radius: 6px;
  text-align: left;
}

#storeName {
  text-transform: uppercase;
}

.dropdown-item:hover {
  background: var(--color-primary);
  color: #ffff;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile behavior */
@media (max-width: 768px) {
  .mobile-search-bar {
    display: none;
  }
  .mobile-search-bar.active {
    display: flex;
  }
  .topbar.hide-on-search {
    display: none;
  }

  .dropdown-menu {
    top: calc(100% + 30px);
    right: -60px;
  }
}

/* Mobile only */
@media (max-width: 768px) {
  .topbar-logo { display: block; }
}

/* Responsive rules */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .drawer {
    transform: translateX(-100%);
    width: 260px;
  }
  .drawer.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
  }
  .drawer.collapsed + .main {
    margin-left: 0;
  }
}

/* Overlay when drawer is open (mobile) */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  z-index: 900;
  backdrop-filter: blur(4px);
}

.drawer-overlay.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

/* ===== Mobile Drawer ===== */
@media (max-width: 768px) {
  .drawer {
    left: -260px;
    z-index: 1000;
  }
  .drawer.open {
    left: 0;
  }
  .main {
    margin-left: 0 !important;
  }
  .overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    backdrop-filter: blur(4px);
  }
  .overlay.active {
    display: block;
  }
}

@media (min-width: 769px) {
  .overlay { display: none !important; }
  .drawer.open { transform: none; }
}

/* Tablet behavior */
@media (min-width: 769px) and (max-width: 1024px) {
  .drawer {
    transform: translateX(-100%);
    width: 260px;
    transition: transform 0.3s ease;
    z-index: 1100;
  }

  .drawer.open {
    transform: translateX(0);
  }

  /* Overlay */
  .drawer-overlay.active {
    display: block !important;
    background: rgba(0, 0, 0, 0.5);
  }

  /* Collapsed: content shrinks (desktop only, not overlay mode) */
  .drawer.collapsed ~ .main {
    margin-left: 80px;
  }a/* ===== Drawer (Desktop & Mobile) ===== */
.drawer {
  width: 260px;
  background: linear-gradient(180deg, #1a1d29 0%, #0f111a 100%);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 1000; /* Desktop drawer */
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Keep floss behind drawer */
.floss {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 500; /* lower than drawer on desktop */
}

/* Collapse drawer */
.drawer.collapsed {
  width: 80px;
}

/* Expand drawer on hover */
.drawer.collapsed:hover {
  width: 260px;
}

/* Show hidden text when hovered */
.drawer.collapsed:hover .store-name,
.drawer.collapsed:hover li span {
  display: inline;
  animation: fadeInText 0.3s ease-in-out;
}

/* Collapsed drawer (icon-only) */
.drawer.collapsed .store-name,
.drawer.collapsed li span {
  display: none;
}

/* Mobile drawer */
@media (max-width: 768px) {
  .drawer {
    transform: translateX(-100%);
    width: 260px;
    z-index: 1100; /* above everything */
  }
  .drawer.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0 !important;
  }

  /* Overlay */
  .drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    z-index: 1050;
    backdrop-filter: blur(4px);
  }

  .drawer-overlay.active {
    display: block;
  }

  /* Keep floss above drawer on mobile if needed */
  .floss {
    z-index: 1200;
  }
}

/* Desktop: keep drawer above main but floss behind */
@media (min-width: 769px) {
  .drawer {
    z-index: 1000; /* drawer above main content */
  }
  .floss {
    z-index: 500; /* behind drawer */
  }
}


  .drawer:not(.collapsed) ~ .main {
    margin-left: 0;
  }
}