/* ============================================================
   Z3D — Design System
   Accent: #0055FF | Black: #0D0D0D | White: #FFFFFF
   ============================================================ */

:root {
  --black:       #0D0D0D;
  --white:       #FFFFFF;
  --gray-50:     #F8F8F8;
  --gray-100:    #F2F2F2;
  --gray-200:    #E4E4E4;
  --gray-300:    #C8C8C8;
  --gray-400:    #AAAAAA;
  --gray-600:    #666666;
  --accent:      #0055FF;
  --accent-dark: #003DD4;
  --accent-bg:   rgba(0, 85, 255, 0.07);
  --accent-rgb:  0, 85, 255;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 3px;
  --radius-md: 6px;
  --transition: 160ms cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { display: block; max-width: 100%; }
input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  border: none;
  outline: none;
}

/* ── Typography ── */
h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: 1.2rem; }

/* ── Utilities ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: var(--transition);
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--black);
  border: 1.5px solid var(--gray-200);
}
.btn-outline:hover { border-color: var(--black); }
.btn-ghost {
  background: transparent;
  color: var(--black);
  padding: 10px 20px;
}
.btn-ghost:hover { background: var(--gray-100); }
.btn-full { width: 100%; justify-content: center; }

/* ======================================================
   HEADER
   ====================================================== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 68px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  transition: var(--transition);
}
.header.scrolled {
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 40px;
}
.logo {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.logo span { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-right: auto;
}
.nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  letter-spacing: 0.01em;
  transition: color var(--transition);
  position: relative;
}
.nav a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav a:hover { color: var(--black); }
.nav a:hover::after { width: 100%; }

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: var(--black);
  transition: var(--transition);
}
.cart-btn:hover { background: var(--gray-100); }
.cart-count {
  position: absolute;
  top: 6px; right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: var(--transition);
}
.cart-count.visible {
  opacity: 1;
  transform: scale(1);
}

.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius);
  color: var(--black);
  transition: var(--transition);
}
.theme-toggle:hover {
  background: var(--gray-100);
}
.theme-toggle-floating {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
}
.theme-toggle .theme-icon-light {
  display: none;
}
[data-theme="dark"] .theme-toggle .theme-icon-dark {
  display: none;
}
[data-theme="dark"] .theme-toggle .theme-icon-light {
  display: block;
}

/* ======================================================
   HERO
   ====================================================== */
.hero {
  min-height: 100vh;
  padding: 68px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 68px 24px 0;
  gap: 60px;
}
.hero-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}
.hero-title {
  margin-bottom: 20px;
}
.hero-title span { color: var(--accent); font-style: italic; }
.hero-sub {
  font-size: 1.05rem;
  color: var(--gray-600);
  max-width: 420px;
  margin-bottom: 40px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 14px; align-items: center; }

.hero-visual {
  position: relative;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-bg-text {
  position: absolute;
  font-size: clamp(100px, 14vw, 200px);
  font-weight: 900;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--gray-200);
  user-select: none;
  line-height: 1;
}
.hero-card {
  position: relative;
  z-index: 2;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: 280px;
  box-shadow: var(--shadow-md);
  transform: rotate(-2deg);
}
.hero-card-img {
  width: 100%;
  height: 200px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-card-img svg { opacity: 0.2; }
.hero-card-body { padding: 20px; }
.hero-card-body h4 { font-size: 0.95rem; margin-bottom: 4px; }
.hero-card-body .price { color: var(--accent); font-weight: 700; font-size: 1.1rem; }

.hero-card-2 {
  position: absolute;
  bottom: 40px;
  right: -20px;
  transform: rotate(3deg);
  width: 220px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  z-index: 3;
  box-shadow: var(--shadow-md);
}
.hero-card-2 .label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 8px;
}
.hero-card-2 .val { font-size: 1.8rem; font-weight: 900; line-height: 1; }
.hero-card-2 .val span { color: var(--accent); font-size: 1rem; }

