/*
 * Kent & Hudson Frontend - Product Detail Page Styles
 * 产品详情页样式
 */

/* ========== Product Detail Layout ========== */
.pd-main {
  padding: 40px 0 80px;
}

.pd-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 50px;
  margin-bottom: 60px;
}

/* ========== Gallery ========== */
.pd-gallery {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.pd-gallery-main {
  background: #f5f5f5;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1/1;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

/* Override Swiper defaults so our aspect ratio is respected across breakpoints.
   Swiper sometimes injects inline height/width on .swiper-container via JS,
   so we use !important and rely on absolute wrapper inside. */
.pd-gallery-main.gallery-main,
.pd-gallery-main.swiper-container,
.pd-gallery-main.gallery-main.swiper-container {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  aspect-ratio: 1/1 !important;
  position: relative !important;
  overflow: hidden;
  border-radius: 4px;
}

.pd-gallery-main .swiper-wrapper {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex;
  transform: translate3d(0, 0, 0);
}

.pd-gallery-main .swiper-slide {
  flex-shrink: 0;
  width: 100% !important;
  height: 100% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}

.pd-gallery-main .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pd-gallery-pagination {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  z-index: 3;
  text-align: center;
}

.pd-gallery-pagination .swiper-pagination-bullet {
  background: rgba(255,255,255,0.6);
  opacity: 1;
}

.pd-gallery-pagination .swiper-pagination-bullet-active {
  background: var(--style-color-gold);
  width: 24px;
  border-radius: 4px;
}

/* Thumbs — horizontal Swiper carousel */
.pd-gallery-thumbs {
  cursor: pointer;
  width: 100%;
  position: relative;
  overflow: hidden;
  margin-top: 4px;
}

.pd-gallery-thumbs .swiper-wrapper {
  display: flex;
  gap: 10px;
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  transition-property: transform !important;
  box-sizing: content-box;
}

.pd-gallery-thumbs .swiper-slide {
  flex-shrink: 0;
  width: calc((100% - 30px) / 4) !important;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f5f5f5;
  opacity: 0.55;
  transition: opacity 0.25s, border-color 0.25s;
  border: 1.5px solid transparent;
  cursor: pointer;
  border-radius: 3px;
  box-sizing: border-box;
}

.pd-gallery-thumbs .swiper-slide.swiper-slide-thumb-active {
  opacity: 1;
  border-color: var(--style-color-gold);
  box-shadow: 0 2px 8px rgba(201, 169, 110, 0.25);
}

.pd-gallery-thumbs .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pd-gallery-thumbs .swiper-slide:hover {
  opacity: 0.9;
}

/* ========== Info ========== */
.pd-info {
  width: 100%;
}

.pd-brand {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--style-muted);
  margin-bottom: 12px;
}

.pd-brand a {
  color: var(--style-muted);
  text-decoration: underline;
}

.pd-brand a:hover { color: var(--style-color); }

.pd-title {
  font-size: 32px;
  font-weight: 500;
  margin-bottom: 16px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  line-height: 1.25;
}

.pd-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.stars { color: #f5b50a; font-size: 14px; }
.stars i { margin-right: 2px; }

.pd-review-count {
  font-size: 13px;
  color: var(--style-muted);
  text-decoration: underline;
}

.pd-review-count:hover { color: var(--style-color); }

/* Price */
.pd-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--style-border);
  border-bottom: 1px solid var(--style-border);
  margin-bottom: 24px;
}

.pd-current-price {
  font-size: 30px;
  font-weight: 500;
  color: #1a1a1a;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.pd-original-price {
  font-size: 16px;
  color: var(--style-muted);
  text-decoration: line-through;
}

.pd-save {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #1a1a1a;
  background: #f5e6d3;
  padding: 4px 10px;
  text-transform: uppercase;
  font-weight: 600;
}

.pd-description {
  font-size: 14px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 24px;
}

