/* ==========================================================================
   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);
}

.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: 80;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.25rem;
  box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.05);
}

.mobile-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  flex: 1;
  height: 100%;
  transition: color var(--transition-fast);
  text-align: center;
}

.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;
}

.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.35rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.65rem;
  margin-top: 0.55rem;
}

.package-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  line-height: 1.25;
  width: 100%;
}

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

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

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

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

.product-admin-actions .btn {
  flex: 1;
  width: 100%;
  justify-content: center;
}

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

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

.main-image-container {
  position: relative;
  width: 100%;
  padding-top: 85%;
  background: #f1f5f9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  cursor: zoom-in;
}

.main-image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  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-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 {
  border: 2px dashed var(--border-focus);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--surface-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dropzone-container:hover,
.dropzone-container.dragover {
  border-color: var(--primary-600);
  background: var(--primary-50);
}

.dropzone-icon {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 0.5rem;
  color: var(--primary-600);
}

.dropzone-title {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.dropzone-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.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: 1fr;
  }

  .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) {
  .navbar .btn-primary,
  .nav-create-btn,
  .pwa-install-btn {
    display: none !important;
  }

  .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);
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 4.5rem; /* Room for bottom bar */
  }

  .mobile-bottom-bar {
    display: flex;
  }

  .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 {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .product-card {
    border-radius: var(--radius-md);
  }

  .product-info {
    padding: 0.6rem 0.55rem;
  }

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

  .product-desc {
    display: none;
  }

  .product-price-box {
    padding-top: 0.45rem;
  }

  .price-current {
    font-size: 0.95rem;
  }

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

  .product-package-info {
    padding: 0.4rem 0.5rem;
    gap: 0.25rem;
    margin-top: 0.45rem;
    border-radius: var(--radius-sm);
  }

  .package-row {
    gap: 0.25rem;
  }

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

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

  .package-val.package-price {
    font-size: 0.775rem;
  }

  .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;
  }
}