.hero-dot {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.hero-dot:nth-child(1) { top: 80px; left: 40px; opacity: 0.6; }
.hero-dot:nth-child(2) { top: 160px; right: 60px; width: 8px; height: 8px; opacity: 0.4; }
.hero-dot:nth-child(3) { bottom: 100px; left: 100px; width: 6px; height: 6px; opacity: 0.3; }

/* ======================================================
   CATEGORIES BAR
   ====================================================== */
.categories-bar {
  position: sticky;
  top: 68px;
  z-index: 90;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0;
}
.categories-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 58px;
}
.cat-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 2px;
  color: var(--gray-600);
  white-space: nowrap;
  transition: var(--transition);
}
.cat-tab:hover { color: var(--black); background: var(--gray-100); }
.cat-tab.active {
  background: var(--black);
  color: var(--white);
}

.search-wrap {
  position: relative;
  flex-shrink: 0;
}
.search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}
.search-input {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 8px 12px 8px 36px;
  font-size: 0.85rem;
  width: 220px;
  color: var(--black);
  transition: var(--transition);
}
.search-input::placeholder { color: var(--gray-400); }
.search-input:focus {
  background: var(--white);
  box-shadow: 0 0 0 2px var(--accent);
}

/* ======================================================
   PRODUCTS
   ====================================================== */
.products-section {
  padding: 60px 0 80px;
  min-height: 400px;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--gray-200);
  border: 1px solid var(--gray-200);
}

/* Product Card */
.product-card {
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.product-card:hover { background: var(--gray-50); }
.product-card:hover .card-img-wrap img,
.product-card:hover .card-img-wrap .img-placeholder { transform: scale(1.03); }

.card-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--gray-100);
  position: relative;
}
.card-img-wrap img,
.card-img-wrap .img-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}
.img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gray-100);
}
.img-placeholder .ph-logo {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  color: var(--gray-200);
}
.img-placeholder .ph-logo span { color: rgba(var(--accent-rgb), 0.25); }

.card-badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 3px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
}
.badge-new { background: var(--accent); color: var(--white); }
.badge-sale { background: var(--black); color: var(--white); }

.card-body { padding: 16px; }
.card-cat {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 6px;
}
.card-name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.card-desc {
  font-size: 0.8rem;
  color: var(--gray-400);
  line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-price {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.card-add {
  width: 36px; height: 36px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.card-add:hover { background: var(--accent); }
.card-add.added { background: var(--accent); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--gray-400);
}
.empty-state svg { margin: 0 auto 16px; opacity: 0.3; }

/* ======================================================
   ABOUT SECTION
   ====================================================== */
.about-section {
  background: var(--black);
  color: var(--white);
  padding: 100px 0;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.section-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.about-text h2 { color: var(--white); margin-bottom: 20px; }
.about-text p { color: rgba(255,255,255,0.55); line-height: 1.8; font-size: 0.95rem; }

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-left: 1px solid rgba(255,255,255,0.1);
  padding-left: 60px;
}
.stat {}
.stat-num {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-num span { font-size: 2rem; color: var(--accent); }
.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

/* ======================================================
   FOOTER
   ====================================================== */
.footer {
  background: var(--black);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 40px 0;
}
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.footer .logo { color: var(--white); }
.footer-nav {
  display: flex;
  gap: 24px;
}
.footer-nav a {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  transition: color var(--transition);
}
.footer-nav a:hover { color: var(--white); }
.footer-bottom {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.25);
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ======================================================
   CART SIDEBAR
   ====================================================== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
  backdrop-filter: blur(2px);
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-panel {
  position: fixed;
  top: 0; right: 0;
  width: 400px;
  height: 100vh;
  background: var(--white);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.15);
}
.cart-panel.open { transform: translateX(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--gray-200);
}
.cart-header h2 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.cart-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  color: var(--gray-600);
  font-size: 1rem;
  transition: var(--transition);
}
.cart-close:hover { background: var(--gray-100); color: var(--black); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
}
.cart-item-img {
  width: 64px; height: 64px;
  border-radius: var(--radius);
  background: var(--gray-100);
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-img .ci-ph {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--gray-200);
}
.cart-item-info { min-width: 0; }
.cart-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-price { font-size: 0.8rem; color: var(--gray-400); }
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.qty-btn {
  width: 24px; height: 24px;
  border-radius: 2px;
  border: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: var(--black);
  transition: var(--transition);
}
.qty-btn:hover { border-color: var(--black); background: var(--gray-100); }
.qty-num {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}
.cart-item-remove {
  display: block;
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--gray-400);
  cursor: pointer;
  transition: color var(--transition);
}
.cart-item-remove:hover { color: #e00; }

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-total span:first-child { font-size: 0.8rem; color: var(--gray-600); font-weight: 500; }
.cart-total span:last-child { font-size: 1.2rem; font-weight: 700; }

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  color: var(--gray-400);
  font-size: 0.9rem;
  padding: 60px 24px;
}
.cart-empty svg { opacity: 0.25; }

