/* ============================================
   BUTTER ME — Design System
   Premium Shopee Affiliate Showcase
   ============================================ */

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

/* --- CSS Variables --- */
:root {
  /* Colors - Butter Theme */
  --primary: #FFD93D;
  --primary-dark: #F6C90E;
  --primary-light: #FFF3C4;
  --accent: #FF9F43;
  --accent-dark: #E17A2D;
  --danger: #FF6B6B;
  --success: #10B981;
  --info: #3B82F6;

  /* Neutrals */
  --bg-main: #FEFCF3;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-dark: #1A1A2E;
  --text-primary: #1A1A2E;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border: #F3F0E8;
  --border-hover: #E8E3D6;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.06);
  --shadow-glow: 0 0 30px rgba(255, 217, 61, 0.3);
  --shadow-card-hover: 0 14px 36px rgba(0,0,0,0.1), 0 6px 12px rgba(0,0,0,0.06);

  /* Typography */
  --font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

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

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Background Decoration --- */
body::before {
  content: '';
  position: fixed;
  top: -200px;
  right: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,217,61,0.15) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed;
  bottom: -150px;
  left: -150px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,159,67,0.1) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

/* ============================================
   HEADER / NAVBAR
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-lg);
  transition: box-shadow var(--duration-normal) var(--ease-out);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(255,159,67,0.3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Search bar */
.search-container {
  position: relative;
}

.search-input {
  width: 220px;
  padding: 10px 16px 10px 40px;
  background: var(--bg-main);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--duration-normal) var(--ease-out);
}

.search-input:focus {
  width: 280px;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(255,217,61,0.15);
}

.search-input::placeholder {
  color: var(--text-muted);
}

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

.btn-admin {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--bg-main);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--duration-normal) var(--ease-out);
}

.btn-admin:hover {
  border-color: var(--primary);
  color: var(--accent-dark);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-lg) var(--space-2xl);
  text-align: center;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--primary-light);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-lg);
  animation: fadeInDown 0.6s var(--ease-out);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: var(--space-md);
  animation: fadeInUp 0.6s var(--ease-out) 0.1s both;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
  animation: fadeInUp 0.6s var(--ease-out) 0.2s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
  animation: fadeInUp 0.6s var(--ease-out) 0.3s both;
}

.hero-stat {
  text-align: center;
}

.hero-stat .number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}

.hero-stat .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* ============================================
   CATEGORY FILTERS
   ============================================ */
.categories-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-xl);
}

.categories-scroll {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex-shrink: 0;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap;
  user-select: none;
}

.category-chip:hover {
  border-color: var(--primary);
  color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.category-chip.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,159,67,0.3);
}

/* ============================================
   PRODUCT GRID
   ============================================ */
.products-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-3xl);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.product-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-lg);
}

/* ============================================
   PRODUCT CARD
   ============================================ */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
}

.product-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), box-shadow var(--duration-normal) var(--ease-out), border-color var(--duration-normal) var(--ease-out);
}

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

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

.product-image {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f6f0, #f0ece2);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.product-image .placeholder-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--primary-light), #fff);
}

.discount-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(255,107,107,0.3);
}

.product-info {
  padding: var(--space-md);
}

.product-category-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(255,159,67,0.1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-pricing {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.product-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--danger);
}

.product-original-price {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.btn-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-out);
  box-shadow: 0 2px 8px rgba(255,159,67,0.2);
}

.btn-buy:hover {
  box-shadow: 0 4px 16px rgba(255,159,67,0.4);
  transform: translateY(-1px);
}

.btn-buy:active {
  transform: translateY(0);
}

/* ============================================
   PRODUCT DETAIL MODAL
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

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

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-2xl);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalSlideUp var(--duration-normal) var(--ease-spring);
}

.modal-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  background: linear-gradient(135deg, #f8f6f0, #f0ece2);
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-body {
  padding: var(--space-xl);
}

.modal-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(255,159,67,0.1);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: var(--space-md);
}

.modal-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.modal-pricing {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.modal-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--danger);
}

.modal-original-price {
  font-size: 1rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.modal-discount {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.modal-actions {
  display: flex;
  gap: var(--space-md);
}

.modal-actions .btn-buy {
  flex: 1;
  padding: 14px;
  font-size: 0.95rem;
}

.btn-close-modal {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: all var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
}

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

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  grid-column: 1 / -1;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
}

.footer-logo {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: var(--space-sm);
}

.footer-logo .highlight {
  background: linear-gradient(135deg, var(--accent), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--duration-fast);
}

.footer-links a:hover {
  color: var(--accent);
}

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

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f0ece2 25%, #faf7ef 50%, #f0ece2 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--bg-dark);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  animation: toastIn var(--duration-normal) var(--ease-spring);
  max-width: 320px;
}

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

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

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Small phones */
@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .product-info {
    padding: var(--space-sm);
  }

  .product-name {
    font-size: 0.8rem;
  }

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

  .btn-buy {
    padding: 10px;
    font-size: 0.75rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .search-input {
    width: 140px;
  }

  .search-input:focus {
    width: 180px;
  }
}

