/* LeninShop storefront — customer-facing. Shares the admin's palette but runs
   more spacious and editorial: the cover art is the content. */

:root {
  --bg: #17130f;
  --bg-raised: #221c16;
  --bg-input: #2c241c;
  --line: #3b3025;
  --line-soft: #2c241c;
  --text: #f3ece0;
  --text-dim: #a89880;
  --accent: #c8102e;
  --accent-hot: #e2263f;
  --yellow: #f5c518;   /* the painted steel columns */
  --brick: #8b4a3a;    /* the exposed back wall */
  --ok: #5aa06a;
  --warn: #d9a441;
  --radius: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .6);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --max: 1240px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
a { color: inherit; }
.muted { color: var(--text-dim); }
.small { font-size: 13px; }
.grow { flex: 1; }
.error { color: #e8776a; font-size: 13px; margin: 10px 0 0; }

input, select, textarea, button { font: inherit; color: inherit; }

/* ── Masthead ──────────────────────────────────────────────────────── */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  background: rgba(16, 16, 18, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 24px; height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--accent) 0 18%, transparent 19%),
    repeating-radial-gradient(circle, #26262b 0 2px, #191919 2px 4px);
}
.brand-name { font-weight: 650; letter-spacing: .01em; font-size: 17px; }

.search-wrap { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--text-dim);
  pointer-events: none;
}
#search {
  width: 100%;
  padding: 10px 14px 10px 37px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(192, 57, 43, .16); }

.store-link {
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.store-link:hover { border-color: var(--accent); background: rgba(192, 57, 43, .1); }

.lang { display: flex; gap: 2px; padding: 2px; background: var(--bg-input); border-radius: 999px; border: 1px solid var(--line); }
.lang-btn {
  padding: 5px 11px;
  border: none;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-dim);
  transition: background .15s, color .15s;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--accent); color: #fff; }

/* ── Layout ────────────────────────────────────────────────────────── */

main { max-width: var(--max); margin: 0 auto; padding: 26px 24px 60px; }

.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 26px;
}