/* ======================================================
   PRODUCT MODAL
   ====================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  backdrop-filter: blur(4px);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--white);
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  border-radius: var(--radius-md);
  transform: scale(0.96) translateY(10px);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: var(--gray-100);
  color: var(--gray-600);
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  font-size: 1rem;
  transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); color: var(--black); }

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.modal-img {
  aspect-ratio: 1;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.modal-img img { width: 100%; height: 100%; object-fit: cover; }
.modal-img .m-ph {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  color: var(--gray-200);
}
.modal-img .m-ph span { color: rgba(var(--accent-rgb), 0.3); }

.modal-info { padding: 40px 36px; display: flex; flex-direction: column; }
.modal-cat {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.modal-name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.25;
}
.modal-desc {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: auto;
  padding-bottom: 28px;
}
.modal-price {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.modal-stock {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stock-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
}
.modal-add { width: 100%; }

/* ======================================================
   TOAST
   ====================================================== */
.toast-wrap {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--black);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 250ms ease;
  box-shadow: var(--shadow-md);
}
.toast .t-accent { color: var(--accent); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ======================================================
   ADMIN — Login
   ====================================================== */
.admin-login {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  padding: 24px;
}
.login-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 48px 44px;
  width: 100%;
  max-width: 400px;
}
.login-logo {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}
.login-logo span { color: var(--accent); }
.login-subtitle {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-bottom: 36px;
}
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-600);
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--black);
  background: var(--white);
  transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--accent); }
