/* ==========================================================================
   Product Detail Page Stylesheet (Classic B2B Template) - Wanda Wood
   ========================================================================== */

/* Sub-page Hero / Breadcrumb */
/* Product Detail Section Layout */
.product-detail-section {
  background: var(--paper);
  padding: 100px 0;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 260px 1fr; /* 与 catalog 页的 260px 对齐 */
  gap: 52px;
  align-items: start;
}

/* Left Sidebar card container for Recommended Products widget */
.sidebar-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(11, 13, 14, 0.02);
  overflow: hidden;
  margin-bottom: 30px;
}

.sidebar-card__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 20px 20px 10px;
  position: relative;
}

/* 橙金色短线底条 (匹配 Categories 视觉) */
.sidebar-card__title::after {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: var(--brown);
  margin-top: 10px;
}

/* Recommended Products List */
.sidebar-list {
  display: flex;
  flex-direction: column;
}

.rec-item {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  text-decoration: none;
  transition: background 0.25s ease;
}

.rec-item:last-child {
  border-bottom: none;
}

.rec-item:hover {
  background: #fafafa;
}

.rec-item__thumb {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rec-item__thumb img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}

.rec-item__content {
  display: flex;
  flex-direction: column;
}

.rec-item__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin: 0 0 4px;
  transition: color 0.25s ease;
}

.rec-item:hover .rec-item__title {
  color: var(--brown);
}

/* ==========================================================================
   Product Detail Page Stylesheet (Classic B2B Template) - Wanda Wood
   ========================================================================== */

/* Sub-page Hero / Breadcrumb */
/* Product Detail Section Layout */
.product-detail-section {
  background: var(--paper);
  padding: 100px 0;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 260px 1fr; /* 与 catalog 页的 260px 对齐 */
  gap: 52px;
  align-items: start;
}

/* Left Sidebar card container for Recommended Products widget */
.sidebar-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(11, 13, 14, 0.02);
  overflow: hidden;
  margin-bottom: 30px;
}

.sidebar-card__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 20px 20px 10px;
  position: relative;
}

/* 橙金色短线底条 (匹配 Categories 视觉) */
.sidebar-card__title::after {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: var(--brown);
  margin-top: 10px;
}

/* Recommended Products List */
.sidebar-list {
  display: flex;
  flex-direction: column;
}

.rec-item {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  text-decoration: none;
  transition: background 0.25s ease;
}

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

.rec-item:hover {
  background: #fafafa;
}

.rec-item__thumb {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rec-item__thumb img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}

.rec-item__content {
  display: flex;
  flex-direction: column;
}

.rec-item__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin: 0 0 4px;
  transition: color 0.25s ease;
}

.rec-item:hover .rec-item__title {
  color: var(--brown);
}

.rec-item__meta {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

/* 2. Main Detail Column styles */
.product-showcase {
  display: grid;
  grid-template-columns: 46% minmax(0, 1fr);
  gap: 40px;
  margin-bottom: 50px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Gallery Showcase Styles */
.product-gallery {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.product-gallery__main {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(226, 218, 208, 0.85);
  border-radius: 16px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 6px 20px rgba(28, 22, 16, 0.04);
  box-sizing: border-box;
  padding: 12px;
}

.product-gallery__main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.product-gallery__thumbs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.gallery-ctrl {
  background: #ffffff;
  border: 1px solid #e0d8cd;
  font-size: 13px;
  color: #6a6258;
  cursor: pointer;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.gallery-ctrl:hover {
  color: #ffffff;
  background: var(--brown, #8c532b);
  border-color: var(--brown, #8c532b);
  box-shadow: 0 4px 12px rgba(140, 83, 43, 0.3);
}

/* 限定一次固定只显示 4 张缩略图：(58px * 4 + 8px * 3) = 256px */
.thumbs-list {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 256px;
  max-width: calc(100% - 80px);
  overflow: hidden;
  scroll-behavior: smooth;
  box-sizing: border-box;
}

.thumb-item {
  width: 58px;
  flex: 0 0 58px;
  height: 58px;
  aspect-ratio: 1 / 1;
  border: 1.5px solid #e6dfd5;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: all 0.25s ease;
  box-sizing: border-box;
  padding: 3px;
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.thumb-item.active {
  border-color: var(--brown, #8c532b);
  box-shadow: 0 0 0 1px var(--brown, #8c532b);
}

.product-bullets li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--brown, #8c532b);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Right Detail Buy/Specs Panel */
.product-info-buy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 10px;
}

.product-title {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 16px;
  line-height: 1.25;
}

.product-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 34px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-bullets li {
  font-size: 15px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  line-height: 1.4;
}

.product-bullets li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--brown);
  border-radius: 50%;
  flex-shrink: 0;
}

/* 描边询盘按钮 (修复高度与比例) */
.btn-inquire-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  min-height: 44px;
  padding: 0 28px;
  border: 1.5px solid var(--brown, #8c532b);
  border-radius: 8px;
  background: transparent;
  color: var(--brown, #8c532b);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.28s ease;
  box-sizing: border-box;
  aspect-ratio: auto !important;
}

.btn-inquire-outline:hover {
  background: var(--brown);
  color: #fff;
}

/* 3. Product Detail Content & Overflow Safeguards */
.product-detail-content {
  margin-top: 30px;
  border: 1px solid rgba(226, 218, 208, 0.85);
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(28, 22, 16, 0.04);
}

.product-detail-content__body {
  padding: 36px;
  color: #4a423a;
  font-size: 15px;
  line-height: 1.8;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden;
}

.product-detail-content__body h1,
.product-detail-content__body h2,
.product-detail-content__body h3,
.product-detail-content__body h4 {
  margin: 20px 0 12px;
  color: #26211c;
  line-height: 1.35;
}

.product-detail-content__body p {
  margin: 0 0 16px;
}

.product-detail-content__body img,
.product-detail-content__body video,
.product-detail-content__body iframe {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 12px;
  margin: 16px 0;
  display: block;
  object-fit: contain;
}

.product-detail-content__body table {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 20px 0;
  word-break: normal;
}

.product-detail-content__body pre,
.product-detail-content__body code {
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
  overflow-x: auto;
}

/* 3. Product Tabs Layout */
.product-tabs {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 16px rgba(11, 13, 14, 0.01);
  margin-top: 20px;
}

.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--line);
  list-style: none;
  padding: 0;
  margin: 0;
  background: #fcfcfc;
}

.tab-nav-item {
  padding: 16px 28px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.25s ease;
  border-right: 1px solid var(--line);
  position: relative;
}

.tab-nav-item:hover {
  color: var(--ink);
}

.tab-nav-item.active {
  color: var(--brown);
  background: #fff;
}

.tab-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brown);
}

.tab-panel {
  padding: 40px;
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 16px;
}

.tab-panel p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 20px;
}

.tab-panel p:last-child {
  margin-bottom: 0;
}

.tab-specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.tab-specs-table tr {
  border-bottom: 1px solid var(--line);
}

.tab-specs-table tr:last-child {
  border-bottom: none;
}

.tab-specs-table td {
  padding: 12px 16px;
  font-size: 14px;
}

.tab-specs-table td.label {
  color: var(--muted);
  font-weight: 600;
  width: 30%;
  background: #fafafa;
}

.tab-specs-table td.value {
  color: var(--ink);
  font-weight: 500;
}

/* 4. Inquiry Message Popup Modal Styles */
.inquiry-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.inquiry-modal.active {
  display: flex;
}

.inquiry-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 13, 14, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.inquiry-modal__content {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(11, 13, 14, 0.15);
  z-index: 3010;
  padding: 40px;
  animation: modalFadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.inquiry-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 3020;
}

.inquiry-modal__close:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.global-inquiry-modal .inquiry-modal__content {
  max-width: 720px;
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow-y: auto;
  border-radius: 18px;
}

.inquiry-modal__header {
  margin-bottom: 24px;
}

.inquiry-modal__header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
}

.inquiry-modal__header p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--brown);
  outline: none;
  box-shadow: 0 0 0 3px rgba(160, 123, 88, 0.08);
}

