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

/* --- Modern Theme variables --- */
:root {
  --font-main: 'Plus Jakarta Sans', sans-serif;

  /* Premium Dark Mode Colors (Default) */
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-primary: #6366f1;
  --accent-secondary: #d946ef;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-glow: rgba(99, 102, 241, 0.25);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.15);
  --info: #0ea5e9;
  --info-glow: rgba(14, 165, 233, 0.15);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #a855f7;
  --input-bg: rgba(17, 24, 39, 0.6);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 8px 16px -4px rgba(0, 0, 0, 0.3), 0 4px 8px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(168, 85, 247, 0.2);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  --header-height: 85px;

  /* Transparent overlay variable bindings */
  --header-bg: rgba(17, 24, 39, 0.7);
  --card-bg: rgba(17, 24, 39, 0.65);
  --drawer-bg: rgba(17, 24, 39, 0.9);
  --modal-bg: rgba(17, 24, 39, 0.95);
  --img-bg: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  --hero-banner-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(217, 70, 239, 0.12) 50%, rgba(9, 13, 22, 0.95) 100%), var(--bg-secondary);
  --hero-title-color: linear-gradient(to right, #f9fafb, #d1d5db);
}

/* Light Mode Variables */
body.light-theme {
  --bg-primary: #f3f4f6;
  --bg-secondary: #ffffff;
  --bg-tertiary: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #6366f1;
  --input-bg: #f9fafb;
  --shadow-md: 0 10px 20px -5px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.08);

  --header-bg: rgba(255, 255, 255, 0.85);
  --card-bg: #ffffff;
  --drawer-bg: rgba(255, 255, 255, 0.98);
  --modal-bg: rgba(255, 255, 255, 0.98);
  --img-bg: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
  --hero-banner-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(217, 70, 239, 0.08) 50%, rgba(255, 255, 255, 0.95) 100%), var(--bg-secondary);
  --hero-title-color: linear-gradient(to right, #111827, #374151);
}

/* --- Base Reset & Defaults --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

input, select, textarea, button {
  font-family: inherit;
  color: inherit;
  outline: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- App Shell Layout --- */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Premium Header / Navbar --- */
