:root {
  --bg: #0b1220;
  --bg-soft: #111a2e;
  --card: #14203a;
  --card-2: #182746;
  --text: #e8eef7;
  --muted: #9fb0c8;
  --accent: #3b82f6;
  --accent2: #22c55e;
  --danger: #ef4444;
  --border: #2a3b5d;
  --radius: 14px;
  --shadow: 0 12px 32px rgba(5, 10, 25, 0.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top right, #162747 0%, var(--bg) 42%);
  color: var(--text);
  line-height: 1.55;
}

a { color: #7db0ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 24, 43, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 0;
}
.logo { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: 0.2px; }
.logo-img {
  max-height: 42px;
  width: auto;
  display: block;
}
.nav a {
  margin-left: 16px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 8px;
}
.nav a:hover {
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.main-content { padding: 28px 18px 48px; }

.ad-slot {
  margin-top: 10px;
  margin-bottom: 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  padding: 10px;
  overflow-x: auto;
}

.site-searchbar {
  margin-top: 14px;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.search-form input[type="text"] {
  margin: 0;
}

.hero {
  margin-bottom: 28px;
  background: linear-gradient(160deg, rgba(59, 130, 246, 0.1), rgba(34, 197, 94, 0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 8px; font-size: 1.75rem; }
.hero p { margin: 0; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h2, .card h3 { margin-top: 0; }
.muted { color: var(--muted); font-size: 0.92rem; }

.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #4f90ff, #2f73e8);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: rgba(255,255,255,0.03); color: var(--text); }
.btn.danger { background: var(--danger); }

.action-row,
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.share-btn {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.stars {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.star {
  color: #5f6c86;
  font-size: 1.2rem;
  line-height: 1;
}

button.star {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0 2px;
}

.star.active {
  color: #facc15;
}

.rating-text {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.92rem; }
input[type="text"], input[type="email"], input[type="file"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #4f90ff, #2f73e8);
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
  margin-right: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #4f90ff, #2f73e8);
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
  border-color: #4f90ff;
  box-shadow: 0 0 0 3px rgba(79, 144, 255, 0.16);
}
textarea { min-height: 140px; resize: vertical; }

.product-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
@media (min-width: 880px) {
  .product-layout { grid-template-columns: 320px 1fr; }
}

.icon-lg {
  width: 120px; height: 120px; border-radius: 18px; object-fit: cover;
  border: 1px solid var(--border); background: #121a26;
}
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.shots img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: transform 0.16s ease;
}
.shots img:hover { transform: scale(1.02); }

.product-media-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.product-icon-block {
  flex: 0 0 auto;
}

.product-shots-block {
  flex: 1 1 220px;
}

.product-shots-block h3 {
  margin-top: 0;
}

.price-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.badge { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; }

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  margin-bottom: 16px;
}
.alert.ok { border-color: rgba(34,197,94,0.45); }
.alert.bad { border-color: rgba(239,68,68,0.45); }

.site-footer { border-top: 1px solid var(--border); padding: 22px 0; color: var(--muted); font-size: 0.92rem; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.admin-table th, table.admin-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}
table.admin-table th {
  color: #c7d7ef;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.02);
}
table.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.rich h2, .rich h3 { margin-top: 20px; }
.rich img { max-width: 100%; height: auto; border-radius: 10px; }

@media (max-width: 640px) {
  .main-content { padding-top: 18px; }
  .hero h1 { font-size: 1.45rem; }
  .nav a { margin-left: 6px; padding: 6px 8px; }
  .btn { width: 100%; text-align: center; margin-bottom: 8px; }
  .action-row .btn,
  .share-row .btn { width: auto; margin-bottom: 0; }
  .search-form { grid-template-columns: 1fr; }
  .logo-img { max-height: 34px; }
  .product-media-row { display: block; }
  .product-shots-block { margin-top: 10px; }
}