.btn--full {
  width: 100%;
  height: 48px;
  justify-content: center;
}

/* Success layout overlay */
.inquiry-modal__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0;
}

.inquiry-modal__success i {
  font-size: 54px;
  color: #2e7d32;
  margin-bottom: 18px;
}

.inquiry-modal__success h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 10px;
}

.inquiry-modal__success p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 24px;
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Design (Product Detail)
   ========================================================================== */

@media (max-width: 992px) {
  /* Layout: Main content comes FIRST on mobile, Sidebar comes SECOND */
  .products-layout-container,
  .product-detail-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .products-main {
    order: 1;
    width: 100%;
  }

  .products-sidebar {
    order: 2;
    width: 100%;
    position: static;
    margin-top: 10px;
  }

  /* Showcase Grid: Single Column */
  .product-showcase {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 32px;
  }

  /* Gallery Main Container Adaptation */
  .product-gallery__main {
    width: 100%;
    max-height: 360px;
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(226, 218, 208, 0.85);
    box-shadow: 0 8px 24px rgba(28, 22, 16, 0.05);
    padding: 14px;
  }

  .product-gallery__main img {
    max-height: 100%;
    object-fit: contain;
  }

  /* Mobile Gallery Thumbnails: Smooth Touch Horizontal Scrollbar */
  .product-gallery__thumbs {
    margin-top: 14px;
    gap: 0;
    justify-content: flex-start;
  }

  .gallery-ctrl {
    display: none !important; /* Hide cramped prev/next arrows on touch screens */
  }

  .thumbs-list {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding-bottom: 4px;
    gap: 10px;
  }

  .thumbs-list::-webkit-scrollbar {
    display: none; /* Hide default scrollbar for native app feel */
  }

  .thumb-item {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    border-radius: 10px;
  }

  /* Buy & Info Column Mobile Styling */
  .product-info-buy {
    padding-top: 0;
    width: 100%;
  }

  .product-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    color: #1f1a16;
    margin-bottom: 14px;
  }

  .product-bullets {
    margin-bottom: 24px;
    gap: 10px;
  }

  .product-bullets li {
    font-size: 14px;
    color: #4a423a;
  }

  /* High-Converting Golden Gradient Call-To-Action Button for Mobile */
  .btn-inquire-outline {
    width: 100%;
    min-height: 50px;
    padding: 0 20px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #c78d52 0%, var(--brown, #8c532b) 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(140, 83, 43, 0.32);
  }

  .btn-inquire-outline:hover {
    background: linear-gradient(135deg, #b87d43 0%, #764320 100%);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(140, 83, 43, 0.4);
  }

  /* Article Detail Content Mobile Optimization */
  .product-detail-content {
    margin-top: 24px;
    border-radius: 16px;
  }

  .product-detail-content__body {
    padding: 22px 18px;
    font-size: 14.5px;
    line-height: 1.75;
  }
}

@media (max-width: 576px) {
  .products-layout-section,
  .product-detail-section {
    padding: 24px 0 50px;
  }

  .product-gallery__main {
    max-height: 280px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    padding: 10px;
  }

  .thumb-item {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 8px;
  }

  .product-title {
    font-size: 20px;
  }

  .product-detail-content__body {
    padding: 18px 14px;
  }
}
