/* Страница товара */
.product-detail {
  padding: 45px 0 50px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 28px;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 0.7;
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

/* Галерея */
.product-gallery {
  width: 100%;
  min-width: 0;
}

.product-img-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: zoom-in;
  border: 1px solid var(--border);
  background: var(--card);
}

.product-main-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  padding: 16px;
  transition: transform 0.3s ease;
}

.product-img-wrap:hover .product-main-img {
  transform: scale(1.04);
}

.img-zoom-hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.45);
  color: white;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}

.product-img-wrap:hover .img-zoom-hint {
  opacity: 1;
}

.product-no-img {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: var(--card);
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* Инфо */
.product-info {
  width: 100%;
  min-width: 0;
}

.product-article {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-detail h1 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.product-excerpt {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
  word-break: break-word;
}

.product-description {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.product-description h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 10px;
}

.product-description p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
}

/* Лайтбокс */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}

.lightbox-close svg {
  width: 16px;
  height: 16px;
}

.lightbox-close:hover {
  background: var(--danger);
  color: white;
}

.back-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.btn-admin-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--primary-2);
  color: white;
  border-radius: 8px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn-admin-edit:hover {
  opacity: 0.85;
}

.prod-editable {
  display: inline-block;
  outline: none;
  border-radius: 0;
  transition: border-bottom 0.2s;
  cursor: text;
  border-bottom: 1px dashed transparent;
}

.prod-editable:hover {
  border-bottom: 1px dashed var(--primary-2);
}

.prod-editable:focus {
  border-bottom: 1px solid var(--primary-2);
}
#prodEditBar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  padding: 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 9999;
}

#prodSaveEdit {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--primary-2);
  color: white;
  transition: opacity 0.2s;
}

#prodSaveEdit:hover {
  opacity: 0.85;
}

#prodCancelEdit {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

#prodCancelEdit:hover {
  opacity: 0.75;
}

.btn-kaspi {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #f14635;
    color: white;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 50px;
    transition: opacity 0.2s;
    width: fit-content;
}

.btn-kaspi:hover { opacity: 0.85; }

.btn-kaspi svg {
    height: 25px;
    width: 25px;
}


@media (max-width: 768px) {
  .product-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
