/* ========= 
   TYLER UI TOKENS (colors + spacing)
   ========= */
:root {
  /* tell browser our UI is dark-first */
  color-scheme: dark;

  /* Brand */
  --brand: #4f46e5;          /* main accent */
  --brand-2: #7c3aed;        /* secondary accent */
  --brand-contrast: #ffffff;

  /* Neutrals (DARK DEFAULT) */
  --bg: #0b1220;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2937;

  /* Surfaces */
  --surface: #0f172a;
  --surface-2: #111827;

  /* Status */
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Layout */
  --radius: 12px;
  --gap: 12px;
  --page-pad: 20px;
}

/* =========
   Base
   ========= */
* { box-sizing: border-box; }

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0; /* ✅ важно: убрали общий внутренний отступ */
  background: var(--bg);
  color: var(--text);
}


header {
  margin-bottom: 20px;
}

/* links */
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* =========
   Components
   ========= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(348px, 1fr));
  gap: var(--gap);
  justify-content: center;
}


.card {
  width: 348px;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;

  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card img {
  width: 100%;
  height: 260px;          /* ← ВОТ ЗДЕСЬ РЕШАЕМ */
  object-fit: cover;
  border-radius: 12px;
  display: block;
}


/* Optional: keep descriptions tidy */
.product-description {
  margin: 6px 0 12px;
  line-height: 1.5;

  /* ✅ clamp to 4 lines so cards stay neat */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

@media (max-width: 420px) {
  .card {
    width: 100%;
  }
}


/* button (на будущее, чтобы было единообразно) */
button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}
button:hover {
  border-color: var(--brand);
}

/* small helpers */
.muted { color: var(--muted); }

/* =========
   Layout helpers
   ========= */
.container {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 16px;
}

/* =========
   Header / Nav (responsive)
   ========= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.header-inner {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

.nav {
  display: flex;
  gap: 14px;
  align-items: center;
}

.nav a {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
}

.nav a:hover {
  background: var(--surface-2);
  text-decoration: none;
}

/* =========
   Mobile menu (CSS-only) — SEX → CLOSE
   ========= */

.nav-toggle { display: none; }

.nav-btn {
  display: none;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.35em;
  font-size: 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  user-select: none;
  position: relative;
}

/* show only on mobile */
@media (max-width: 640px) {
  .nav-btn { display: inline-flex; }

  .nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .nav a {
    display: block;
    padding: 12px 10px;
  }

  /* open menu */
  .nav-toggle:checked ~ .nav {
    display: block;
  }
}

/* TEXT SWITCH */
/* default text */
.sex-btn::after {
  content: attr(data-open);
}

/* hide original text node */
.sex-btn {
  color: transparent;
}

/* when open */
.nav-toggle:checked + .sex-btn::after {
  content: attr(data-close);
}

.nav-toggle:checked + .sex-btn {
  background: var(--brand);
  border-color: var(--brand);
  color: transparent;
}

/* text color */
.sex-btn::after {
  color: var(--text);
}

.nav-toggle:checked + .sex-btn::after {
  color: var(--brand-contrast);
}

.sex-btn::after{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.35em;
}

/* =========
   Main
   ========= */
.site-main {
  padding: 28px var(--page-pad) 60px; /* ✅ общий отступ теперь тут */
}


/* =========
   Footer
   ========= */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 20px 0;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-muted {
  font-size: 12px;
  color: var(--muted);
}

.footer-admin {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.badge {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  line-height: 1.6;
  text-transform: uppercase;
}

.badge-green {
  background: #1f7a3f;
  color: #dff6e7;
}

.badge-red {
  background: #7a1f1f;
  color: #fde2e2;
}

.badge-gray {
  background: #444;
  color: #ddd;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--brand);
  cursor: pointer;
}

.footer-admin:hover {
  color: var(--text);
  text-decoration: underline;
}
.sold-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  z-index: 2;
}

.card.is-sold-out {
  opacity: 0.7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease, opacity 0.2s ease;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: var(--brand-2);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.card.is-sold-out .btn-primary {
  opacity: 0.9; /* слегка спокойнее, но всё ещё кликабельно */
}
