/* ==========================================================================
   STORE APPLICATION - SENIOR RESPONSIVE DESIGN SYSTEM (DESKTOP, TABLET, MOBILE)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Primary & Brand */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;

  /* Neutrals & Surfaces */
  --bg-app: #f8fafc;
  --surface-card: #ffffff;
  --surface-subtle: #f1f5f9;
  --border-light: #e2e8f0;
  --border-focus: #cbd5e1;

  /* Typography */
  --text-dark: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Semantic Colors */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-text: #065f46;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-text: #991b1b;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-text: #92400e;
  --info: #0284c7;
  --info-bg: #f0f9ff;
  --info-text: #075985;

  /* Elevation Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 16px 24px -6px rgba(79, 70, 229, 0.14);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
}

/* Container */
.container {
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-normal);
  width: 100%;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  gap: 0.75rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--text-dark);
  flex-shrink: 0;
}

.brand-icon {
  width: 2.2rem;
  height: 2.2rem;
  background: linear-gradient(135deg, var(--primary-600), #8b5cf6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
  flex-shrink: 0;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--primary-50);
  color: var(--primary-600);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary-50);
  color: var(--primary-700);
  border: 1px solid var(--primary-200);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.pwa-install-btn:hover {
  background: var(--primary-100);
  color: var(--primary-800);
}

.nav-links-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary-600);
  background-color: var(--primary-50);
}

.nav-link.active {
  color: var(--primary-600);
  background-color: var(--primary-100);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface-subtle);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.user-role-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-role-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.mobile-menu-btn {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--text-dark);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

/* Mobile Slide-Over Drawer */
.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mobile-drawer-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  background: #ffffff;
  z-index: 1000;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-drawer.active {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.mobile-drawer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-drawer-links .nav-link {
  font-size: 0.95rem;
  padding: 0.7rem 0.9rem;
  width: 100%;
}

/* Mobile Bottom Navigation Bar (Flawless App Bar) */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3.75rem;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-light);
  z-index: 1000 !important;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.25rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.08);
}

.mobile-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-family: inherit;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  height: 100%;
  transition: color var(--transition-fast);
  text-align: center;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.mobile-bottom-item.active {
  color: var(--primary-600);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  min-height: 2.4rem;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.775rem;
  min-height: 1.85rem;
  border-radius: var(--radius-sm);
}

.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  min-height: 1.5rem;
  border-radius: var(--radius-sm);
  gap: 0.25rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  min-height: 2.75rem;
  border-radius: var(--radius-lg);
}

.btn-primary {
  background-color: var(--primary-600);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-700);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--surface-card);
  color: var(--text-body);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: var(--surface-subtle);
  border-color: var(--border-focus);
  color: var(--text-dark);
}

.btn-danger {
  background-color: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background-color: var(--danger);
  color: #fff;
}

.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   CARDS & SURFACES
   ========================================================================== */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  padding: 0.85rem 1.25rem;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border-light);
}

/* ==========================================================================
   STATS WIDGETS
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-title {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.03em;
  margin-top: 0.1rem;
}

/* ==========================================================================
   HORIZONTAL CHIPS SCROLLBAR (MOBILE/TABLET)
   ========================================================================== */
.horizontal-chips-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.2rem 0 0.65rem 0;
  margin-bottom: 1.25rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.horizontal-chips-bar::-webkit-scrollbar {
  display: none;
}

.chip-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-body);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-fast);
}

.chip-item:hover,
.chip-item.active {
  background: var(--primary-600);
  color: #fff;
  border-color: var(--primary-600);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.chip-item.active .chip-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.chip-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  color: var(--text-muted);
}

/* ==========================================================================
   PRODUCT CATALOG & GRID
   ========================================================================== */
.catalog-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.filter-sidebar {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: sticky;
  top: 5rem;
  box-shadow: var(--shadow-xs);
}

