/* Product details page */

#product-content.product-container.product-container--detail {
  display: block;
}

#product-content.product-container--loading {
  min-height: 640px;
}

.product-page-skeleton-title,
.product-skeleton-block {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--soft-bg) 0%, #f6f8f5 45%, var(--soft-bg) 90%);
  background-size: 200% 100%;
  animation: product-skeleton-shimmer 1.35s ease-in-out infinite;
}

.product-page-skeleton-title {
  height: 32px;
  max-width: 420px;
  margin: 0 auto 24px;
}

.product-skeleton-block {
  width: 100%;
  height: 520px;
  border: 1px solid var(--border);
}

@keyframes product-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.product-page-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  grid-template-areas:
    "title"
    "gallery"
    "main";
}

.product-page-title {
  grid-area: title;
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  font-family: var(--font-display);
}

.product-gallery-sticky {
  grid-area: gallery;
  min-width: 0;
}

.product-main {
  grid-area: main;
  min-width: 0;
}

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

.product-gallery-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0;
}

.product-gallery-actions .btn-action {
  margin-bottom: 0;
}

.product-license-box {
  margin-top: 0;
  margin-bottom: 0;
}

.main-image-container {
  width: 100%;
  height: 520px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--soft-bg);
}

.main-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.no-image-text {
  color: var(--text-mute);
  font-style: italic;
}

.product-image-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.product-image-list img,
.product-image-item {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  background: var(--soft-bg);
  transition: 0.15s;
}

.product-image-list img:hover,
.product-image-item:hover {
  border-color: var(--border-strong);
}

.product-image-list img.active,
.product-image-item.active {
  border-color: var(--text);
}

.product-license-link {
  color: var(--text-dim);
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-license-link:hover {
  color: var(--text);
}

.product-size-box .product-size-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-mute);
  font-size: 12px;
}

.product-size-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.product-size-input:focus {
  outline: none;
  border-color: var(--text);
}

.product-info .price,
.product-info > p:first-of-type {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin: 4px 0 22px;
}

.selection-area {
  margin-bottom: 0;
}

.product-material-box .product-desc {
  margin-bottom: 12px;
}

.selection-area select {
  width: 100%;
  padding: 13px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
}

.btn-action {
  width: 100%;
  padding: 16px;
  background: var(--text);
  color: #fff;
  border: 1px solid var(--text);
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
  margin-bottom: 12px;
  font-family: inherit;
}

.btn-action:hover {
  background: #000;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary-action {
  background: var(--primary-gradient);
  color: #fff;
  border: 1px solid var(--primary);
}

.btn-primary-action:hover {
  background: var(--primary-gradient-hover);
  border-color: var(--primary-hover);
}

/* Buttons */
.btn {
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
  color: #fff;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: var(--text);
}
.btn-primary:hover {
  background: #000;
}
.btn-add {
  background: var(--success);
}
.btn-danger,
.btn-delete {
  background: var(--danger);
}

/* Dropdown components */
.dropdown-container {
  position: relative;
  width: 100%;
}

.select-box {
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  font-size: 14px;
}

.dropdown-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  position: absolute;
  width: 100%;
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 6px;
  box-shadow: var(--shadow-md);
}

.dropdown-item {
  padding: 12px 16px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: var(--soft-bg);
  color: var(--text);
}

.hidden {
  display: none;
}

.sidebar-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  margin-bottom: 16px;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-weight: 700;
}

.btn-full {
  width: 100%;
}

.product-reviews {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.product-reviews-title {
  font-size: 22px;
  margin: 0 0 16px;
}

.review-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.review-summary-text {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
}

.review-stars {
  display: inline-flex;
  gap: 2px;
  color: #f5b301;
  font-size: 18px;
  line-height: 1;
}

.review-star {
  background: none;
  border: none;
  padding: 0 2px;
  color: #d0d0d0;
  cursor: default;
  font-size: inherit;
  line-height: 1;
}

.review-stars-interactive .review-star {
  cursor: pointer;
}

.review-star.is-filled {
  color: #f5b301;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.review-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  background: var(--card-bg);
}

.review-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 8px;
}

.review-author {
  font-size: 15px;
}

.review-date {
  color: var(--text-dim);
  font-size: 13px;
}

.review-body {
  margin: 10px 0 0;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}

.review-form-area {
  max-width: 560px;
}

.review-form-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  background: var(--card-bg);
}

.review-form-card h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.review-form-card-owned h3 {
  margin-bottom: 10px;
}

.review-owned-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.review-owned-head h3 {
  margin: 0;
}

.review-edit-btn,
.review-cancel-btn {
  max-width: none;
  width: auto;
  padding: 8px 14px;
  font-size: 14px;
}

.review-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.review-form-actions .btn-primary-action {
  flex: 1;
  min-width: 160px;
}

.review-rating-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.review-body-input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
}

.review-form-error {
  color: var(--danger);
  font-size: 14px;
  margin: 0 0 12px;
}

.review-signin-hint {
  margin: 0 0 12px;
  color: var(--text-dim);
}

.review-signin-btn {
  max-width: 200px;
}

/* Product page: two-column grid + sticky gallery (desktop only) */
@media (min-width: 769px) {
  .product-page-grid {
    grid-template-columns: calc(50% - 28px) 1fr;
    column-gap: 56px;
    row-gap: 18px;
    grid-template-areas:
      "gallery title"
      "gallery main";
  }

  .product-page-title {
    font-size: 30px;
  }

  .product-gallery-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 24px;
    align-self: start;
    z-index: 2;
  }

  .product-gallery-sticky .main-image-container {
    height: min(520px, calc(100dvh - 220px));
  }
}

@media (max-width: 768px) {
  .product-container--detail {
    display: block;
  }

  .product-license-box {
    margin-top: 0;
  }

  .main-image-container {
    height: min(52vw, 320px);
    border-radius: var(--radius-md);
  }

  .product-info .price,
  .product-info > p:first-of-type {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .btn-action {
    padding: 14px;
    font-size: 16px;
  }

  .product-image-list img,
  .product-image-item {
    width: 64px;
    height: 64px;
  }
}
