/* Страница товара — поверх общей темы (style.css) */

html {
  overflow-x: clip;
}

body {
  overflow-x: clip;
}

.wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
  box-sizing: border-box;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 36px;
  margin-top: 36px;
}

.back-btn:hover {
  border-color: var(--acc-line);
  color: var(--acc);
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 80px;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gallery-main {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 14px;
  min-height: 360px;
  box-shadow: var(--shadow-card);
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.thumb {
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  display: grid;
  place-items: center;
  color: var(--ink-4);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  font-family: inherit;
}

.thumb:hover {
  border-color: var(--acc);
}

.thumb.is-active {
  border-color: var(--acc);
  box-shadow: 0 0 0 1px var(--acc);
}

.product-info h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--ink-0);
  margin: 0 0 16px;
  line-height: 1.2;
}

.product-sku {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 12px;
}

.product-desc {
  font-size: 15px;
  color: var(--ink-2);
  margin-bottom: 28px;
  line-height: 1.6;
}

.specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
  padding: 22px;
  margin-bottom: 28px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.spec {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spec-key {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.spec-val {
  font-size: 14px;
  color: var(--ink-1);
}

/* Тот же «tech» вид, что у «В НАЛИЧИИ» в каталоге */
.spec-val--stock {
  align-self: flex-start;
  margin-top: 2px;
  padding: var(--badge-tech-pad-y) var(--badge-tech-pad-x);
  font-size: var(--badge-tech-fs);
  font-weight: 700;
  letter-spacing: var(--badge-tech-letter);
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  background: var(--badge-tech-bg);
  border: 1px solid var(--badge-tech-border);
  box-shadow: var(--badge-tech-glow);
  color: var(--acc);
}

.spec-val--stock-low {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.22);
}

.spec-val--stock-out {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.18);
}

.price-block {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.price-val {
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: var(--ink-0);
  line-height: 1;
  font-weight: 600;
}

.price-unit {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink-2);
  margin-left: 4px;
}

.price-from {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

.btn {
  padding: 14px 26px;
  border: 1px solid var(--acc);
  border-radius: var(--radius-md);
  background: var(--acc);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--acc-hover);
  border-color: var(--acc-hover);
  box-shadow: var(--shadow-btn-fill-hover);
  transform: translateY(-1px);
}

.details {
  margin-top: 8px;
}

.details h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-0);
  margin: 0 0 14px;
}

.details p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
  margin: 0;
}

.details ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.details li {
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 10px;
  padding-left: 22px;
  position: relative;
}

.details li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--acc);
  font-weight: 600;
}

.details h3:nth-of-type(2),
.details h3:nth-of-type(3) {
  margin-top: 28px;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 36px;
  margin-top: 64px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

.footer a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--acc);
}

@media (max-width: 768px) {
  .wrap {
    padding: 0 16px;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .product-info h1 {
    font-size: 1.65rem;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(4, 1fr);
  }
}
