:root {
  --bg: #0d0d0f;
  --surface: #16161a;
  --surface-2: #1e1e24;
  --border: #2a2a33;
  --text: #f2f2f5;
  --muted: #8b8b99;
  --accent: #ffd028;
  --accent-2: #ff6b1a;
  --danger: #ff4d4d;
  --green: #2ecc71;
  --radius: 14px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: 1rem; }

.wrap { width: min(1200px, 92%); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 13, 15, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 2rem; padding: 1rem 0; }

.logo { display: flex; align-items: center; gap: .65rem; font-weight: 800; letter-spacing: -.02em; }
.logo-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 10px; color: #000; font-size: 1.1rem;
}
.logo-text { font-size: 1.05rem; line-height: 1.15; }
.logo-text small { display: block; font-size: .62rem; font-weight: 600; color: var(--muted);
  letter-spacing: .18em; text-transform: uppercase; }

.nav { display: flex; gap: .35rem; margin-left: auto; align-items: center; }
.nav a {
  padding: .5rem .9rem; border-radius: 8px; font-size: .9rem; font-weight: 500;
  color: var(--muted); transition: .15s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.3rem; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .9rem; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: #ffdb5c; transform: translateY(-1px); }
.btn-tele { background: #229ED9; color: #fff; }
.btn-tele:hover { background: #35b0e8; transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-danger { background: transparent; color: var(--danger); border-color: #4a2020; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: .4rem .75rem; font-size: .8rem; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  padding: 4.5rem 0 3rem;
  background:
    radial-gradient(900px 380px at 78% -8%, rgba(255, 208, 40, .13), transparent 65%),
    radial-gradient(700px 320px at 8% 0%, rgba(255, 107, 26, .09), transparent 60%);
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); font-weight: 900; letter-spacing: -.035em;
  line-height: 1.05; margin-bottom: 1rem; }
.hero h1 .hl { background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 1.05rem; max-width: 44ch; }
.hero-stats { display: flex; gap: 2.5rem; margin-top: 2.2rem; }
.hero-stats b { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.hero-stats span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* ---------- Filter bar ---------- */
.filters { padding: 1.8rem 0; border-bottom: 1px solid var(--border); }
.filter-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.field {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: .62rem .85rem; border-radius: 9px; outline: none; transition: .15s;
}
.field:focus { border-color: var(--accent); }
.field::placeholder { color: #5a5a68; }
.search-field { flex: 1; min-width: 220px; }
.price-field { width: 118px; }

.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.chip {
  padding: .42rem .9rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); transition: .15s;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.active { background: var(--accent); color: #000; border-color: var(--accent); }
.chip small { opacity: .6; margin-left: .25rem; font-weight: 500; }

/* ---------- Product grid ---------- */
.section { padding: 2.5rem 0 4rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.4rem; }
.section-head h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.result-count { color: var(--muted); font-size: .88rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.3rem; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: .2s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); border-color: #3d3d4a; }
.card-img { position: relative; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: .35s; }
.card:hover .card-img img { transform: scale(1.06); }
.card.is-sold .card-img img { filter: grayscale(1) brightness(.5); }

.badge {
  position: absolute; top: .7rem; left: .7rem; padding: .28rem .6rem; border-radius: 6px;
  font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
}
.badge-sold { background: var(--danger); color: #fff; }
.badge-cat { background: rgba(0, 0, 0, .72); color: var(--accent); backdrop-filter: blur(6px);
  left: auto; right: .7rem; letter-spacing: .05em; }

.card-body { padding: .95rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card-body h3 { font-size: .96rem; font-weight: 700; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: .4rem; flex-wrap: wrap; }
.tag {
  font-size: .7rem; font-weight: 600; padding: .18rem .5rem; border-radius: 5px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.price { font-size: 1.12rem; font-weight: 800; color: var(--accent); letter-spacing: -.02em; margin-top: auto; }
.card.is-sold .price { color: var(--muted); text-decoration: line-through; }

.empty { text-align: center; padding: 4.5rem 1rem; color: var(--muted); }
.empty-icon { font-size: 3rem; margin-bottom: .8rem; opacity: .35; }
.empty h3 { color: var(--text); font-size: 1.1rem; margin-bottom: .4rem; }

/* ---------- Product detail ---------- */
.breadcrumb { padding: 1.5rem 0 0; font-size: .85rem; color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; padding: 2rem 0 4rem; align-items: start; }
.detail-img { position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2); aspect-ratio: 1; }
.detail-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-img.is-sold img { filter: grayscale(1) brightness(.5); }

.detail-info h1 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 900;
  letter-spacing: -.03em; line-height: 1.15; margin: .5rem 0 .8rem; }
.detail-price { font-size: 2.1rem; font-weight: 900; color: var(--accent);
  letter-spacing: -.03em; margin: 1rem 0 1.5rem; }
.detail-price.sold { color: var(--muted); text-decoration: line-through; }

.spec-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.spec-list div { display: flex; padding: .8rem 1rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
.spec-list div:last-child { border-bottom: 0; }
.spec-list dt { width: 120px; color: var(--muted); flex-shrink: 0; }
.spec-list dd { font-weight: 600; }

.desc { color: #c8c8d2; font-size: .95rem; white-space: pre-wrap; margin-bottom: 1.8rem; }
.desc h4, .contact-card h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin-bottom: .5rem; font-weight: 700; }

.order-box { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem; }
.order-box .hint { font-size: .78rem; color: var(--muted); margin-top: .7rem; text-align: center; }
.sold-note { background: rgba(255, 77, 77, .08); border: 1px solid rgba(255, 77, 77, .3);
  color: #ff9d9d; padding: 1rem; border-radius: 10px; font-size: .9rem; text-align: center; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem; margin: 2rem 0; }
.contact-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; transition: .2s; }
.contact-card:hover { border-color: #3d3d4a; transform: translateY(-3px); }
.contact-card .ico { font-size: 1.8rem; margin-bottom: .7rem; }
.contact-card p { font-weight: 700; font-size: 1.05rem; word-break: break-word; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 2.5rem 0; margin-top: auto;
  color: var(--muted); font-size: .85rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.site-footer a:hover { color: var(--accent); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translate(-50%, 130%);
  background: var(--accent); color: #000; padding: .8rem 1.4rem; border-radius: 999px;
  font-weight: 700; font-size: .88rem; z-index: 999; transition: transform .3s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
.toast.show { transform: translate(-50%, 0); }

/* ==================== ADMIN ==================== */
.admin-body { display: flex; min-height: 100vh; }

.sidebar {
  width: 245px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); padding: 1.5rem 1rem;
  display: flex; flex-direction: column; gap: .3rem; position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { padding: 0 .5rem 1.5rem; }
.sidebar-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .13em;
  color: #5a5a68; font-weight: 700; padding: 1rem .75rem .4rem; }
.sidebar a {
  display: flex; align-items: center; gap: .7rem; padding: .65rem .75rem; border-radius: 9px;
  font-size: .9rem; font-weight: 500; color: var(--muted); transition: .15s;
}
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.active { background: var(--accent); color: #000; font-weight: 700; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 1rem; }

.admin-main { flex: 1; padding: 2rem 2.5rem 4rem; min-width: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.admin-head h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.025em; }
.admin-head p { color: var(--muted); font-size: .9rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 1rem; margin-bottom: 2rem; }
.stat { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem; }
.stat span { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); font-weight: 700; }
.stat b { display: block; font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; margin-top: .3rem; }
.stat.accent b { color: var(--accent); }
.stat.green b { color: var(--green); }

.panel { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; }
.panel-head { padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .95rem; }
.panel-body { padding: 1.3rem; }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: .8rem 1.3rem; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted); border-bottom: 1px solid var(--border); font-weight: 700;
}
.table td { padding: .85rem 1.3rem; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--border); }

.pill { font-size: .7rem; font-weight: 800; padding: .22rem .6rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .06em; }
.pill-ready { background: rgba(46, 204, 113, .14); color: var(--green); }
.pill-sold { background: rgba(255, 77, 77, .14); color: var(--danger); }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: .8rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; }
.form-group .field { width: 100%; }
.form-group textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.form-group .help { font-size: .76rem; color: #5a5a68; }
.form-actions { display: flex; gap: .7rem; margin-top: 1.6rem; padding-top: 1.4rem;
  border-top: 1px solid var(--border); }

.img-preview { width: 100%; max-width: 240px; aspect-ratio: 1; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }

.alert { padding: .85rem 1.1rem; border-radius: 10px; font-size: .88rem;
  font-weight: 600; margin-bottom: 1.3rem; }
.alert-ok { background: rgba(46, 204, 113, .12); color: var(--green); border: 1px solid rgba(46, 204, 113, .3); }
.alert-err { background: rgba(255, 77, 77, .1); color: #ff9d9d; border: 1px solid rgba(255, 77, 77, .3); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background: radial-gradient(700px 400px at 50% 0%, rgba(255, 208, 40, .07), transparent 65%); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 2.2rem; }
.login-card .logo { justify-content: center; margin-bottom: 1.6rem; }
.login-card h1 { font-size: 1.25rem; font-weight: 800; text-align: center; margin-bottom: .3rem; }
.login-card .sub { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 1.6rem; }
.login-card .form-group { margin-bottom: 1rem; }
.back-link { display: block; text-align: center; margin-top: 1.3rem;
  color: var(--muted); font-size: .82rem; }
.back-link:hover { color: var(--accent); }

/* ---------- Center page (404 / error) ---------- */
.center-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 2rem; }
.center-page h1 { font-size: 4rem; font-weight: 900; color: var(--accent); letter-spacing: -.04em; }
.center-page p { color: var(--muted); margin: .5rem 0 1.6rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; gap: 1.8rem; }
  .admin-main { padding: 1.5rem 1.2rem 3rem; }
  .sidebar { width: 72px; padding: 1rem .6rem; }
  .sidebar .logo-text, .sidebar .nav-text, .sidebar-label { display: none; }
  .sidebar a { justify-content: center; padding: .75rem; }
  .table-hide-sm { display: none; }
}
@media (max-width: 640px) {
  .header-inner { gap: 1rem; }
  .nav a { padding: .45rem .6rem; font-size: .82rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: .9rem; }
  .form-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 0 2rem; }
  .hero-stats { gap: 1.6rem; }
  .search-field, .price-field { min-width: 0; width: 100%; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-row .btn { width: 100%; }
}