/* Phones */
@media (max-width: 639px) {
  .navbar-inner {
    height: 56px;
  }

  .logo {
    font-size: 1.2rem;
  }

  .logo-icon {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .hero {
    padding: var(--space-2xl) var(--space-md) var(--space-xl);
  }

  .hero-stats {
    gap: var(--space-lg);
  }

  .hero-stat .number {
    font-size: 1.4rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .categories-section {
    padding: 0 var(--space-md) var(--space-lg);
  }

  .products-section {
    padding: 0 var(--space-md) var(--space-2xl);
  }

  .modal {
    max-height: 95vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin-top: auto;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .btn-admin span {
    display: none;
  }

  .btn-admin {
    padding: 9px 12px;
  }
}

/* Tablets */
@media (min-width: 640px) and (max-width: 1023px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Large desktop */
@media (min-width: 1400px) {
  .product-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ============================================
   ADMIN PAGE STYLES
   ============================================ */
.admin-container {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

/* Password Gate */
.password-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

.password-card {
  background: var(--bg-card);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.password-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: var(--space-sm);
}

.password-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-xl);
}

.password-card .logo-icon {
  width: 56px;
  height: 56px;
  font-size: 1.8rem;
  margin: 0 auto var(--space-lg);
}

.input-group {
  margin-bottom: var(--space-md);
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-align: left;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-main);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all var(--duration-normal) var(--ease-out);
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,217,61,0.15);
  background: var(--bg-card);
}

.input-field::placeholder {
  color: var(--text-muted);
}

textarea.input-field {
  resize: vertical;
  min-height: 80px;
}

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-out);
  box-shadow: 0 2px 8px rgba(255,159,67,0.2);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(255,159,67,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  padding: 10px 20px;
  background: var(--bg-main);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--duration-normal) var(--ease-out);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--accent-dark);
}

.btn-danger {
  padding: 8px 16px;
  background: rgba(255,107,107,0.1);
  color: var(--danger);
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

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

.btn-edit {
  padding: 8px 16px;
  background: rgba(59,130,246,0.1);
  color: var(--info);
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

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

/* Admin Panel */
.admin-panel {
  display: none;
}

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

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.admin-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
}

.admin-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.admin-tab {
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--duration-fast);
  background: none;
}

.admin-tab:hover {
  color: var(--text-primary);
}

.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.admin-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  border: 1px solid var(--border);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.admin-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.image-preview {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--bg-main);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: var(--space-sm);
  transition: border-color var(--duration-normal);
}

.image-preview:hover {
  border-color: var(--primary);
}

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

.image-preview .placeholder {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.image-preview .placeholder span {
  display: block;
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

/* Product list table */
.product-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast);
}

.product-list-item:last-child {
  border-bottom: none;
}

.product-list-item:hover {
  background: rgba(255,217,61,0.05);
}

.product-list-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-main);
}

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

.product-list-info {
  flex: 1;
  min-width: 0;
}

.product-list-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-list-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.product-list-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* Category Management */
.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.category-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
}

.category-item .remove-cat {
  background: none;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0;
  line-height: 1;
  transition: color var(--duration-fast);
}

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

.add-category-row {
  display: flex;
  gap: var(--space-sm);
}

.add-category-row .input-field {
  flex: 1;
}

.add-category-row button {
  flex-shrink: 0;
}

/* Upload button */
.upload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-main);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--duration-normal);
  margin-top: var(--space-sm);
}

.upload-btn:hover {
  border-color: var(--primary);
  color: var(--accent-dark);
  background: var(--primary-light);
}

.upload-btn input[type="file"] {
  display: none;
}

/* Responsive admin */
@media (max-width: 639px) {
  .admin-container {
    padding: var(--space-md);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .product-list-item {
    flex-wrap: wrap;
  }

  .product-list-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