.filter-group {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.filter-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.filter-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.55rem;
  margin-bottom: 0.15rem;
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.filter-category-item:hover,
.filter-category-item.active {
  background-color: var(--primary-50);
  color: var(--primary-600);
  font-weight: 600;
}

.filter-badge {
  font-size: 0.725rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-200);
}

.product-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 75%;
  background: #f8fafc;
  overflow: hidden;
  cursor: pointer;
}

.product-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

.product-badge-group {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 2;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.badge-discount {
  background: #ef4444;
  color: #fff;
}

.badge-featured {
  background: #f59e0b;
  color: #fff;
}

.badge-stock-in {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-stock-out {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.product-zoom-btn {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
  z-index: 3;
  transition: all var(--transition-fast);
}

.product-zoom-btn:hover {
  background: var(--primary-600);
  color: #fff;
}

/* Card Gallery Controls (Prev/Next, Dots, Counter, Swipe) */
.product-img-wrapper {
  touch-action: pan-y pinch-zoom;
}

.card-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 1.85rem;
  height: 1.85rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-dark);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 4;
  opacity: 0.85;
  transition: all var(--transition-fast);
}

.card-nav-btn:hover {
  opacity: 1;
  background: #ffffff;
  transform: translateY(-50%) scale(1.1);
  color: var(--primary-600);
}

.card-nav-btn.prev {
  left: 0.35rem;
}

.card-nav-btn.next {
  right: 0.35rem;
}

.card-gallery-dots {
  position: absolute;
  bottom: 0.45rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.25rem;
  z-index: 4;
  pointer-events: none;
}

.card-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.card-dot.active {
  width: 12px;
  border-radius: 3px;
  background: var(--primary-500);
}

.card-gallery-counter {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  z-index: 4;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.product-info {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-cat-tag {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--primary-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.product-name {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.35;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-name:hover {
  color: var(--primary-600);
}

.product-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.65rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-box {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-light);
}

.price-current {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}

.price-old {
  font-size: 0.775rem;
  color: var(--text-light);
  text-decoration: line-through;
}

/* Product Package & Box Information (Ichida nechta va 1 blok narxi) */
.product-package-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.5rem;
  margin-top: 0.45rem;
}

.package-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem;
  line-height: 1.2;
  width: 100%;
  min-width: 0;
}

.package-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.package-val {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 0.72rem;
  white-space: nowrap;
  text-align: right;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.package-val.package-price {
  color: var(--primary-700);
  font-weight: 800;
  font-size: 0.73rem;
}

.product-admin-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border-light);
  width: 100%;
}

.product-admin-actions .edit-btn {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.product-admin-actions .del-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.product-admin-actions .btn-icon-only {
  width: 2.1rem;
  height: 1.95rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.btn-spinner {
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.4rem;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   PRODUCT DETAILS VIEW
   ========================================================================== */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  align-items: start;
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.image-showcase {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.main-image-container {
  position: relative;
  width: 100%;
  height: 320px;
  background: #f8fafc;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-image-container img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.image-zoom-overlay {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  backdrop-filter: blur(4px);
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.thumb-item {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.thumb-item.active,
.thumb-item:hover {
  border-color: var(--primary-600);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  max-width: 800px;
  margin: 0 auto;
}

.form-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
  width: 100%;
}

.form-action-buttons .btn-cancel {
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  text-align: center;
  justify-content: center;
}

.form-action-buttons .btn-submit {
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  text-align: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .form-action-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    width: 100% !important;
    margin-top: 1.5rem !important;
  }

  .form-action-buttons .btn-submit {
    order: 1 !important;
    width: 100% !important;
    justify-content: center !important;
    padding: 0.85rem 1rem !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25) !important;
  }

  .form-action-buttons .btn-cancel {
    order: 2 !important;
    width: 100% !important;
    justify-content: center !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    border-radius: var(--radius-md) !important;
  }
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.35rem;
}

.form-label .required {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  color: var(--text-dark);
  background-color: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
  min-height: 2.5rem;
}

.form-control:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}

.form-error {
  font-size: 0.775rem;
  color: var(--danger);
  margin-top: 0.25rem;
  font-weight: 500;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
}

.dropzone-container {
  position: relative;
  border: 1.5px dashed var(--primary-500);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  background: var(--primary-50);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all var(--transition-fast);
  text-align: left;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(79, 70, 229, 0.15);
  user-select: none;
}

.dropzone-container * {
  pointer-events: none;
}

.dropzone-container input[type="file"] {
  pointer-events: auto;
}

.dropzone-container:hover,
.dropzone-container.dragover {
  border-color: var(--primary-700);
  background: #e0e7ff;
}

.dropzone-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  color: var(--primary-600);
}

.dropzone-text-group {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.dropzone-title {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 0.785rem;
  line-height: 1.2;
}

.dropzone-hint {
  font-size: 0.685rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.image-preview-wrapper {
  margin-top: 0.85rem;
  position: relative;
  width: 100%;
  max-width: 280px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  display: none;
}

.image-preview-wrapper img {
  width: 100%;
  height: 170px;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
}

/* ==========================================================================
   FULLSCREEN IMAGE LIGHTBOX MODAL
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 29, 0.95);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 1rem;
}

.lightbox-modal.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  color: #fff;
  font-size: 1.65rem;
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
}

.lightbox-caption {
  color: #fff;
  margin-top: 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 4.5rem;
  right: 1.25rem;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  max-width: 340px;
  animation: toastSlideIn 0.3s ease forwards;
}

.toast.toast-success {
  border-left: 4px solid var(--success);
}

.toast.toast-error {
  border-left: 4px solid var(--danger);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  margin-top: auto;
  background: #fff;
  border-top: 1px solid var(--border-light);
  padding: 1.75rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (TABLET & SMARTPHONE PIXEL-PERFECT FIXES)
   ========================================================================== */

/* Tablet & Smaller (< 992px) */
@media (max-width: 992px) {
  .nav-links-desktop {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .catalog-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .catalog-layout > main {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .filter-sidebar-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
  }

  .filter-sidebar-drawer.active {
    display: block;
  }

  .filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    z-index: 1000;
    border-radius: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .filter-sidebar-drawer.active .filter-sidebar {
    transform: translateX(0);
  }

  .product-detail-layout {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.5rem;
  }
}

/* Mobile Screens (< 768px & < 640px) */
@media (max-width: 768px) {
  .brand-badge {
    display: none;
  }

  .pwa-network-badge {
    padding: 0.35rem;
    border-radius: var(--radius-full);
    min-width: auto;
  }

  .pwa-network-badge .pwa-text {
    display: none;
  }

  .pwa-dot {
    width: 8px;
    height: 8px;
  }

  .user-role-badge {
    padding: 0.22rem 0.5rem;
  }

  .user-role-text {
    font-size: 0.7rem;
  }

  .brand-logo {
    font-size: 1.15rem;
    gap: 0.45rem;
  }

  .brand-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: var(--radius-md);
  }

  /* Compact Product Detail Layout on Mobile */
  .product-detail-layout {
    grid-template-columns: 1fr;
    padding: 0.75rem;
    gap: 1rem;
  }

  .main-image-container {
    padding-top: 0 !important;
    height: 240px !important;
    max-height: 240px !important;
    background: #f8fafc;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-image-container img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .thumb-item {
    width: 3rem;
    height: 3rem;
  }

  .gallery-slider-btn {
    width: 2.1rem;
    height: 2.1rem;
  }

  .form-card {
    padding: 1.25rem 0.85rem;
    border-radius: var(--radius-lg);
  }

  .dropzone-container {
    padding: 0.75rem 0.85rem;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px)) !important; /* Room for bottom bar */
  }

  .mobile-bottom-bar {
    display: flex !important;
    z-index: 1000 !important;
  }

  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .navbar {
    padding: 0.5rem 0;
  }

  .brand-logo {
    font-size: 1.1rem;
    letter-spacing: -0.02em;
  }

  /* Compact 2-column Product Grid on Mobile */
  .products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .product-card {
    border-radius: var(--radius-md);
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden;
  }

  .product-info {
    padding: 0.5rem 0.45rem !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .product-name {
    font-size: 0.85rem;
    line-height: 1.3;
    margin-bottom: 0.2rem;
    word-break: break-word;
  }

  .product-desc {
    display: none;
  }

  .product-price-box {
    padding-top: 0.35rem;
    min-width: 0;
  }

  .price-current {
    font-size: 0.9rem;
    word-break: break-word;
  }

  .price-old {
    font-size: 0.7rem;
  }

  .product-package-info {
    padding: 0.25rem 0.35rem !important;
    gap: 0.15rem !important;
    margin-top: 0.3rem !important;
    border-radius: var(--radius-sm);
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .package-row {
    gap: 0.15rem;
    min-width: 0;
  }

  .package-label {
    font-size: 0.6rem;
  }

  .package-val {
    font-size: 0.65rem;
  }

  .package-val.package-price {
    font-size: 0.65rem;
    font-weight: 700;
  }

  .product-admin-actions {
    margin-top: 0.45rem;
    padding-top: 0.35rem;
  }

  .product-admin-actions .btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.725rem;
    min-height: 1.6rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  .stat-card {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .stat-icon {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1rem;
  }

  .stat-title {
    font-size: 0.68rem;
  }

  .stat-value {
    font-size: 1.1rem;
  }

  .form-card {
    padding: 1.15rem;
    border-radius: var(--radius-lg);
  }

  .toast-container {
    bottom: 4.5rem;
    right: 0.75rem;
    left: 0.75rem;
  }

  .toast {
    max-width: 100%;
  }
}

/* ==========================================================================
   PWA & OFFLINE-READY STYLES
   ========================================================================== */
.pwa-network-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.pwa-network-badge.online {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pwa-network-badge.offline {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.pwa-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.pwa-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.pwa-dot.offline {
  background: #d97706;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

.pwa-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.pwa-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #ffffff;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-dark);
  animation: slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.3s ease;
  max-width: 360px;
}

.pwa-toast.toast-success {
  border-left: 4px solid var(--success);
}

.pwa-toast.toast-warning {
  border-left: 4px solid #f59e0b;
}

.pwa-toast.toast-info {
  border-left: 4px solid var(--primary-600);
}

@keyframes slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   MULTI-IMAGE GALLERY & SLIDER CONTROLS
   ========================================================================== */
.gallery-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-dark);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 5;
  transition: all 0.2s ease;
}

.gallery-slider-btn:hover {
  background: #ffffff;
  transform: translateY(-50%) scale(1.1);
  color: var(--primary-600);
}

.gallery-slider-btn.prev {
  left: 0.75rem;
}

.gallery-slider-btn.next {
  right: 0.75rem;
}

.gallery-counter-pill {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  backdrop-filter: blur(4px);
  z-index: 5;
}

.gallery-dots {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 5;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

.gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-dot.active {
  background: #ffffff;
  width: 16px;
  border-radius: 4px;
}

/* 5-Slot Photo Upload Grid */
.photo-slots-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.photo-slot-card {
  position: relative;
  aspect-ratio: 1;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  border: 1.5px dashed var(--border-light);
  background: var(--surface-subtle);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin: 0 auto;
  width: 100%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(79, 70, 229, 0.15);
  user-select: none;
}

.photo-slot-card:hover {
  border-color: var(--primary-600);
  background: var(--primary-50);
}

.photo-slot-card.has-image {
  border-style: solid;
  border-color: var(--primary-500);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.slot-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.2rem;
  text-align: center;
  pointer-events: none;
}

.slot-plus-icon {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.slot-plus-icon i {
  width: 0.8rem !important;
  height: 0.8rem !important;
  pointer-events: none;
}

.slot-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.1;
  white-space: nowrap;
  pointer-events: none;
}

.slot-preview-state {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.slot-preview-state img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.slot-badge-main,
.slot-badge-num {
  position: absolute;
  top: 2px;
  left: 2px;
  background: var(--primary-600);
  color: #ffffff;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  z-index: 2;
  line-height: 1.2;
  pointer-events: none;
}

.slot-badge-num {
  background: rgba(15, 23, 42, 0.75);
}

.slot-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
  touch-action: manipulation;
  pointer-events: auto;
}

.photo-slot-card.has-image .slot-file-input {
  z-index: 5;
  pointer-events: auto;
}

.slot-delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  background: rgba(239, 68, 68, 0.95);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  z-index: 20;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  pointer-events: auto !important;
  touch-action: manipulation;
}

/* Multi-preview Grid for Create & Edit Forms */
.multi-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 0.5rem;
}

.multi-preview-item {
  position: relative;
  aspect-ratio: 1;
  max-width: 76px;
  max-height: 76px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: #f8fafc;
}

.multi-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.multi-preview-item .main-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  background: var(--primary-600);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}

.multi-preview-item .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
}

.delete-gallery-toggle {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(239, 68, 68, 0.95);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 0;
  cursor: pointer;
  user-select: none;
}

/* Lightbox Modal Multi-Image Enhancements */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrapper {
  max-width: 100%;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.lightbox-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 3.25rem;
  height: 3.25rem;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  z-index: 100;
}

.lightbox-nav-btn:hover {
  background: #f1f5f9;
  transform: translateY(-50%) scale(1.1);
  color: var(--primary-600);
}

.lightbox-nav-btn.prev {
  left: 1.5rem;
}

.lightbox-nav-btn.next {
  right: 1.5rem;
}

.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  font-size: 1.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.lightbox-close:hover {
  background: rgba(239, 68, 68, 0.9);
}

.lightbox-bottom-bar {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  color: #ffffff;
}

.lightbox-caption {
  font-size: 0.95rem;
  font-weight: 700;
}

.lightbox-counter {
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
  .lightbox-nav-btn {
    width: 2.65rem;
    height: 2.65rem;
    font-size: 1.2rem;
    background: #ffffff;
    color: #0f172a;
  }
  .lightbox-nav-btn.prev {
    left: 0.5rem;
  }
  .lightbox-nav-btn.next {
    right: 0.5rem;
  }
  .lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.4rem;
  }
}

/* ==========================================================================
   CUSTOM PAGINATION & SVG BOUNDS
   ========================================================================== */
nav[role="navigation"] svg {
  width: 1.15rem !important;
  height: 1.15rem !important;
  max-width: 1.15rem !important;
  max-height: 1.15rem !important;
  display: inline-block;
}

.custom-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-dark);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.page-nav-btn:hover:not(.disabled) {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
  transform: translateY(-1px);
}

