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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px; line-height: 1.6; color: #333; background: #fafafa;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* === Header & Nav === */
header {
  position: sticky; top: 0; z-index: 100;
  background: #0f172a; backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.05);
}

nav {
  display: flex; align-items: center; gap: 40px;
  max-width: 1240px; margin: 0 auto; padding: 16px 24px;
}
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem; font-weight: 700; color: #fff; letter-spacing: -0.5px;
  white-space: nowrap; display: flex; align-items: center; gap: 0;
}
.logo .logo-icon { color: #f43f5e; font-size: 1.1rem; margin-right: 6px; }
.logo span { color: #f43f5e; font-weight: 700; }

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links > li > a {
  color: rgba(255,255,255,.75); font-size: 0.88rem; font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
  transition: color .2s; padding: 8px 0;
}
.nav-links > li > a:hover { color: #fff; }
.nav-links .dropdown { position: relative; cursor: pointer; }
.nav-links .dropdown-menu {
  display: none; position: absolute; top: 100%; left: -12px; background: #fff;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.15); min-width: 200px;
  padding: 12px 0; z-index: 50; padding-top: 16px;
  border: 1px solid rgba(0,0,0,.06);
}
.nav-links .dropdown-menu::before {
  content: ''; position: absolute; top: -12px; left: 0; right: 0; height: 14px;
}
.nav-links .dropdown:hover .dropdown-menu { display: block; }
.nav-links .dropdown-menu li { display: block; }
.nav-links .dropdown-menu a {
  color: #374151; display: block; padding: 10px 20px; font-size: 0.88rem;
  transition: background .15s, color .15s;
}
.nav-links .dropdown-menu a:hover { background: #f9fafb; color: #f43f5e; }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.search-box {
  padding: 9px 16px; border: none; border-radius: 24px;
  background: rgba(255,255,255,.08); color: #fff;
  font-size: 0.85rem; width: 200px; transition: all .25s;
  border: 1px solid rgba(255,255,255,.08);
}
.search-box::placeholder { color: rgba(255,255,255,.4); }
.search-box:focus { outline: none; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); width: 240px; }

/* === Hero === */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #334155 100%);
  color: #fff; padding: 100px 24px 80px; text-align: center;
  margin: 0 -24px; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; right: -20%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(244,63,94,.15) 0%, transparent 70%);
  border-radius: 50%;
}
.hero h1 {
  font-size: 3.2rem; margin-bottom: 16px; font-weight: 800;
  letter-spacing: -1px; position: relative;
}
.hero p {
  font-size: 1.15rem; opacity: .7; max-width: 560px; margin: 0 auto 32px;
  line-height: 1.7; position: relative;
}

/* === Section Titles === */
.section-title {
  font-size: 1.6rem; font-weight: 700; margin: 48px 0 4px;
  letter-spacing: -0.5px; color: #1e293b;
}

/* === Product Grid === */
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px; padding: 20px 0 48px;
}

