/* ═══════════════════════════════════════════════
   3D PRINTHUB — MODERN DESIGN SYSTEM
   ═══════════════════════════════════════════════ */

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

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card2: #1a1a26;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(99,102,241,0.5);
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99,102,241,0.25);
  --text: #f1f0ff;
  --text-muted: #9090b0;
  --text-dim: #5a5a7a;
  --success: #10b981;
  --error: #ef4444;
  --warn: #f59e0b;
  --radius: 16px;
  --radius-sm: 10px;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-accent: 0 0 40px rgba(99,102,241,0.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  max-width: 100vw;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ── SALE BANNER ── */
.sale-banner {
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899, #8b5cf6, #6366f1);
  background-size: 300% 100%;
  animation: bannerSlide 6s ease infinite;
  overflow: hidden;
  height: 34px;
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}

@keyframes bannerSlide {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.banner-content {
  display: flex;
  gap: 80px;
  animation: scrollText 18s linear infinite;
  white-space: nowrap;
}

.banner-text {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: white;
}

@keyframes scrollText {
  from { transform: translateX(100vw); }
  to { transform: translateX(-100%); }
}

/* ── SITE HEADER WRAPPER (sticky: banner + header together) ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── HEADER ── */
.header {
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: var(--shadow-accent);
}

.logo h1 {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 11px;
  border-radius: 7px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(99,102,241,0.1);
}

.nav-badge {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
  display: none;
}

.nav-badge.show { display: inline-block; }

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 4rem 2rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.2) 0%, transparent 60%),
    radial-gradient(circle at 80% 50%, rgba(139,92,246,0.1) 0%, transparent 50%),
    var(--bg);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-content {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero-content h2 {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  color: var(--text);
  margin-bottom: 20px;
}

.hero-content h2 span {
  background: linear-gradient(135deg, var(--accent-light), #e879f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 500px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}

.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 6px 30px rgba(99,102,241,0.6);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(99,102,241,0.05);
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.3);
}

.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ── FILTER BAR ── */
.filter-bar {
  max-width: 1400px;
  margin: 0 auto 32px;
  padding: 0 2rem;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.filter-count {
  background: rgba(255,255,255,0.1);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
}

/* ── PRODUCTS ── */
.products-section {
  padding: 0 0 80px;
}

.section-header {
  max-width: 1400px;
  margin: 0 auto 32px;
  padding: 0 2rem;
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.section-header h3 {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
}

.section-count {
  font-size: 14px;
  color: var(--text-dim);
}

.products-grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ── PRODUCT CARD ── */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  animation: fadeInUp 0.4s ease both;
}

.product-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), var(--shadow-accent);
}

.product-card.out-of-stock {
  opacity: 0.75;
  /* Always clickable — no pointer-events:none */
}

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

.product-image {
  height: 220px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-card2);
  position: relative;
  overflow: hidden;
}

.product-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,15,0.6) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
}

.product-card:hover .product-image::after { opacity: 1; }

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 6px;
  z-index: 2;
}

.discount-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #ec4899;
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 2;
}

.out-of-stock-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(239,68,68,0.9);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  z-index: 2;
}

.wishlist-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(10,10,15,0.8);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 2;
  backdrop-filter: blur(8px);
}

.wishlist-btn:hover, .wishlist-btn.wishlisted {
  color: #ec4899;
  border-color: #ec4899;
  background: rgba(236,72,153,0.15);
}

.product-info {
  padding: 12px 14px 14px;
}

.product-info h3 {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-light);
  font-family: var(--font-head);
}

