/* ==========================================
   DESIGN SYSTEM & VARIABLES
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Colors */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.1);
  --whatsapp: #25d366;
  --whatsapp-hover: #128c7e;
  --whatsapp-light: rgba(37, 211, 102, 0.1);
  
  /* Light Mode Palette */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.8);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --ring: rgba(99, 102, 241, 0.2);
  --glass-bg: rgba(255, 255, 255, 0.4);
  --glass-border: rgba(255, 255, 255, 0.6);
  
  /* Status Colors */
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glass: inset 0 1px 0 0 rgba(255, 255, 255, 0.15);

  /* Dimensions */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-full: 9999px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
  --bg-app: #090d16;
  --bg-card: #131b2e;
  --bg-header: rgba(19, 27, 46, 0.8);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --ring: rgba(129, 140, 248, 0.3);
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);
  --shadow-glass: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

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

button {
  cursor: pointer;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================
   APP HEADER
   ========================================== */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: var(--text-main);
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: white;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.logo-highlight {
  color: var(--primary);
}

/* Search bar */
.search-wrapper {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.75rem;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
  background: var(--bg-card);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

/* Actions Menu */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border);
  position: relative;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-card);
}

.admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.admin-nav-btn:hover {
  background: var(--text-main);
  color: var(--bg-card);
  border-color: var(--text-main);
}

/* ==========================================
   APP CONTENT PANELS & VIEWS
   ========================================== */
.app-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
}

.view-section {
  display: none;
  animation: fadeIn var(--transition-normal);
}

.view-section.active {
  display: block;
}

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

/* ==========================================
   STOREFRONT: HERO & CATEGORIES
   ========================================== */
.hero-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(129, 140, 248, 0.03) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.hero-info {
  max-width: 600px;
  position: relative;
  z-index: 2;
}

.hero-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  transition: all var(--transition-fast);
}

.hero-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.hero-image {
  max-width: 40%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: none;
}

@media(min-width: 768px) {
  .hero-image {
    display: block;
  }
}

/* Category Filters */
.filters-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

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

.category-pill {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.category-pill:hover, .category-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.results-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================
   PRODUCT GRID & CARDS
   ========================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
}

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

.product-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  background: #f1f5f9;
  overflow: hidden;
}

.product-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

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

.product-category-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(15, 23, 42, 0.7);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

.product-details {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title-row {
  margin-bottom: 0.5rem;
}

.product-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.product-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  font-family: 'Outfit', sans-serif;
}

.product-stock {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-app);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
}

.product-stock.out-of-stock {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  font-weight: 600;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0 1.25rem 1.25rem 1.25rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-app);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

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

.btn-whatsapp {
  background: var(--whatsapp-light);
  color: var(--whatsapp);
  border: 1px solid var(--whatsapp);
}

.btn-whatsapp:hover {
  background: var(--whatsapp);
  color: white;
}

.btn-whatsapp:disabled, .btn-primary:disabled {
  background: var(--border) !important;
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
  cursor: not-allowed;
}

/* ==========================================
   SLIDING CART DRAWER
   ========================================== */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

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

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 450px;
  height: 100vh;
  background: var(--bg-card);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

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

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

.cart-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
}

.cart-close-btn {
  font-size: 1.5rem;
  color: var(--text-muted);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.cart-close-btn:hover {
  background: var(--bg-app);
  color: var(--text-main);
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80%;
  color: var(--text-muted);
  text-align: center;
  gap: 1rem;
}

.cart-empty-icon {
  font-size: 4rem;
  opacity: 0.3;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
}

.cart-item-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cart-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.cart-item-price {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 700;
}

.qty-controls {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-width: fit-content;
  margin-top: 0.5rem;
}

.qty-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  background: var(--bg-app);
  transition: background var(--transition-fast);
}

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

.qty-val {
  width: 30px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.cart-item-remove {
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  align-self: flex-start;
  padding: 0.25rem;
}

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

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-app);
}

.cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.cart-summary-label {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.cart-summary-value {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
}

.checkout-btn {
  width: 100%;
  background: var(--whatsapp);
  color: white;
  padding: 0.875rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: all var(--transition-fast);
}

.checkout-btn:hover {
  background: var(--whatsapp-hover);
  transform: translateY(-2px);
}

/* ==========================================
   PRODUCT DETAILS MODAL
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  padding: 2rem 1rem;
  overflow-y: auto;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  width: 100%;
  max-width: 800px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  transform: scale(0.95);
  transition: transform var(--transition-normal);
  margin: auto;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 2.25rem;
  height: 2.25rem;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: background var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(15, 23, 42, 0.8);
}

.details-modal-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media(min-width: 768px) {
  .details-modal-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.details-img-panel {
  background: #f1f5f9;
  position: relative;
  padding-top: 100%;
}

@media(min-width: 768px) {
  .details-img-panel {
    padding-top: 0;
    height: 100%;
    min-height: 400px;
  }
}

.details-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.details-info-panel {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.details-category {
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.details-title {
  font-size: 1.75rem;
  line-height: 1.2;
}

.details-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
}

.details-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.details-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.details-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.details-meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.details-meta-val {
  font-weight: 600;
}

.details-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ==========================================
   ADMIN PORTAL
   ========================================== */

/* Login Card */
.admin-login-wrapper {
  max-width: 420px;
  margin: 6rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-login-header {
  text-align: center;
}

.admin-login-logo {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input {
  padding: 0.75rem 1rem;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
  background: var(--bg-card);
}

.login-btn {
  width: 100%;
  margin-top: 0.5rem;
}

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
  background: rgba(239, 68, 68, 0.1);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  display: none;
}

/* Dashboard Layout */
.admin-dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media(min-width: 992px) {
  .admin-dashboard-layout {
    grid-template-columns: 240px 1fr;
  }
}

.admin-sidebar {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

@media(min-width: 992px) {
  .admin-sidebar {
    flex-direction: column;
    overflow-x: visible;
    padding-bottom: 0;
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding-right: 1.5rem;
  }
}

.admin-sidebar-title {
  display: none;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

@media(min-width: 992px) {
  .admin-sidebar-title {
    display: block;
  }
}

.admin-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  width: auto;
  color: var(--text-muted);
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

@media(min-width: 992px) {
  .admin-sidebar-btn {
    width: 100%;
  }
}

.admin-sidebar-btn:hover, .admin-sidebar-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.admin-sidebar-btn.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.admin-panel {
  display: none;
  animation: fadeIn var(--transition-normal);
}

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

/* Dashboard Panel Metrics */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.metric-icon-box {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.metric-card.green .metric-icon-box {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.metric-card.yellow .metric-icon-box {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.metric-details {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Dashboard Table List */
.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.admin-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
}

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

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-app);
  padding: 1rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(99, 102, 241, 0.02);
}

.admin-table-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
}

.admin-product-cell {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-product-info {
  display: flex;
  flex-direction: column;
}

.admin-product-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.admin-product-category {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

.action-icon-btn {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.action-icon-btn.edit {
  background: var(--primary-light);
  color: var(--primary);
}

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

.action-icon-btn.delete {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

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

/* Settings Forms */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media(min-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.settings-card-title {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
}

/* Form Modals styling */
.admin-modal-body {
  padding: 2rem;
}

.admin-modal-title {
  margin-bottom: 1.5rem;
  color: var(--text-main);
  font-size: 1.5rem;
}

.admin-modal-footer {
  padding: 1.25rem 2rem;
  background: var(--bg-app);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  border-top: 1px solid var(--border);
}

.img-preview-box {
  width: 100%;
  height: 180px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background: var(--bg-app);
}

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

.img-preview-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.img-preview-placeholder i {
  font-size: 2rem;
}

/* ==========================================
   TOASTS / NOTIFICATIONS
   ========================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-card);
  color: var(--text-main);
  border-left: 4px solid var(--primary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  transform: translateX(-120%);
  animation: slideInLeft var(--transition-normal) forwards;
}

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

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

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

@keyframes slideInLeft {
  to { transform: translateX(0); }
}

.toast.fade-out {
  animation: fadeOutLeft var(--transition-normal) forwards;
}

@keyframes fadeOutLeft {
  to { transform: translateX(-120%); opacity: 0; }
}

/* ==========================================
   FOOTER
   ========================================== */
.main-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 2rem;
  text-align: center;
  margin-top: auto;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

@media(min-width: 768px) {
  .footer-container {
    flex-direction: row;
  }
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-link:hover {
  color: var(--primary);
}

/* ==========================================
   IMAGE GALLERY & UPLOADER STYLES
   ========================================== */
.thumbnails-container {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  overflow-x: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 5;
  scrollbar-width: thin;
}

.thumbnails-container::-webkit-scrollbar {
  height: 4px;
}

.thumbnails-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

.thumbnail-item {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.thumbnail-item.active {
  border-color: var(--primary);
}

.upload-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-app);
}

.upload-dropzone:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.img-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.preview-thumb-card {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f8fafc;
}

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

.preview-thumb-card .delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(239, 68, 68, 0.85);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast);
  padding: 0;
}

.preview-thumb-card:hover .delete-btn {
  opacity: 1;
}

/* Card image navigation buttons (visible on hover) */
.card-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
  z-index: 10;
  font-size: 1.1rem;
  padding: 0;
}

.card-nav-btn:hover {
  background: var(--primary);
  transform: translateY(-50%) scale(1.1);
}

.product-img-wrapper:hover .card-nav-btn {
  opacity: 1;
}

.card-nav-btn.prev {
  left: 8px;
}

.card-nav-btn.next {
  right: 8px;
}

/* ==========================================
   RESPONSIVE PRODUCT GRID (MOBILE & TABLET ROW VIEW)
   ========================================== */
@media (max-width: 992px) {
  .app-content {
    padding: 1.25rem 1rem;
  }
  
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  
  .product-details {
    padding: 0.875rem;
  }
  
  .product-desc {
    display: none; /* Hide product description to maintain grid balance and vertical uniformity */
  }
  
  .product-title {
    font-size: 0.95rem;
  }
  
  .product-price {
    font-size: 1.1rem;
  }
  
  .product-stock {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
  }
  
  .product-actions {
    padding: 0 0.875rem 0.875rem 0.875rem;
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .hero-banner {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-desc {
    font-size: 0.95rem;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .product-actions .btn-primary .btn-text {
    display: none; /* Hide 'Add to Cart' text on smaller screens */
  }
  
  .product-actions {
    grid-template-columns: 1fr 1fr;
    padding: 0 0.75rem 0.75rem 0.75rem;
    gap: 0.375rem;
  }
  
  .product-actions .btn-primary,
  .product-actions .btn-secondary {
    padding: 0.5rem;
    justify-content: center;
  }
  
  .product-price-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .app-content {
    padding: 0.75rem 0.5rem;
  }
}

/* Connection warning banner styling */
.connection-warning-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #d97706;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  animation: fadeIn var(--transition-normal);
}

[data-theme="dark"] .connection-warning-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
  border-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.connection-warning-banner i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.connection-warning-banner code {
  background: rgba(245, 158, 11, 0.15);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 600;
}