/* Meta */
.pd-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 20px;
  background: #fafafa;
  margin-bottom: 30px;
}

.pd-meta-item {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pd-meta-item .label {
  color: var(--style-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.pd-meta-item .value {
  color: #1a1a1a;
  font-weight: 500;
}

.condition-excellent { color: #2d8f3f; font-size: 8px; vertical-align: middle; }
.condition-very-good { color: #4caf50; font-size: 8px; vertical-align: middle; }
.condition-good { color: #ff9800; font-size: 8px; vertical-align: middle; }

/* Options */
.pd-options {
  margin-bottom: 30px;
}

.pd-option {
  margin-bottom: 20px;
}

.pd-option-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  color: #1a1a1a;
}

.pd-color-options {
  display: flex;
  gap: 8px;
}

.pd-color-options .color-swatch {
  width: 32px;
  height: 32px;
  position: relative;
}

.pd-color-options .color-swatch.active {
  outline: 2px solid var(--style-color);
  outline-offset: 3px;
}

.pd-color-options input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

/* Quantity */
.pd-quantity {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--style-border);
}

.pd-quantity button {
  width: 38px;
  height: 38px;
  background: #fff;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #1a1a1a;
}

.pd-quantity button:hover { background: #f5f5f5; }

.pd-quantity input {
  width: 50px;
  height: 38px;
  border: none;
  text-align: center;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a1a;
  border-left: 1px solid var(--style-border);
  border-right: 1px solid var(--style-border);
  -moz-appearance: textfield;
}

.pd-quantity input::-webkit-outer-spin-button,
.pd-quantity input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Actions */
.pd-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-pd-add {
  flex: 1;
  padding: 16px 30px;
}

.btn-pd-add i { margin-right: 8px; }

.pd-icon-btn {
  width: 54px;
  height: 54px;
  background: #fff;
  border: 1px solid var(--style-border);
  cursor: pointer;
  font-size: 18px;
  color: #1a1a1a;
  transition: all 0.25s;
}

.pd-icon-btn:hover,
.pd-icon-btn.active {
  background: var(--style-color);
  border-color: var(--style-color);
  color: #fff;
}

.btn-pd-buy {
  width: 100%;
  margin-bottom: 30px;
}

/* Trust */
.pd-trust {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding-top: 30px;
  border-top: 1px solid var(--style-border);
}

.pd-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pd-trust-item i {
  font-size: 18px;
  color: var(--style-color);
  margin-top: 2px;
}

.pd-trust-item strong {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  display: block;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pd-trust-item p {
  font-size: 12px;
  color: var(--style-muted);
  margin: 0;
}

/* ========== Tabs ========== */
.pd-tabs {
  margin-top: 60px;
}

.pd-tab-list {
  display: flex;
  border-bottom: 1px solid var(--style-border);
  overflow-x: auto;
  white-space: nowrap;
}

.pd-tab-btn {
  padding: 18px 24px;
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--style-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.25s;
  font-family: inherit;
}

.pd-tab-btn:hover { color: var(--style-color); }

.pd-tab-btn.active {
  color: var(--style-color);
  border-bottom-color: var(--style-color);
}

.pd-tab-pane {
  display: none;
  padding: 40px 0;
}

.pd-tab-pane.active {
  display: block;
  animation: fadeIn 0.4s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pd-tab-content h3 {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 16px;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.pd-tab-content p {
  font-size: 14px;
  color: #555;
  line-height: 1.85;
  margin-bottom: 16px;
}

.pd-tab-content ul {
  margin-bottom: 16px;
  padding-left: 20px;
}

.pd-tab-content ul li {
  list-style: disc;
  font-size: 14px;
  color: #555;
  line-height: 1.85;
  margin-bottom: 8px;
}

/* Specs */
.pd-specs-table {
  width: 100%;
  border-collapse: collapse;
  max-width: 600px;
}

.pd-specs-table tr {
  border-bottom: 1px solid var(--style-border);
}

.pd-specs-table td {
  padding: 14px 12px;
  font-size: 13px;
}

.pd-specs-table td:first-child {
  font-weight: 600;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  width: 200px;
}

.pd-specs-table td:last-child {
  color: #555;
}

/* Reviews */
.pd-review-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--style-border);
  margin-bottom: 30px;
}

.pd-review-rating {
  text-align: center;
}

.pd-review-rating h3 {
  font-size: 56px;
  font-weight: 500;
  margin-bottom: 8px;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.pd-review-rating .stars {
  font-size: 16px;
  margin-bottom: 8px;
}

.pd-review-rating p {
  font-size: 12px;
  color: var(--style-muted);
  margin: 0;
}

.pd-review-bars {
  width: 100%;
}

.pd-review-bar-row {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--style-muted);
}

.pd-review-bar {
  height: 8px;
  background: #f0f0f0;
  position: relative;
  overflow: hidden;
}

.pd-review-bar span {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #f5b50a;
}

.pd-review-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--style-border);
}

.pd-review-item:last-child { border-bottom: none; }

.pd-review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.pd-review-header strong {
  font-size: 14px;
  color: #1a1a1a;
}

.pd-review-header .stars {
  font-size: 12px;
}

.pd-review-date {
  font-size: 12px;
  color: var(--style-muted);
  margin-left: auto;
}

.pd-review-item h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  font-family: inherit;
}

.pd-review-item p {
  font-size: 13px;
  color: #555;
  line-height: 1.7;
  margin: 0;
}

/* ========== Related Products ========== */
.pd-related {
  margin-top: 80px;
  padding-top: 60px;
  border-top: 1px solid var(--style-border);
}

.pd-related .product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px 16px;
}

/* ========== Section Header (LV Themed) ========== */
.section-header,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header.center,
.section-head.center {
  display: block;
  text-align: center;
  margin-bottom: 50px;
}

.section-tag {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--style-color-gold);
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 600;
  display: block;
}

.section-title {
  font-size: 38px;
  font-weight: 500;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--style-color);
  line-height: 1.15;
  margin: 0;
}