.page-nav-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--surface-subtle);
  border-color: var(--border-light);
  color: var(--text-muted);
}

.page-numbers-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.page-num-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-dark);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.page-num-pill:hover:not(.active):not(.dots) {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
}

.page-num-pill.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.page-num-pill.dots {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: default;
}

@media (max-width: 640px) {
  .nav-btn-text {
    display: none;
  }
  .page-nav-btn {
    padding: 0.5rem 0.65rem;
  }
}

/* Telegram WebApp Native Styling */
.is-telegram-webapp .pwa-install-btn,
.is-telegram-webapp #pwaDrawerInstallBox,
.is-telegram-webapp #pwaNetworkStatus {
  display: none !important;
}

.is-telegram-webapp {
  overscroll-behavior-y: none;
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

.is-telegram-webapp body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px)) !important;
}

.is-telegram-webapp .site-main-content {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}

.is-telegram-webapp .container {
  overflow-x: hidden !important;
  max-width: 100% !important;
  padding-left: 0.65rem !important;
  padding-right: 0.65rem !important;
  box-sizing: border-box !important;
}

.is-telegram-webapp .catalog-layout {
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.is-telegram-webapp .catalog-layout > main {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.is-telegram-webapp .products-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.5rem !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.is-telegram-webapp .product-card {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.is-telegram-webapp .product-info {
  padding: 0.5rem 0.45rem !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.is-telegram-webapp .horizontal-chips-bar {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.is-telegram-webapp .mobile-bottom-bar {
  display: flex !important;
  z-index: 1000 !important;
}

/* ==========================================================================
   CART & TELEGRAM WEBAPP ORDERING SYSTEM
   ========================================================================== */
.cart-floating-bar {
  position: fixed;
  bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px)) !important;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: calc(100% - 1.25rem);
  max-width: 520px;
  background: #0f172a;
  color: #ffffff;
  padding: 0.65rem 1rem;
  border-radius: 9999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: none !important; /* Hidden by default until items are added! */
  opacity: 0;
  pointer-events: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  z-index: 1050 !important;
  transition: opacity 0.25s ease, transform 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.cart-floating-bar.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateX(-50%) translateY(0) !important;
}

@media (max-width: 768px) {
  .cart-floating-bar {
    bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px)) !important;
    width: calc(100% - 1.25rem);
    padding: 0.6rem 0.85rem;
    border-radius: 9999px;
    gap: 0.5rem;
  }

  .cart-bar-icon {
    width: 2.15rem;
    height: 2.15rem;
  }

  .cart-bar-label {
    font-size: 0.65rem;
  }

  .cart-bar-sum {
    font-size: 0.95rem;
  }

  .cart-order-btn {
    padding: 0.55rem 0.95rem;
    font-size: 0.82rem;
    gap: 0.35rem;
  }
}

.is-telegram-webapp .cart-floating-bar {
  bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px)) !important;
}

