.product-page-head {
  margin-bottom: 14px;
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 24px;
  align-items: start;
}

/* Sticky sidebar on desktop */
.product-detail-side {
  position: sticky;
  top: 108px; /* navbar (78px) + top offset (10px) + gap (20px) */
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.product-page-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.product-main-card {
  overflow: hidden;
}

.product-detail-image {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.04);
}

.product-detail-side {
  display: flex;
  flex-direction: column;
}

.product-status-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.product-page-title,
.product-detail-title {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.08;
}

.product-detail-category {
  margin-bottom: 18px;
}

.product-detail-price {
  margin-bottom: 18px;
}

.product-description,
.product-detail-description {
  line-height: 1.8;
  margin-bottom: 20px;
  white-space: pre-wrap;
  color: var(--text);
}

.product-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.product-meta-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.45);
}

body.dark .product-meta-card {
  background: rgba(255, 255, 255, 0.04);
}

.product-meta-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.product-meta-value {
  font-weight: 700;
  line-height: 1.5;
}

.product-alert-sold,
.product-alert-safe {
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-weight: 600;
  line-height: 1.6;
}

.product-alert-sold {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.24);
  color: #b91c1c;
}

.product-alert-safe {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.24);
  color: #047857;
}

.product-actions-wrap,
.row-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.gallery-row,
.product-gallery-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.gallery-thumb-btn,
.product-thumb-btn {
  width: 88px;
  height: 88px;
  padding: 0;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  transition: transform 0.16s ease;
}

.gallery-thumb-btn:hover,
.product-thumb-btn:hover {
  transform: translateY(-1px);
}

.gallery-thumb-btn.active,
.product-thumb-btn.active {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  transform: translateY(-1px);
}

.gallery-thumb-btn.active .gallery-thumb-img,
.product-thumb-btn.active .product-thumb-image {
  border-color: var(--accent);
}

.gallery-thumb-img,
.product-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: block;
}

.title-24 {
  font-size: 24px;
  line-height: 1.15;
  margin: 0;
}

.product-inline-meta {
  display: grid;
  gap: 10px;
}

.rating-stars,
.review-stars {
  letter-spacing: 0.08em;
  color: #f59e0b;
  font-weight: 700;
}

.old-price-inline {
  display: inline-block;
  margin-right: 10px;
  color: var(--muted);
  text-decoration: line-through;
  font-size: 20px;
  font-weight: 500;
}

.offer-modal-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--line);
}

.offer-old-price {
  display: inline-block;
  margin-right: 8px;
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 500;
}

#createProductImagesPreview.grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.image-preview-item {
  position: relative;
}

.image-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 13px;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.14s ease;
  z-index: 2;
}

.image-preview-remove:hover {
  background: rgba(239, 68, 68, 0.88);
}

@media (max-width: 1100px) {
  .product-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .product-layout {
    grid-template-columns: 1fr;
  }

  /* Disable sticky sidebar on mobile (single column layout) */
  .product-detail-side {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 900px) {
  .product-main-card .grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .product-meta-grid {
    grid-template-columns: 1fr;
  }

  .product-actions-wrap .btn,
  .row-actions .btn {
    width: 100%;
  }

  .product-page-title,
  .product-detail-title {
    font-size: 28px;
  }

  .product-related-grid {
    grid-template-columns: 1fr;
  }

  .product-detail-image {
    height: 300px;
    border-radius: 24px;
  }

  .gallery-thumb-btn,
  .product-thumb-btn {
    width: 74px;
    height: 74px;
  }
}

@media (max-width: 400px) {
  .product-detail-image {
    height: 220px;
  }
}

/* ─── Drag & drop image upload zone ─────────────── */
.image-drop-zone {
  border: 2px dashed var(--line);
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 14px;
  position: relative;
}

.image-drop-zone:hover,
.image-drop-zone.drag-active {
  border-color: var(--accent, #2563eb);
  background: rgba(37, 99, 235, 0.05);
  color: var(--accent);
}

.image-drop-zone-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
  line-height: 1;
}

.image-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.listing-helper-card {
  padding: 14px 16px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 18px;
  background: rgba(37, 99, 235, 0.06);
}

.listing-helper-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.listing-helper-text,
.listing-inline-hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.listing-inline-hint {
  margin-top: -8px;
}