.section-divider {
  width: 50px;
  height: 1px;
  background: var(--style-color-gold);
  margin: 16px auto 0;
}

.section-header.center .section-divider { margin: 16px auto 0; }

/* ========== 响应式 ========== */
@media (min-width: 768px) {
  .pd-layout {
    grid-template-columns: 1fr 1fr;
    gap: 60px;
  }
  .pd-meta {
    grid-template-columns: repeat(4, 1fr);
  }
  .pd-trust {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
  }
  .pd-review-summary {
    grid-template-columns: 1fr 2fr;
  }
  .pd-related .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 50px 24px;
  }
  .section-title { font-size: 38px; }
}

@media (max-width: 991px) {
  .pd-related .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .pd-title { font-size: 26px; }
  .pd-current-price { font-size: 24px; }
  .pd-tab-btn { padding: 14px 16px; font-size: 11px; }
  .pd-related .product-grid { grid-template-columns: repeat(2, 1fr); }
  .section-header,
  .section-head { flex-direction: column; align-items: flex-start; }
  .section-title { font-size: 28px; }

  /* Gallery responsive fix for mobile */
  .pd-gallery {
    max-width: 100%;
  }
  .pd-gallery-main,
  .pd-gallery-main.gallery-main,
  .pd-gallery-main.swiper-container {
    aspect-ratio: 1/1 !important;
    max-height: 70vh;
  }
  .pd-gallery-thumbs .swiper-slide {
    width: calc(25% - 8px);
  }
}

@media (max-width: 480px) {
  .pd-gallery-thumbs .swiper-wrapper {
    gap: 6px;
  }
  .pd-gallery-thumbs .swiper-slide {
    width: calc(25% - 5px);
  }
}
