:root {
  --bg: #0d0f12;
  --surface: #161a21;
  --surface-2: #1e242e;
  --border: #2a313d;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #e63946;
  --discount: #f59e0b;
  --wa: #25d366;
  --tg: #229ed9;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.hidden {
  display: none !important;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 15, 18, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 9px;
  display: block;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

/* Buttons */
.contact-links,
.card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.contact-links a,
.card-actions .btn-order {
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  color: #fff;
  text-align: center;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.contact-links a {
  padding: 8px 14px;
  white-space: nowrap;
}

.card-actions {
  margin-top: auto;
  padding-top: 10px;
}

.card-actions .btn-order {
  flex: 1;
  padding: 10px 12px;
}

.btn-wa {
  background: var(--wa);
}

.btn-tg {
  background: var(--tg);
}

.btn-wa:hover,
.btn-tg:hover {
  opacity: 0.88;
}

/* Controls */
.main-content {
  flex: 1;
  padding-top: 18px;
  padding-bottom: 36px;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.controls-top {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-wrap {
  flex: 1;
}

.search-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
}

.view-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.view-btn.active {
  background: var(--surface-2);
  color: var(--text);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tab.tab-discount.active {
  background: var(--discount);
  border-color: var(--discount);
  color: #111;
}

.badge {
  background: rgba(0, 0, 0, 0.28);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 12px;
}

/* Catalog Grid / List */
.catalog.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 16px;
}

.catalog.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.catalog.list .card {
  flex-direction: row;
  align-items: stretch;
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0a0c0f;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.catalog.list .card-media {
  width: 220px;
  aspect-ratio: auto;
  min-height: 170px;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.card-media:hover img {
  transform: scale(1.03);
}

.card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}

.tag-discount {
  background: var(--discount);
  color: #111;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.tag-photos {
  margin-left: auto;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-title a:hover {
  text-decoration: underline;
}

.card-article {
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.card-desc {
  font-size: 13px;
  color: #cbd5e1;
  white-space: pre-line;
}

.card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.card-price {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
}

.card-qty {
  font-size: 12px;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
  font-size: 15px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 0;
}

.delivery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.delivery-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  color: var(--muted);
}

.delivery-item strong {
  color: var(--text);
  font-size: 14px;
}

.delivery-item a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.delivery-item a:hover {
  text-decoration: underline;
}

.disclaimer {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.78;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lb-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.lb-stage {
  position: relative;
  background: #080a0d;
  height: 52vh;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.lb-prev { left: 10px; }
.lb-next { right: 10px; }

.lb-counter {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
}

.lb-info {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.lb-head h2 {
  font-size: 18px;
}

.lb-price {
  font-size: 20px;
  font-weight: 800;
}

.lb-meta {
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.lb-desc {
  font-size: 14px;
  color: #cbd5e1;
  white-space: pre-line;
}

@media (max-width: 680px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .header-inner .contact-links {
    width: 100%;
  }

  .header-inner .contact-links a {
    flex: 1;
  }

  .view-toggle {
    display: none;
  }

  .catalog.list .card {
    flex-direction: column;
  }

  .catalog.list .card-media {
    width: 100%;
    aspect-ratio: 4 / 3;
  }
}

/* Минималистичные полоски фото в карточке */
.card-media.has-multi::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.52), transparent);
  pointer-events: none;
  z-index: 1;
}

.card-dots {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 4px;
  pointer-events: none;
  z-index: 2;
}

.card-dot {
  flex: 1;
  height: 2.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  transition: background 0.15s ease;
}

.card-dot.active {
  background: #ffffff;
}

/* Минималистичная лента миниатюр в лайтбоксе */
.lb-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: #0b0d11;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.lb-thumbs::-webkit-scrollbar {
  display: none;
}

.lb-thumb {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid transparent;
  background: #000;
  opacity: 0.42;
  cursor: pointer;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.lb-thumb:first-child {
  margin-left: auto;
}

.lb-thumb:last-child {
  margin-right: auto;
}

.lb-thumb:hover {
  opacity: 0.78;
}

.lb-thumb.active {
  opacity: 1;
  border-color: #ffffff;
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}