.global-header {
  height: var(--header-height);
  background-color: var(--header-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 50px;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

body.light-theme .global-header {
  background-color: rgba(255, 255, 255, 0.75);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}

.brand-logo::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
}

.brand-section:hover .brand-logo::before {
  left: 100%;
}

.brand-name {
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.5px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Global Search Component */
.search-wrapper {
  position: relative;
  width: 360px;
}

.search-wrapper input {
  width: 100%;
  padding: 12px 18px 12px 46px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.search-wrapper input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15), inset 0 2px 4px rgba(0,0,0,0.1);
  background-color: var(--bg-secondary);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 16px;
}

/* Theme, Cart, Switcher Controllers */
.theme-toggle, .cart-trigger {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  color: var(--text-primary);
  font-size: 18px;
}

.theme-toggle:hover, .cart-trigger:hover {
  background: var(--bg-tertiary);
  transform: translateY(-3px);
  border-color: var(--text-muted);
}

.cart-trigger {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--accent-secondary);
  color: white;
  font-size: 11px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(217, 70, 239, 0.4);
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Sliding Role Swapper */
.role-switch-container {
  display: flex;
  background-color: var(--input-bg);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  position: relative;
}

.role-tab {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.role-tab.active {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.role-tab.active.admin-mode-active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

/* --- View Toggle Logic --- */
.view-panel {
  display: none;
  flex: 1;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
}

/* --- BUYER VIEWPORT --- */
.buyer-content {
  padding: 50px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Elegant Hero Banner */
.hero-banner {
  background: var(--hero-banner-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 350px;
  height: 350px;
  background: var(--accent-gradient);
  filter: blur(140px);
  opacity: 0.2;
  border-radius: 50%;
}

.hero-text {
  max-width: 650px;
  z-index: 2;
}

.hero-tag {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(217, 70, 239, 0.2) 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #d946ef;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1.5px;
  background: var(--hero-title-color);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 18px;
  margin-bottom: 30px;
  font-weight: 400;
}

.hero-btn {
  background: var(--accent-gradient);
  color: white;
  padding: 16px 36px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35);
  transition: all var(--transition-normal);
}

.hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.55);
}

/* Category Filters Navigation */
.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.category-list {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.category-pill {
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.category-pill:hover, .category-pill.active {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(168, 85, 247, 0.25);
  transform: translateY(-2px);
}

.sort-select {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.sort-select:focus {
  border-color: var(--border-focus);
}

/* Product Cards Showcase Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 32px;
}

/* Premium Product Card */
.product-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: rgba(168, 85, 247, 0.4);
}

.product-img-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
  background: var(--img-bg);
}

.product-svg-art {
  width: 100%;
  height: 100%;
  opacity: 0.9;
  transition: transform var(--transition-normal);
}

.product-card:hover .product-svg-art {
  transform: scale(1.12);
}

.product-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--warning);
  color: var(--warning);
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.out-of-stock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.out-of-stock-badge {
  background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
  color: white;
  padding: 10px 22px;
  font-weight: 800;
  font-size: 14px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  box-shadow: 0 8px 16px rgba(244, 63, 94, 0.3);
}

.product-card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category {
  font-size: 12px;
  color: var(--accent-secondary);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.product-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.35;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.product-title:hover {
  color: var(--accent-secondary);
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--warning);
  margin-bottom: 20px;
}

.product-rating .review-count {
  color: var(--text-muted);
}

.product-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.product-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.btn-add-cart {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 16px;
}

.btn-add-cart:hover {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  transform: scale(1.1);
  box-shadow: 0 8px 16px rgba(168, 85, 247, 0.35);
}

/* --- CART DRAWER OVERLAY & SIDEBAR --- */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.cart-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  right: -480px;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--drawer-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--border-color);
  box-shadow: -15px 0 40px rgba(0,0,0,0.6);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transition: right var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-drawer-overlay.open .cart-drawer {
  right: 0;
}

.cart-header {
  padding: 30px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-header h3 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.cart-close-btn {
  font-size: 24px;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.cart-close-btn:hover {
  color: var(--danger);
}

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cart-empty-message {
  text-align: center;
  color: var(--text-muted);
  margin-top: 60px;
  font-size: 15px;
}

.cart-item {
  display: flex;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.cart-item-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-img svg {
  width: 85%;
  height: 85%;
}

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cart-item-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.35;
}

.cart-item-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-secondary);
  margin-bottom: 10px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qty-controls {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  padding: 3px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.qty-btn:hover {
  background: var(--bg-secondary);
}

.qty-val {
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
}

.cart-item-remove {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.cart-item-remove:hover {
  color: var(--danger);
}

.cart-footer {
  padding: 30px;
  border-top: 1px solid var(--border-color);
  background: rgba(9, 13, 22, 0.4);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
}

.cart-summary-row.total-row {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-primary);
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
}

.cart-btn-checkout {
  background: var(--accent-gradient);
  color: white;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 16px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.35);
  transition: all var(--transition-normal);
}

.cart-btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(168, 85, 247, 0.55);
}

/* --- MODAL DIALOGS --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--modal-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: scaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-box.modal-large {
  max-width: 900px;
}

.modal-header {
  padding: 30px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.modal-body {
  padding: 30px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 20px 30px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

/* Forms layout inside Modals */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-group-full {
  grid-column: span 2;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-group input, .form-group select, .form-group textarea {
  padding: 12px 16px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.45);
}

/* Detail modal UI layout */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
}

.detail-img {
  width: 100%;
  height: 360px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.detail-img svg {
  width: 95%;
  height: 95%;
}

.detail-info {
  display: flex;
  flex-direction: column;
}

.detail-category {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-secondary);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.detail-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.25;
}

