:root {
  color-scheme: dark;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  line-height: 1.6;
  --primary: #e10600;
  --accent: #ff3b30;
  --dark: #080808;
  --surface: #151515;
  --surface-soft: #1c1c1c;
  --border: #333333;
  --text: #f5f2ed;
  --muted: #aaa6a0;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin:0; min-height:100vh; background:#0e0e0e; color:var(--text); background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 32px 32px; }
.container { max-width: 1240px; margin: 0 auto; padding: 24px; }
.topbar { background: rgba(8,8,8,.94); color:white; padding: 12px 0; position: sticky; top:0; z-index:10; box-shadow: 0 8px 30px rgba(0,0,0,.35); border-bottom:1px solid #292929; backdrop-filter: blur(12px); }
.nav { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; }
nav a, .brand { color:white; text-decoration:none; margin-left:16px; }
.brand { display:inline-flex; align-items:center; gap:10px; font-weight:700; font-size:1.2rem; letter-spacing: .06em; }
.brand-mark { display:grid; place-items:center; width:34px; height:34px; background:var(--primary); color:white; font-size:.8rem; transform:skew(-10deg); }
.brand-accent { color:#ff4b43; }
.cart-count { display:inline-flex; align-items:center; justify-content:center; min-width:1.35rem; height:1.35rem; padding:0 0.35rem; margin-left:6px; border-radius:999px; background:var(--accent); color:#111; font-size:0.8rem; font-weight:700; }
.hero { position:relative; overflow:hidden; display:flex; justify-content:space-between; align-items:center; min-height:390px; background: radial-gradient(circle at 85% 30%, rgba(225,6,0,.32), transparent 33%), linear-gradient(120deg, #171717, #090909 70%); color:white; padding: 64px clamp(24px, 7vw, 92px); border-radius: 4px; margin-bottom:42px; box-shadow: 0 18px 48px rgba(0,0,0,.34); border-left:4px solid var(--primary); }
.hero::after { content:''; position:absolute; width:360px; height:360px; right:-100px; bottom:-190px; border:1px solid rgba(255,255,255,.18); transform:rotate(45deg); }
.hero-copy { position:relative; z-index:1; max-width:700px; }
.hero h1 { max-width:650px; margin:8px 0 16px; font-size:clamp(2.8rem, 7vw, 5.8rem); line-height:.95; letter-spacing:-.06em; text-transform:uppercase; }
.hero h1 span { color:var(--accent); }
.hero p:not(.eyebrow) { max-width:590px; color:#c8c4bf; font-size:1.1rem; }
.hero-stamp { display:grid; place-items:center; width:150px; height:150px; border:1px solid rgba(255,255,255,.28); color:var(--accent); transform:rotate(12deg); font-weight:700; }
.hero-stamp span { font-size:3rem; line-height:1; }
.hero-stamp small { color:#aaa; letter-spacing:.16em; }
.eyebrow { color:#ff5c54; font-size:.72rem; font-weight:700; letter-spacing:.18em; margin:0; }
.hero-btn { display:inline-block; margin-top:16px; transition: transform .2s ease, box-shadow .2s ease; }
.hero-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 24px rgba(225,6,0,.3); }
.section-head { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; }
.section-space { margin: 28px 0; }
.cards { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap:20px; }
.card { background: var(--surface); border-radius:4px; padding:18px; box-shadow:0 16px 40px rgba(0,0,0,.22); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; border:1px solid #292929; overflow:hidden; }
.card:hover { transform: translateY(-3px); box-shadow:0 22px 50px rgba(0,0,0,.4); border-color:var(--primary); }
.card img, .product-card img, .product-detail-card img, .cart-item-image, .thumb { width:100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius:2px; background: linear-gradient(145deg, #242424, #101010); padding: 10px; display:block; }
.image-frame { position: relative; min-height: 220px; overflow: hidden; border-radius: 20px; background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%); display: grid; place-items: center; }
.image-frame img.product-image { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 20px; transition: opacity .2s ease; }
.image-hidden { opacity: 0; }
.image-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.image-placeholder.visible { opacity: 1; }
.image-placeholder svg { width: 48px; height: 48px; stroke: currentColor; }
.image-placeholder span { font-size: .95rem; }
.cart-item-image { max-width: 120px; object-fit: contain; border-radius: 16px; }
.card-footer { display:flex; justify-content:space-between; align-items:center; margin-top:16px; gap:12px; flex-wrap:wrap; }
.quantity-control { display:flex; align-items:center; gap:8px; padding: 6px 10px; border-radius: 14px; background: #f8fafc; }
.quantity-control span { display:inline-flex; min-width:34px; justify-content:center; font-weight:700; color:var(--text); }
.product-card .card-body h3 { margin: 0 0 8px; font-size: 1.15rem; }
.product-card .card-body p { margin: 0; color: var(--muted); line-height: 1.6; font-size: .96rem; text-decoration: none; }
.btn { background: var(--accent); color:#fff; border:none; padding:10px 16px; border-radius:2px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; font-weight:700; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 22px rgba(225,6,0,.25); background:#ff5148; }
.btn.secondary { background:#292929; color: var(--text); }
.btn.danger { background:#dc2626; color:white; }
.btn.small { padding:8px 12px; font-size:.92rem; border-radius:12px; }
.btn.add-button { min-width:108px; }
.auth-card, .card { margin-top: 16px; }
input, select, textarea { width:100%; padding:12px; margin:10px 0; border:1px solid var(--border); border-radius:12px; background: var(--surface); transition: border-color .2s ease, box-shadow .2s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline:none; box-shadow: 0 0 0 4px rgba(15,118,110,.08); }
.search-box, .header-search { position:relative; min-width:min(260px,100%); max-width: 420px; width:100%; }
.filter-actions { display:flex; justify-content:flex-end; margin: 14px 0 10px; }
.hidden { display: none !important; }
.auth-card { max-width: 500px; margin: 40px auto; padding: 28px; background: var(--surface); border-radius: 24px; box-shadow: 0 20px 40px rgba(15,23,42,.08); }
.auth-tabs { display: flex; gap: 12px; margin-bottom: 18px; }
.auth-tab { flex: 1; padding: 12px 16px; border-radius: 14px; border: 1px solid transparent; background: #f8fafc; color: var(--text); cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.auth-tab.active { background: var(--accent); color: #111; border-color: rgba(246,158,11,.22); }
.auth-panel { display: block; }
.auth-panel.hidden { display: none; }
.helper-text { margin-top: 10px; color: var(--muted); font-size: .95rem; text-decoration: none; }
.message { margin-top: 12px; font-size: .95rem; font-weight: 600; }
.warning { color: #b45309; }
.success { color: #166534; }
.detail-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.detail-actions .btn { min-width: 140px; }
.detail-actions .quantity-control { margin-right: auto; }
.detail-action-group { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.detail-meta, .detail-price { margin:0; }
.search-box input, .header-search input { margin:0; width:100%; padding: 14px 18px; border-radius: 2px; border:1px solid var(--border); background: #1b1b1b; color:var(--text); transition: border-color .2s ease, box-shadow .2s ease; }
.search-box input:focus, .header-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(15,118,110,.08); }
.search-results { position:absolute; top:calc(100% + 10px); left:0; right:0; width:100%; background:white; border:1px solid var(--border); border-radius:14px; box-shadow:0 18px 40px rgba(15,23,42,.08); display:none; z-index:999; overflow:hidden; max-height:320px; }
.search-results.active { display:block; }
.search-result { display: block; padding: 14px 18px; border-bottom: 1px solid #eef2f7; text-decoration: none; color: var(--text); transition: background .2s ease, padding .2s ease; }
.search-result:last-child { border-bottom: none; }
.search-result strong { display: block; margin-bottom: 4px; }
.search-result span { color: var(--muted); font-size: .95rem; }
.search-result:hover { background: #f8fafc; padding-left: 22px; }
.search-empty { padding: 14px 18px; color: var(--muted); }
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display:flex; flex-direction:column; gap:10px; pointer-events:none; }
.toast { background: var(--dark); color:white; padding: 12px 16px; border-radius: 999px; box-shadow: 0 18px 40px rgba(15,23,42,.2); transform: translateY(-8px); opacity:0; transition: all .22s ease; }
.toast.show { opacity:1; transform: translateY(0); }
.chip { display:inline-flex; align-items:center; justify-content:center; padding:10px 16px; border-radius:999px; border:1px solid transparent; background:#f8fafc; color:var(--text); font-size:.95rem; cursor:pointer; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.chip:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.chip.active { background: var(--accent); color:#111; border-color: rgba(246,158,11,.25); }
/* Product detail page */
.product-detail { margin: 32px 0; }
.product-detail-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: start;
  padding: 24px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 20px 48px rgba(15,23,42,.1);
  border: 1px solid rgba(15,23,42,.06);
}
.product-detail-card img.detail-image {
  width: 100%;
  border-radius: 20px;
  object-fit: contain;
  min-height: 320px;
  max-height: 460px;
  transition: transform .2s ease;
}
.product-detail-card img.detail-image:hover {
  transform: scale(1.01);
}
.detail-info { display: flex; flex-direction: column; gap: 18px; }
.detail-info h1 { margin: 0; font-size: 2.3rem; letter-spacing: -.02em; }
.detail-description { line-height: 1.75; color: #334155; }
.detail-category, .detail-price, .detail-stock { margin: 0; }
.detail-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.detail-actions .btn { min-width: 140px; }
.detail-actions .product-count { margin-right: auto; }
.search-result {
  display: block;
  width: 100%;
  padding: 14px 18px;
  background: white;
  border-radius: 16px;
  text-align: left;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 10px;
  box-shadow: 0 16px 38px rgba(15,23,42,.08);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  border: 1px solid transparent;
}
.search-result:hover {
  background: #f8fafc;
  transform: translateX(2px);
  border-color: rgba(15,23,42,.12);
}
.search-empty {
  padding: 14px 16px;
  color: var(--muted);
}
.product-card-link {
  color: inherit;
  text-decoration: none;
  display: block;
}
.product-card .card-body {
  padding: 14px 0;
}
@media (max-width: 900px) {
  .product-detail-card {
    grid-template-columns: 1fr;
  }
  .detail-info {
    width: 100%;
  }
}
.header-search { display: flex; flex: 1; align-items: center; margin-right: 20px; }
.header-search input { width: 100%; }
.nav { display:flex; justify-content:space-between; align-items:center; gap:16px; }
@media (max-width: 900px) {
  .header-search { order: 2; width: 100%; margin: 12px 0 0; }
  .nav { flex-wrap: wrap; }
}
.user-pill { background:#292929; padding:6px 10px; border-radius:2px; }
.footer { margin-top: 64px; text-align:center; color:#777; border-top:1px solid #272727; }
.footer strong { color:#e8e4df; letter-spacing:.12em; }
.section-head h2 { margin:4px 0 0; text-transform:uppercase; letter-spacing:.03em; }
.text-link { color:#ff5c54; }
.filters { display:flex; gap:10px; flex-wrap:wrap; margin:18px 0 24px; }
.chip { border-radius:2px; background:#1d1d1d; color:var(--muted); border-color:#333; }
.chip.active, .chip:hover { background:var(--primary); color:white; }
.quantity-control { background:#222; }
.dashboard-toolbar { display:flex; align-items:end; justify-content:space-between; gap:18px; flex-wrap:wrap; margin-bottom:16px; }
.dashboard-toolbar h3 { margin:4px 0 0; }
.dashboard-controls { display:flex; gap:10px; align-items:center; flex:1; justify-content:flex-end; }
.dashboard-controls input, .dashboard-controls select { width:min(280px, 100%); margin:0; }
.table-select { appearance:auto; }
.dashboard-table-view { overflow-x:auto; }
.dashboard-table-view.hidden { display:none; }
.data-table { color:var(--text); }
.data-table th { color:#ff675f; font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; }
.data-table tr:hover { background:#202020; }
.dashboard-empty { color:var(--muted); padding:18px 0; }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.auth-card, .product-detail-card, .admin-section { background:var(--surface); border-color:#2d2d2d; box-shadow:0 20px 48px rgba(0,0,0,.28); }
.admin-section { color:var(--text); }
.admin-section table, .data-table th, .data-table td { border-color:#303030; }
.auth-tab { background:#222; color:var(--text); }
.auth-tab.active { background:var(--primary); color:#fff; }
input, select, textarea { background:#1b1b1b; color:var(--text); border-color:#383838; }
.detail-description { color:#c3beb8; }
.search-results, .search-result { background:#1b1b1b; color:var(--text); border-color:#333; }
.search-result:hover { background:#282828; }
.search-result span, .search-empty { color:var(--muted); }
.metric { color:#ff5c54; }
@media (max-width: 650px) {
  .container { padding:18px; }
  .hero { min-height:430px; padding:42px 24px; }
  .hero-stamp { position:absolute; right:24px; bottom:24px; width:92px; height:92px; }
  .hero-stamp span { font-size:2rem; }
  .hero h1 { font-size:clamp(2.5rem, 13vw, 4rem); }
  nav { display:flex; gap:8px 4px; align-items:center; }
  nav a, .brand { margin-left:4px; }
  .header-search { margin-right:0; }
}
.error { color: #b91c1c; }
.admin-panel { display:grid; gap:18px; }
.admin-head { margin-bottom:8px; }
.admin-actions { display:flex; gap:10px; flex-wrap:wrap; }
.admin-section { background:var(--surface); border:1px solid #2d2d2d; border-radius:4px; padding:16px; box-shadow:0 20px 48px rgba(0,0,0,.28); }
.metric { font-size:2rem; font-weight:700; color:var(--primary); margin:0; }
.data-table { width:100%; border-collapse:collapse; margin-top:8px; }
.data-table th, .data-table td { border-bottom:1px solid #303030; padding:10px; text-align:left; vertical-align:top; }
.data-table tbody tr { background:#202020; color:var(--text); }
.data-table tbody tr:nth-child(even) { background:#181818; }
.data-table tbody tr:hover { background:#292929; }
.table-actions { display:flex; gap:8px; flex-wrap:wrap; }
.thumb { width:80px; height:80px; object-fit:contain; border-radius:8px; }
.text-link { color:var(--primary); text-decoration:none; font-weight:600; }
.checkbox-field { display:flex; align-items:center; gap:10px; margin:14px 0; color:var(--text); }
.checkbox-field input { width:auto; margin:0; accent-color:var(--primary); }