.form-input.error { border-color: #e00; }
.form-error { font-size: 0.78rem; color: #e00; margin-top: 6px; display: none; }
.form-error.show { display: block; }

/* ======================================================
   ADMIN — Layout
   ====================================================== */
.admin-layout {
  display: none;
  min-height: 100vh;
  background: var(--gray-50);
}
.admin-layout.show { display: flex; }

.admin-sidebar {
  width: 240px;
  background: var(--black);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar-logo {
  padding: 28px 24px 24px;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.admin-sidebar-logo span { color: var(--accent); }
.admin-sidebar-logo small {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-top: 4px;
}
.admin-nav { padding: 16px 12px; flex: 1; }
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
}
.admin-nav-item svg { flex-shrink: 0; }
.admin-nav-item:hover { color: var(--white); background: rgba(255,255,255,0.07); }
.admin-nav-item.active {
  color: var(--white);
  background: var(--accent);
}
.admin-sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.admin-logout {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: var(--transition);
}
.admin-logout:hover { color: #ff4444; background: rgba(255,68,68,0.1); }

.admin-main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-topbar h1 { font-size: 1rem; font-weight: 700; }
.admin-topbar-right { display: flex; align-items: center; gap: 12px; }

.admin-content { padding: 32px; flex: 1; overflow-y: auto; }

/* Admin stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}
.stat-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 10px;
}
.stat-card-val {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.stat-card-val.accent { color: var(--accent); }

/* Admin products panel */
.admin-panel {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.panel-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-header h2 { font-size: 0.95rem; font-weight: 700; }

/* Products table */
.prod-table {
  width: 100%;
  border-collapse: collapse;
}
.prod-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  border-bottom: 1px solid var(--gray-200);
}
.prod-table td {
  padding: 14px 20px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.prod-table tr:last-child td { border-bottom: none; }
.prod-table tr:hover td { background: var(--gray-50); }

.prod-thumb {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: var(--gray-100);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-thumb .th-ph {
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--gray-300);
}
.prod-name-cell { display: flex; align-items: center; gap: 12px; }
.prod-name-cell strong { font-size: 0.85rem; font-weight: 600; display: block; }
.prod-name-cell span { font-size: 0.75rem; color: var(--gray-400); }

.badge-cat {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: 2px;
  background: var(--gray-100);
  color: var(--gray-600);
}
.table-actions { display: flex; gap: 6px; }
.tbl-btn {
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: var(--transition);
}
.tbl-edit { background: var(--gray-100); color: var(--black); }
.tbl-edit:hover { background: var(--accent); color: var(--white); }
.tbl-del { background: var(--gray-100); color: var(--gray-600); }
.tbl-del:hover { background: #fee2e2; color: #e00; }

/* Admin form */
.admin-form { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.admin-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-form select.form-input { cursor: pointer; }
.form-textarea {
  resize: vertical;
  min-height: 80px;
}
/* Upload button */
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  color: var(--black);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.upload-btn:hover { border-color: var(--accent); color: var(--accent); }
.upload-btn.loading { opacity: 0.6; pointer-events: none; }

/* Upload progress */
.upload-progress {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.upload-bar {
  flex: 1;
  height: 3px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.upload-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: uploadSlide 1.2s ease infinite;
}
@keyframes uploadSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
#uploadStatus {
  font-size: 0.75rem;
  color: var(--gray-600);
  white-space: nowrap;
}

.form-img-preview {
  width: 100%; height: 140px;
  border: 1.5px dashed var(--gray-200);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  margin-top: 8px;
  transition: border-color var(--transition);
}
.form-img-preview:hover { border-color: var(--accent); }
.form-img-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
}
.form-img-preview .preview-ph {
  font-size: 0.8rem;
  color: var(--gray-400);
  text-align: center;
}
.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-200);
}

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle { position: relative; width: 36px; height: 20px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-200);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-label { font-size: 0.82rem; font-weight: 500; cursor: pointer; }

/* ======================================================
   DARK THEME
   ====================================================== */
[data-theme="dark"] {
  color-scheme: dark;
  --black:       #f0f0f0;
  --white:       #131313;
  --gray-50:     #191919;
  --gray-100:    #1f1f1f;
  --gray-200:    #343434;
  --gray-300:    #5a5a5a;
  --gray-400:    #8a8a8a;
  --gray-600:    #b0b0b0;
  --accent-bg:   rgba(0, 119, 255, 0.22);
  --shadow-sm:   0 1px 4px rgba(0, 0, 0, 0.45);
  --shadow-md:   0 8px 28px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .about-section {
  background: #0d0d0d;
  color: #ffffff;
}
[data-theme="dark"] .about-text h2 {
  color: #ffffff;
}
[data-theme="dark"] .about-text p {
  color: rgba(255, 255, 255, 0.55);
}
[data-theme="dark"] .about-stats {
  border-left-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .stat-label {
  color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .footer {
  background: #0d0d0d;
  border-top-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .footer .logo {
  color: #ffffff;
}

[data-theme="dark"] .hero-bg-text {
  -webkit-text-stroke-color: #3a3a3a;
}

[data-theme="dark"] .hero-card-2 {
  background: #1a1a1f;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .hero-card-2 .label {
  color: #8a8a8a;
}
[data-theme="dark"] .hero-card-2 .val span {
  color: var(--accent);
}

[data-theme="dark"] .cat-tab.active {
  background: #f0f0f0;
  color: #121212;
}

[data-theme="dark"] .card-add {
  background: #f0f0f0;
  color: #121212;
}
[data-theme="dark"] .card-add:hover,
[data-theme="dark"] .card-add.added {
  background: var(--accent);
  color: #ffffff;
}

[data-theme="dark"] .badge-sale {
  background: #f0f0f0;
  color: #121212;
}

[data-theme="dark"] .toast {
  background: #e8e8e8;
  color: #111111;
}
[data-theme="dark"] .toast .t-accent {
  color: var(--accent);
}

[data-theme="dark"] .cart-count {
  color: #ffffff;
}

[data-theme="dark"] .admin-sidebar {
  background: #0a0a0a;
}

[data-theme="dark"] .form-input.error {
  border-color: #ff6b6b;
}

[data-theme="dark"] .tbl-del:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ff8a8a;
}

/* ======================================================
   RESPONSIVE
   ====================================================== */
@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-panel { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: calc(68px + 40px);
    padding-bottom: 60px;
  }
  .hero-visual { display: none; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-body { grid-template-columns: 1fr; }
  .modal-img { aspect-ratio: 4/3; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-stats { border-left: none; padding-left: 0; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 40px; }
  .cart-panel { width: 100%; }
  .nav a:not(:first-child) { display: none; }
  .footer-top { flex-direction: column; gap: 24px; text-align: center; }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
}

/* ======================================================
   ANIMATIONS
   ====================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.product-card {
  animation: fadeInUp 300ms ease both;
}