.cart-bar-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-bar-icon {
  position: relative;
  width: 2.35rem;
  height: 2.35rem;
  background: var(--primary-600);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.cart-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #0f172a;
}

.cart-bar-totals {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.cart-bar-label {
  font-size: 0.725rem;
  color: #94a3b8;
  font-weight: 500;
}

.cart-bar-sum {
  font-size: 1.05rem;
  font-weight: 800;
  color: #38bdf8;
}

.cart-order-btn {
  background: var(--primary-600);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cart-order-btn:hover {
  background: var(--primary-700);
  transform: scale(1.03);
}

/* Card Quantity & Add to Cart Controls */
.card-cart-action {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

.btn-add-cart {
  width: 100%;
  padding: 0.45rem 0.65rem;
  background: var(--primary-50);
  color: var(--primary-700);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-cart:hover {
  background: var(--primary-600);
  color: #fff;
  border-color: var(--primary-600);
}

.cart-qty-selector {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.2rem 0.35rem;
}

.cart-qty-selector.active {
  display: flex;
}

.qty-btn {
  width: 1.75rem;
  height: 1.75rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-dark);
  transition: all 0.15s ease;
  user-select: none;
}

.qty-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-400);
  color: var(--primary-700);
}

.qty-val {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--text-dark);
  min-width: 1.8rem;
  text-align: center;
}

/* Individual Customer Price Badge on Card */
.my-price-badge {
  display: none !important;
}

/* Telegram WebApp Customer Header Chip */
.customer-header-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--primary-50);
  border: 1.5px solid var(--primary-200);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.customer-header-chip:hover {
  background: var(--primary-100);
  border-color: var(--primary-300);
}

/* Customer Profile Modal Popup */
.customer-profile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.customer-profile-overlay.active {
  display: flex !important;
}

.customer-profile-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  position: relative;
  animation: profileCardPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes profileCardPop {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes customerModalPop {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(14px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}