.pill {
  padding: 8px 13px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.pill:hover { border-color: #3d3d47; }
select.pill { padding-right: 28px; }
.pill-ghost { background: transparent; color: var(--text-dim); }

.toggle { display: inline-flex; align-items: center; gap: 8px; user-select: none; }
.toggle input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

.count { color: var(--text-dim); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ── Grid ──────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 26px 20px;
}

.card { cursor: pointer; text-align: left; background: none; border: none; padding: 0; color: inherit; }

.card-art {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1c1c21;
  margin-bottom: 10px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover .card-art { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-art .placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 34px; color: #3d3d47;
  background: repeating-linear-gradient(45deg, #202026 0 7px, #1a1a1f 7px 14px);
}

.card-artist { font-size: 14px; font-weight: 600; line-height: 1.35; }
.card-title { font-size: 13px; color: var(--text-dim); line-height: 1.35; }
.card-meta { font-size: 11px; color: #6d6a64; font-family: var(--mono); margin-top: 3px; }

.flag {
  position: absolute;
  top: 9px; left: 9px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(6px);
  background: rgba(0, 0, 0, .6);
}
.flag-oos { color: #ffb3a8; border: 1px solid rgba(192, 57, 43, .6); }

.price { float: right; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 70px 20px; color: var(--text-dim); }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 44px; }

.btn {
  padding: 9px 17px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { background: #2a2a31; border-color: #3d3d47; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 550; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hot); border-color: var(--accent-hot); }
.icon-btn { padding: 6px 10px; background: none; border: none; cursor: pointer; color: var(--text-dim); border-radius: 6px; }
.icon-btn:hover { color: var(--text); background: var(--bg-input); }

/* ── Detail ────────────────────────────────────────────────────────── */

.back {
  display: inline-block;
  margin-bottom: 22px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
}
.back:hover { color: var(--text); }

.detail { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 46px; align-items: start; }

.cover-large {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1c1c21;
  box-shadow: var(--shadow);
}
.cover-large img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-large .placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 64px; color: #3d3d47;
  background: repeating-linear-gradient(45deg, #202026 0 9px, #1a1a1f 9px 18px);
}

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin-top: 12px; }
.gallery img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s;
}
.gallery img:hover, .gallery img.active { border-color: var(--accent); }

.d-artist { margin: 0; color: var(--text-dim); font-size: 17px; }
.d-title { font-size: 34px; line-height: 1.15; margin: 2px 0 18px; }

.stock-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.stock {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px;
}
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.stock.out::before { background: var(--accent); }
.stock.out { color: var(--text-dim); }
.d-price { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 7px 20px; margin: 0 0 22px; font-size: 14px; }
.facts dt { color: var(--text-dim); }
.facts dd { margin: 0; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.chip {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip-style { background: transparent; }

.description { color: var(--text-dim); font-size: 14px; white-space: pre-wrap; margin: 0 0 26px; }

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.spotify, .tracks { margin-top: 30px; }
.spotify iframe { width: 100%; border: none; border-radius: 12px; display: block; }

.tracklist { margin: 0; padding: 0; list-style: none; counter-reset: track; }
.tracklist li {
  display: flex;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.tracklist li:last-child { border-bottom: none; }
.t-pos { color: var(--text-dim); font-family: var(--mono); font-size: 12px; min-width: 30px; }
.t-name { flex: 1; }
.t-dur { color: var(--text-dim); font-family: var(--mono); font-size: 12px; }

/* ── Modal ─────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, .7);
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-card {
  width: min(460px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-head, .modal-foot { display: flex; align-items: center; gap: 10px; padding: 16px 20px; }
.modal-head { border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; flex: 1; }
.modal-foot { border-top: 1px solid var(--line); justify-content: flex-end; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-body p { margin: 0 0 14px; }

.modal-body label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-dim);
}
.modal-body input, .modal-body textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.modal-body input:focus, .modal-body textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .16);
}
.modal-body textarea { resize: vertical; font-family: inherit; }
.optional { color: #6d6a64; }

/* ── Toast ─────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 12px 22px;
  background: #2a2a31;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: rise .2s ease-out;
}
.toast.err { border-left-color: var(--accent); }
@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.site-foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 24px 40px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line-soft);
}
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--text); }

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 820px) {
  .detail { grid-template-columns: 1fr; gap: 28px; }
  .detail-art { max-width: 340px; }
  .d-title { font-size: 27px; }
  .masthead { flex-wrap: wrap; gap: 12px; }
  .search-wrap { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px 14px; }
}

/* ── Format badge ──────────────────────────────────────────────────── */

.fmt {
  position: absolute;
  left: 8px; bottom: 8px;
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(12, 9, 7, .72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .16);
  color: var(--text);
  pointer-events: none;
}
.fmt svg { width: 15px; height: 15px; display: block; }
.fmt-vinyl { color: #efe6d6; }
.fmt-cd { color: #bcd8e6; }
.fmt-cassette { color: var(--yellow); }

/* ── Detail backdrop ───────────────────────────────────────────────── */

/* The album's own sleeve, blown up behind the page. Heavily blurred and
   dimmed so it sets a mood without ever competing with the text. */
.detail-backdrop {
  position: fixed;
  inset: -8%;
  z-index: -1;
  background-size: cover;
  background-position: center;
  filter: blur(70px) saturate(1.5);
  opacity: .32;
  transform: scale(1.15);
  animation: backdrop-in .7s ease-out;
}
.detail-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, transparent 0%, var(--bg) 78%),
    linear-gradient(var(--bg) 0%, transparent 26%, transparent 62%, var(--bg) 100%);
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: .32; } }

@media (prefers-reduced-motion: reduce) {
  .detail-backdrop { animation: none; }
}

/* ── Clearer back button ───────────────────────────────────────────── */

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  padding: 10px 18px 10px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .06s;
}
.back svg { width: 17px; height: 17px; }
.back:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.back:active { transform: translateY(1px); }

/* ── Shop identity ─────────────────────────────────────────────────── */

/* The shop's own mark: red vinyl grooves struck through by a yellow bolt. */
.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #1a0d0e 0 14%, transparent 15%),
    repeating-radial-gradient(circle, #c8102e 0 1.5px, #8e0b20 1.5px 3px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5);
  flex-shrink: 0;
}
.brand-mark::after {
  /* The lightning bolt slashing across the record. */
  content: "";
  position: absolute;
  inset: -3px -1px;
  background: var(--yellow);
  clip-path: polygon(58% 0%, 30% 52%, 47% 52%, 34% 100%, 72% 44%, 53% 44%, 70% 0%);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, .55));
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-weight: 750;
  font-size: 16px;
  letter-spacing: .015em;
  text-transform: uppercase;
}
.brand-tagline {
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--yellow);
}

@media (max-width: 560px) {
  .brand-tagline { display: none; }
}