.product-stars {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 12px;
}
.product-stars .stars { color: #f59e0b; letter-spacing: 1px; font-size: 11px; }
.product-stars .count { color: var(--text-dim); font-size: 11px; }

.product-colors-preview {
  display: flex;
  gap: 4px;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  outline: 1px solid var(--border);
}

/* ── MODAL ── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 16px;
}

.modal.active { display: flex; }

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 100%;
  max-width: 960px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  position: relative;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

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

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.close-btn:hover { background: rgba(255,255,255,0.15); color: var(--text); }

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 480px;
}

.modal-image-container {
  position: relative;
  background: var(--bg-card2);
}

.modal-image {
  width: 100%;
  height: 100%;
  min-height: 380px;
  background-size: cover;
  background-position: center;
}

.modal-wishlist-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(10,10,15,0.8);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all var(--transition);
}

.modal-wishlist-btn:hover, .modal-wishlist-btn.wishlisted {
  color: #ec4899;
  border-color: #ec4899;
  background: rgba(236,72,153,0.2);
}

.modal-details {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.modal-details h2 {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.modal-price {
  display: flex;
  align-items: center;
  gap: 12px;
}

.price {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-light);
}

.discount-badge {
  background: rgba(236,72,153,0.2);
  border: 1px solid rgba(236,72,153,0.4);
  color: #ec4899;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

/* ── COLOR PICKER ── */
.color-section h3,
.modal-sizes h3 {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg-card2);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.color-chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.color-chip.active {
  border-color: var(--accent);
  background: rgba(99,102,241,0.1);
  color: var(--text);
}

.color-chip.out-of-stock {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

.color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.color-stock-info {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 2px;
}

/* ── SIZE BUTTONS ── */
.size-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.size-btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.size-btn:hover, .size-btn.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(99,102,241,0.1);
}

.modal-description p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.modal-specs ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-specs li {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
}

.modal-specs li strong { color: var(--text-dim); font-weight: 500; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.modal-actions .btn { flex: 1; justify-content: center; }

/* Mobile actions bar — hidden on desktop */
.modal-actions-mobile { display: none; }

/* ── SIMILAR PRODUCTS ── */
.similar-products-section {
  border-top: 1px solid var(--border);
  padding: 24px 32px;
}

.similar-products-section h3 {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.similar-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.similar-product-item {
  cursor: pointer;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.similar-product-item:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.similar-product-image {
  height: 100px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-card2);
}

.similar-product-item p {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── TOAST ── */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: white;
  min-width: 240px;
  backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.3s ease;
  pointer-events: auto;
  border: 1px solid transparent;
}

.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { background: rgba(16,185,129,0.9); border-color: rgba(16,185,129,0.3); }
.toast-error { background: rgba(239,68,68,0.9); border-color: rgba(239,68,68,0.3); }
.toast-info { background: rgba(99,102,241,0.9); border-color: rgba(99,102,241,0.3); }
.toast-warn { background: rgba(245,158,11,0.9); border-color: rgba(245,158,11,0.3); }

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 60px 2rem 40px;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h4 {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.footer-section p, .footer-section li {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-section ul { list-style: none; }
.footer-section a { color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.footer-section a:hover { color: var(--accent-light); }

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* ── CHECKOUT ── */
.checkout-page { padding: 40px 2rem; max-width: 1100px; margin: 0 auto; }
.checkout-page h1 {
  font-family: var(--font-head);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 32px;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

.checkout-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.checkout-card h2 {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea { min-height: 100px; resize: vertical; }

.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

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

.cart-item-image {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-card2);
  flex-shrink: 0;
}

.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cart-item-info p { font-size: 13px; color: var(--text-muted); }
.cart-item-price { font-weight: 700; color: var(--accent-light); font-size: 15px; }

.remove-item {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color var(--transition);
}
.remove-item:hover { color: var(--error); }

.cart-total {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.total-row.grand {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  font-family: var(--font-head);
  margin-top: 12px;
}

/* ── ADMIN PANEL ── */
.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}

.admin-login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.admin-login-box .logo-icon {
  width: 64px;
  height: 64px;
  font-size: 32px;
  margin: 0 auto 24px;
}

.admin-login-box h1 {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.admin-login-box p { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar .logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-nav { list-style: none; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-link:hover, .sidebar-link.active {
  color: var(--text);
  background: rgba(99,102,241,0.08);
  border-left-color: var(--accent);
}

.sidebar-link .icon { font-size: 18px; width: 20px; text-align: center; }

.admin-main {
  padding: 32px;
  overflow-y: auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.admin-header h1 {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
}

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.stat-icon { font-size: 28px; margin-bottom: 12px; }
.stat-value {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.stat-label { font-size: 13px; color: var(--text-muted); }
.stat-change { font-size: 12px; margin-top: 8px; font-weight: 600; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--error); }

/* ── ADMIN TABLE ── */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.admin-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-card-header h2 {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
}

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

.admin-table th {
  padding: 12px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}

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

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── COLOR STOCK TABLE ── */
.stock-bar {
  width: 80px;
  height: 6px;
  background: var(--bg-card2);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.stock-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.stock-high { background: var(--success); }
.stock-mid { background: var(--warn); }
.stock-low { background: var(--error); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-warn { background: rgba(245,158,11,0.15); color: var(--warn); }
.badge-error { background: rgba(239,68,68,0.15); color: var(--error); }
.badge-info { background: rgba(99,102,241,0.15); color: var(--accent-light); }

/* ── INLINE EDIT ── */
.inline-input {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 13px;
  width: 80px;
  transition: border-color var(--transition);
  outline: none;
}

.inline-input:focus { border-color: var(--accent); }

/* ── TABS ── */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

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

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

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── FORMS IN ADMIN ── */
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.admin-form-group { display: flex; flex-direction: column; gap: 6px; }
.admin-form-group label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.admin-form-group input,
.admin-form-group select,
.admin-form-group textarea {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition);
}

.admin-form-group input:focus,
.admin-form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── COLOR PREVIEW ── */
.color-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-preview-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid var(--border);
  transition: background 0.2s;
}

/* ── RESPONSIVE ── */
/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE / TABLET / DESKTOP
   ══════════════════════════════════════════ */

/* Hamburger button — hidden on desktop */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  flex-shrink: 0;
}

/* ── TABLET (≤ 1024px) ── */
@media (max-width: 1024px) {
  .header-content { padding: 0 1.2rem; }
  .nav-link { padding: 8px 8px; font-size: 13px; }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    padding: 0 1.2rem;
  }
  .filter-bar { padding: 0 1.2rem; }
  .hero-content h2 { font-size: 34px; }
}

/* ── HAMBURGER TRIGGER (≤ 768px) ── */
@media (max-width: 768px) {
  .mobile-nav-toggle { display: block; }

  .nav {
    position: fixed;
    top: 0;
    left: 0; right: 0;
    background: rgba(10,10,15,0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 16px;
    z-index: 98;
    transform: translateY(-110%);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    flex-wrap: nowrap;
    width: 100%;
    /* Push down below the sticky site-header dynamically via JS */
  }
  .nav.open { transform: translateY(0); }
  .nav-link {
    padding: 14px 20px;
    font-size: 15px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    justify-content: space-between;
    width: 100%;
  }
  .nav-link:last-child { border-bottom: none; }

  .header-content { padding: 0 1rem; height: 58px; }
  .logo h1 { font-size: 17px; }
  .logo-icon { width: 34px; height: 34px; font-size: 16px; }

  /* Checkout */
  .checkout-grid { grid-template-columns: 1fr; }
  .checkout-page { padding: 20px 1rem; }

  /* Admin */
  .admin-layout { grid-template-columns: 1fr !important; }
  .admin-sidebar {
    position: fixed !important;
    left: -280px !important;
    top: 0; height: 100vh;
    width: 260px; z-index: 999;
    transition: left 0.3s ease;
    display: block !important;
  }
  .admin-sidebar.open { left: 0 !important; box-shadow: 4px 0 40px rgba(0,0,0,0.6); }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── MOBILE (≤ 480px) ── */
@media (max-width: 480px) {
  /* ─ Products Grid ─ */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 0.75rem;
  }
  .product-image { height: 145px; }
  .product-info { padding: 9px 10px 11px; }
  .product-info h3 { font-size: 12px; line-height: 1.3; }
  .product-price { font-size: 13px; }
  .product-badge { font-size: 9px; padding: 3px 7px; }
  .filter-bar { padding: 0 0.75rem; gap: 6px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .filter-btn { font-size: 12px; padding: 6px 10px; white-space: nowrap; flex-shrink: 0; }

  /* ─ Search Bar ─ */
  .search-wrap { padding: 0 0.75rem !important; }

  /* ─ Product Modal ─ */
  .modal { align-items: flex-end; padding: 0; }
  .modal-content {
    margin: 0;
    border-radius: 20px 20px 0 0;
    max-height: 93vh;
    width: 100%;
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  @keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  /* modal-body is the ONE scrollable zone — it contains image + details + reviews */
  .modal-body {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: unset;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .modal-image-container { flex-shrink: 0; }
  .modal-image {
    min-height: 200px !important;
    max-height: 220px;
    border-radius: 20px 20px 0 0;
  }
  .modal-details {
    padding: 14px 16px 16px !important;
    gap: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .modal-details h2 { font-size: 16px !important; margin-bottom: 0; padding-right: 36px; }
  /* Desktop actions hidden on mobile */
  .modal-actions-desktop { display: none !important; }
  /* Reviews sit inside modal-details, natural flow */
  #reviewsSection { margin-top: 20px !important; }
  /* Similar products compact */
  .similar-products-section { padding: 12px 0 8px; }
  .similar-products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  /* Sticky buy buttons pinned at bottom, OUTSIDE modal-body */
  .modal-actions-mobile {
    display: flex !important;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 10px 14px env(safe-area-inset-bottom, 16px);
    gap: 8px;
    z-index: 5;
  }
  .modal-actions-mobile .btn { flex: 1; justify-content: center; font-size: 13px; padding: 12px 10px; }
  /* Close btn */
  .close-btn {
    position: absolute; top: 10px; right: 10px;
    width: 32px; height: 32px; font-size: 14px;
    z-index: 20;
  }

  /* ─ Hero ─ */
  .hero { min-height: 260px; padding: 66px 1rem 32px; }
  .hero-content h2 { font-size: 22px; line-height: 1.2; }
  .hero-content p { font-size: 13px; }
  .hero-actions { flex-direction: column; gap: 8px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-tag { font-size: 11px; }

  /* ─ General Sections ─ */
  .products-section { padding: 16px 0; }
  .section-header { padding: 0 0.75rem; margin-bottom: 10px; }
  .sale-banner { font-size: 11px; }

  /* ─ Admin Panel Mobile ─ */
  .admin-main { padding: 12px !important; }
  .admin-header {
    padding: 10px 12px !important;
    min-height: 52px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .admin-header h1 { font-size: 17px !important; }

  /* Refresh dropdown — position left on mobile so it doesn't go off screen */
  #refreshMenu { right: auto !important; left: 0 !important; min-width: 180px !important; }

  /* Stats grid: 2 col on phone */
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .stat-card { padding: 14px 12px !important; }
  .stat-value { font-size: 22px !important; }

  /* Admin cards */
  .admin-card { border-radius: 14px; }
  .admin-card-header { padding: 14px 16px 10px !important; }
  .admin-card-header h2 { font-size: 15px !important; }

  /* Tables — horizontal scroll, compact cells */
  .admin-table { font-size: 12px; }
  .admin-table th, .admin-table td { padding: 8px 10px !important; }
  /* Hide less important columns on mobile */
  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3) { display: none; } /* Gramm/Stk col in products */

  /* Forms — single column */
  .admin-form-grid { grid-template-columns: 1fr !important; }
  .admin-form-group { margin-bottom: 10px; }
  .admin-form-group input,
  .admin-form-group select,
  .admin-form-group textarea { font-size: 16px !important; } /* prevent iOS zoom */

  /* Buttons in tables */
  .btn-sm { font-size: 11px !important; padding: 5px 8px !important; }

  /* Sort list items */
  .sort-item { padding: 8px 10px !important; }

  /* Order cards */
  .order-card { padding: 12px 14px; }
  .order-card-header { flex-direction: column; align-items: flex-start; gap: 4px; }

  /* Small modal */
  .small-modal { padding: 12px; align-items: flex-end; }
  .small-modal-box {
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 24px 20px !important;
    max-height: 88vh;
    overflow-y: auto;
  }

  /* Charts */
  .charts-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .chart-container { height: 180px; }

  /* Account page */
  .account-page { padding: 20px 0.75rem; }
  .account-nav { gap: 6px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .account-nav-btn { font-size: 12px; padding: 7px 12px; white-space: nowrap; flex-shrink: 0; }

  /* Checkout */
  .checkout-page { padding: 16px 0.75rem; }
  .checkout-card { padding: 16px; }
}

/* ── PAGE TRANSITIONS ── */
.page-fade { animation: pageFade 0.4s ease; }
@keyframes pageFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══ ACCOUNT / AUTH ══ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 1rem;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
}
.auth-card h1 { font-family: var(--font-head); font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.auth-card p.sub { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 28px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.auth-tab { flex: 1; padding: 10px; text-align: center; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-muted); background: var(--bg-card2); transition: all 0.2s; border: none; }
.auth-tab.active { background: var(--accent); color: white; }

/* Split layout responsive */
@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr !important; gap: 32px !important; padding: 32px 1.2rem 40px !important; }
  .auth-benefits { order: 2; }
  .auth-card { order: 1; max-width: 100% !important; }
  .auth-benefits h2 { font-size: 28px !important; }
}
.account-page { max-width: 800px; margin: 0 auto; padding: 40px 1rem; }
.account-nav { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.account-nav-btn { padding: 8px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card2); color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.account-nav-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.order-card { background: var(--bg-card2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 12px; }
.order-card-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.star-input { display: flex; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
.star-input input { display: none; }
.star-input label { font-size: 28px; cursor: pointer; color: var(--border); transition: color 0.15s; }
.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label { color: #f59e0b; }
.review-card { background: var(--bg-card2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; }
.stars-display { color: #f59e0b; letter-spacing: 2px; }