.detail-price {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.detail-desc {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 28px;
  line-height: 1.65;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 30px;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
}

.detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-meta-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.detail-meta-value {
  font-size: 15px;
  font-weight: 700;
}

/* --- TAB LAYOUT --- */
.tab-navigation {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.buyer-nav-tab {
  padding: 14px 28px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-secondary);
  position: relative;
  transition: all var(--transition-fast);
}

.buyer-nav-tab.active {
  color: var(--text-primary);
}

.buyer-nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
}

.sub-panel {
  display: none;
}

.sub-panel.active {
  display: block;
}

/* --- ADMIN VIEWPORT --- */
.admin-shell {
  display: flex;
  flex: 1;
}

/* Premium Admin Sidebar */
.admin-sidebar {
  width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.admin-menu-header {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 2px;
  padding-left: 14px;
  margin-bottom: 12px;
}

.admin-menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 14px;
  transition: all var(--transition-fast);
  width: 100%;
  text-align: left;
}

.admin-menu-item:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  transform: translateX(4px);
}

.admin-menu-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
  color: var(--accent-primary);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Admin Main Section Content */
.admin-main {
  flex: 1;
  padding: 50px;
  overflow-y: auto;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.admin-title-desc h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.75px;
}

.admin-title-desc p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Admin Dashboard Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.stat-icon-box {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon-box.revenue-box {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.stat-icon-box.orders-box {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.stat-icon-box.products-box {
  background: rgba(14, 165, 233, 0.12);
  color: var(--info);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.stat-icon-box.warning-box {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

/* Charts / Recent Activity grid */
.dashboard-details-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
}

.dashboard-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}

.dashboard-card-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

/* SVG dynamic mini chart variables */
.chart-container {
  height: 250px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 15px;
  border-bottom: 2px solid var(--border-color);
}

.chart-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 14%;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar-fill {
  width: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 1s ease-out;
  min-height: 6px;
  position: relative;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

.chart-bar-fill:hover::after {
  content: attr(data-value);
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.chart-bar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* CRUD Tables layout styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  padding: 18px 16px;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-table td {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.admin-table tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

body.light-theme .admin-table tr:hover {
  background: rgba(0, 0, 0, 0.01);
}

.table-product-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.table-product-thumbnail {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.table-product-thumbnail svg {
  width: 85%;
  height: 85%;
}

.table-product-name {
  font-weight: 700;
  font-size: 15px;
}

/* Badge components */
.badge {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

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

.badge-info {
  background: rgba(14, 165, 233, 0.12);
  color: var(--info);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.badge-secondary {
  background: rgba(156, 163, 175, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(156, 163, 175, 0.2);
}

.actions-cell {
  display: flex;
  gap: 8px;
}

.btn-action-edit {
  color: var(--info);
  background: rgba(14, 165, 233, 0.1);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.btn-action-delete {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.btn-action-edit:hover {
  background: var(--info);
  color: white;
}

.btn-action-delete:hover {
  background: var(--danger);
  color: white;
}

/* Order Tables dropdown */
.status-dropdown {
  padding: 6px 10px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.status-dropdown:focus {
  border-color: var(--border-focus);
}

/* --- KEYFRAME ANIMATIONS --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Toast Notifications styling */
.toast-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: var(--bg-secondary);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 320px;
  animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsiveness adjustments */
@media(max-width: 1024px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-details-row {
    grid-template-columns: 1fr;
  }
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .detail-img {
    height: 280px;
  }
}

@media(max-width: 768px) {
  .global-header {
    padding: 0 24px;
    height: 75px;
  }
  .search-wrapper {
    display: none;
  }
  .hero-banner {
    padding: 40px 30px;
    flex-direction: column;
    text-align: center;
  }
  .hero-title {
    font-size: 36px;
  }
  .admin-shell {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 24px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group-full {
    grid-column: span 1;
  }
  .admin-main {
    padding: 24px;
  }
}