.product-card {
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.03);
  transition: transform .25s ease, box-shadow .25s ease;
  display: block; border: 1px solid rgba(0,0,0,.04);
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
}
.product-card img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  background: #f1f5f9;
}
.product-card .img-placeholder {
  width: 100%; aspect-ratio: 1/1; background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 1.8rem; font-weight: 700;
}
.product-card .card-body { padding: 20px; }
.product-card .card-body h3 {
  font-size: 0.95rem; margin-bottom: 6px; color: #1e293b;
  font-weight: 600; line-height: 1.4;
}
.product-card .card-body .category {
  font-size: 0.72rem; color: #94a3b8; text-transform: uppercase;
  letter-spacing: 0.8px; font-weight: 600; display: block; margin-bottom: 8px;
}
.price { font-size: 1.15rem; font-weight: 700; color: #0f172a; }
.old-price { font-size: 0.85rem; color: #94a3b8; text-decoration: line-through; margin-left: 8px; }

/* === Category Grid === */
.category-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px; padding: 20px 0 48px;
}
.category-card {
  position: relative; border-radius: 16px; overflow: hidden; height: 180px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e293b, #334155);
  transition: transform .25s ease, box-shadow .25s ease;
  border: 1px solid rgba(255,255,255,.05);
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}
.category-card span, .category-card h3 {
  color: #fff; font-size: 1.15rem; font-weight: 700; z-index: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* === Product Detail === */
.product-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  padding: 32px 0 56px; align-items: start;
}
.product-detail-img img, .product-detail-img .img-placeholder {
  border-radius: 16px; width: 100%; box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.product-detail-info h1 { font-size: 2rem; margin-bottom: 8px; letter-spacing: -0.5px; color: #0f172a; }

/* === Breadcrumb === */
.breadcrumb { padding: 20px 0 4px; font-size: 0.82rem; color: #94a3b8; }
.breadcrumb a { color: #64748b; transition: color .15s; }
.breadcrumb a:hover { color: #f43f5e; }
.breadcrumb span::before { content: ' / '; color: #cbd5e1; }

/* === Badges === */
.badge {
  display: inline-block; padding: 5px 12px; border-radius: 6px;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-instock { background: #ecfdf5; color: #065f46; }
.badge-outofstock { background: #fef2f2; color: #991b1b; }

/* === Buttons === */
.btn {
  display: inline-block; padding: 12px 28px; border: none; border-radius: 10px;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all .2s ease;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff; box-shadow: 0 4px 14px rgba(244,63,94,.25);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(244,63,94,.35); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; transform: none; }

/* === Page Content === */
.page-content { padding: 48px 0; max-width: 720px; }
.page-content h1 { margin-bottom: 24px; font-size: 2rem; color: #0f172a; }
.page-content p { margin-bottom: 16px; color: #475569; line-height: 1.8; }

/* === Footer === */
footer {
  background: #0f172a; color: rgba(255,255,255,.6); padding: 56px 24px 28px;
  margin-top: 80px; border-top: 1px solid rgba(255,255,255,.05);
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 36px; max-width: 1240px; margin: 0 auto;
}
footer h4 { color: #fff; margin-bottom: 14px; font-size: 0.9rem; font-weight: 600; }
footer p { font-size: 0.85rem; line-height: 1.6; }
footer a { display: block; font-size: 0.85rem; padding: 5px 0; color: rgba(255,255,255,.5); transition: color .15s; }
footer a:hover { color: #f43f5e; }
.footer-bottom {
  text-align: center; margin-top: 40px; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.06); font-size: 0.8rem;
}

/* === Flash Messages === */
.flash {
  padding: 14px 20px; border-radius: 10px; margin: 16px 0; font-size: 0.88rem;
  font-weight: 500;
}
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* === Login === */
.login-box {
  max-width: 380px; margin: 100px auto; padding: 40px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.06); border: 1px solid rgba(0,0,0,.04);
}
.login-box h1 { font-size: 1.4rem; margin-bottom: 24px; text-align: center; color: #0f172a; }
.login-box input {
  width: 100%; padding: 12px 16px; border: 1px solid #e2e8f0; border-radius: 10px;
  font-size: 0.9rem; margin-bottom: 14px; transition: border-color .2s;
}
.login-box input:focus { outline: none; border-color: #f43f5e; }
.login-box button { width: 100%; }

/* === Utilities === */
.text-muted { color: #94a3b8; }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }

/* === Cart === */
.cart-link {
  color: rgba(255,255,255,.8); font-size: 0.88rem; font-weight: 500;
  white-space: nowrap; padding: 8px 16px; border-radius: 8px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  transition: all .2s;
}
.cart-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.cart-table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.cart-table th, .cart-table td { padding: 16px 20px; text-align: left; }
.cart-table th { font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #e2e8f0; }
.cart-table td { border-bottom: 1px solid #f1f5f9; }
.cart-table td a { color: #1e293b; font-weight: 500; }
.cart-table td a:hover { color: #f43f5e; }
.cart-total { padding: 24px 0; font-size: 1.3rem; text-align: right; }

/* ========== Admin Panel ========== */
.admin-nav {
  background: #1e293b; padding: 12px 24px; display: flex; gap: 20px; align-items: center;
  font-size: 0.8rem; overflow-x: auto; margin: 0 -24px 24px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.admin-nav a { color: rgba(255,255,255,.6); white-space: nowrap; transition: color .15s; }
.admin-nav a:hover, .admin-nav a.active { color: #fff; }

.admin-section { margin-bottom: 32px; }
.admin-section h2 { font-size: 1.1rem; margin-bottom: 12px; color: #1e293b; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; background: #fff; border-radius: 8px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 10px 12px; border: 1px solid #f1f5f9; text-align: left; word-wrap: break-word; }
.admin-table th { background: #374151; color: #fff; position: sticky; top: 0; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
.admin-table td { background: #fff; color: #374151; }
.admin-table tr:nth-child(even) td { background: #f8fafc; }
.admin-table .mono { font-family: 'SF Mono', Consolas, monospace; font-size: 11px; }

.admin-form { max-width: 500px; }
.admin-form label { display: block; font-size: 0.75rem; font-weight: 600; margin-bottom: 4px; color: #64748b; }
.admin-form input, .admin-form select, .admin-form textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 0.82rem; margin-bottom: 12px; transition: border-color .2s;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { outline: none; border-color: #f43f5e; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: #fff; padding: 24px; border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); text-align: center;
  border: 1px solid rgba(0,0,0,.04);
}
.stat-card .number { font-size: 2rem; font-weight: 800; color: #0f172a; }
.stat-card .label { font-size: 0.72rem; color: #94a3b8; text-transform: uppercase; margin-top: 4px; letter-spacing: 0.5px; }

.badge-human { background: #ecfdf5; color: #065f46; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-bot { background: #fef2f2; color: #991b1b; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-suspicious { background: #fffbeb; color: #92400e; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; }

/* === Responsive === */
.footer-logo { font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.5px; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .search-box { width: 140px; }
  .hero { padding: 60px 20px 50px; }
  .hero h1 { font-size: 2rem; }
  .product-detail { grid-template-columns: 1fr; gap: 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  nav { gap: 16px; }
}

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