/* ==========================================================================
   Product List Page Stylesheet (Classic B2B Enterprise) - Wanda Wood
   ========================================================================== */

/* Products Page Layout Container */
.products-layout-section {
  background: linear-gradient(180deg, #f9f8f6 0%, #efece6 100%);
  padding: 64px 0 96px;
}

.products-layout-container {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

/* 1. Sidebar Category Accordion Tree & Widgets (Premium Modern Design) */
.products-sidebar {
  position: sticky;
  top: 100px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-menu-card {
  border: 1px solid rgba(226, 218, 208, 0.85);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(28, 22, 16, 0.05);
  overflow: hidden;
}

.sidebar-menu-title {
  padding: 18px 22px;
  background: linear-gradient(135deg, #241e18 0%, #3a2e23 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-menu-title i {
  color: var(--brown, #8c532b);
  font-size: 15px;
}

.all-products-header {
  font-size: 14px;
  font-weight: 700;
  color: #1a1613;
  padding: 15px 22px;
  border-bottom: 1px solid #f2ece4;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.25s ease;
  border-left: 4px solid transparent;
  background: #ffffff;
  text-decoration: none;
}

.all-products-header span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.all-products-header span i {
  color: var(--brown, #8c532b);
  font-size: 13px;
}

.all-products-header:hover,
.all-products-header.active {
  background: #faf7f3;
  color: var(--brown, #8c532b);
  border-left-color: var(--brown, #8c532b);
}

.category-accordion {
  display: flex;
  flex-direction: column;
}

.category-parent {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 22px;
  font-size: 14px;
  font-weight: 700;
  color: #2b241e;
  border-bottom: 1px solid #f4efe8;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s ease;
  border-left: 4px solid transparent;
  background: #ffffff;
  text-decoration: none;
}

.category-parent i {
  font-size: 11.5px;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.3s ease;
  color: #928a80;
}

.category-parent:hover,
.category-parent.active {
  background: #fcf9f5;
  color: var(--brown, #8c532b);
  border-left-color: var(--brown, #8c532b);
}

.category-parent.active i {
  transform: rotate(180deg);
  color: var(--brown, #8c532b);
}

/* Submenu with indent and active dot */
.category-children {
  list-style: none;
  padding: 6px 0;
  margin: 0;
  background: #fbf9f6;
  border-bottom: 1px solid #f0e9e0;
  display: none; /* Collapsed by default */
}

.category-children.is-open {
  display: block;
}

.category-children li {
  border-bottom: none;
}

.category-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px 10px 34px;
  font-size: 13.5px;
  color: #635b52;
  font-weight: 500;
  transition: all 0.25s ease;
  position: relative;
}

.category-link::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c2b9ad;
  transition: all 0.25s ease;
}

.category-link:hover,
.category-link.active {
  color: var(--brown, #8c532b);
  background: #ffffff;
  font-weight: 700;
  padding-left: 38px;
}

.category-link:hover::before,
.category-link.active::before {
  background: var(--brown, #8c532b);
  transform: scale(1.4);
}

/* Sidebar Help Promo Card */
.sidebar-promo-card {
  background: linear-gradient(145deg, #1f1a16 0%, #3a2b20 100%);
  border-radius: 18px;
  padding: 26px 24px;
  color: #ffffff;
  box-shadow: 0 14px 36px rgba(31, 26, 22, 0.2);
  position: relative;
  overflow: hidden;
}

.sidebar-promo-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(199, 141, 82, 0.15);
  pointer-events: none;
}

.promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: #d4a373;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.sidebar-promo-card h4 {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 8px;
  line-height: 1.35;
}

.sidebar-promo-card p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 18px;
  line-height: 1.5;
}

.promo-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #c78d52 0%, var(--brown, #8c532b) 100%);
  border: 0;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(140, 83, 43, 0.35);
  transition: all .25s ease;
}

.promo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(140, 83, 43, 0.45);
}

/* Sidebar General Widget Styling (Same as News Detail Sidebar) */
.sidebar-widget {
  background: #ffffff;
  border: 1px solid rgba(226, 218, 208, 0.85);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(28, 22, 16, 0.04);
}

.widget-title {
  font-size: 15px;
  font-weight: 800;
  color: #1f1a16;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f2ece4;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-title i {
  color: var(--brown, #8c532b);
}

.widget-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 36px;
  height: 2px;
  background: var(--brown, #8c532b);
}

.recent-articles-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.recent-article-item {
  display: flex;
  gap: 14px;
  text-decoration: none;
  align-items: center;
  padding: 6px;
  border-radius: 12px;
  transition: background .2s ease;
}

.recent-article-item:hover {
  background: #faf7f3;
}

.recent-article-item__thumb {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #eee9e2;
}

.recent-article-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.recent-article-item:hover .recent-article-item__thumb img {
  transform: scale(1.08);
}

.recent-article-item__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.recent-article-item__date {
  font-size: 11.5px;
  color: #8c8378;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.recent-article-item__date i {
  color: var(--brown, #8c532b);
}

.recent-article-item__title {
  font-size: 13.5px;
  font-weight: 700;
  color: #241e18;
  line-height: 1.38;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s ease;
}

.recent-article-item:hover .recent-article-item__title {
  color: var(--brown, #8c532b);
}

/* 2. Main Product Grid Section */
.products-main {
  display: flex;
  flex-direction: column;
}

.products-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 44px;
}

#active-category-title {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.products-count {
  font-size: 13.5px;
  color: var(--muted);
}

.products-list-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px 30px;
}

.product-card-wrap {
  display: flex;
  flex-direction: column;
  background: transparent;
}

.product-card__media {
  height: 360px; /* 大尺寸垂直量感高清图 */
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: 0 10px 24px rgba(83, 61, 39, 0.02);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Glassmorphism Floating Category Badge */
.product-card__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--ink);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: 2px;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(11, 13, 14, 0.04);
}

/* 琥珀木色轻微光泽叠加层 */
.product-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(160, 123, 88, 0.05);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 2;
  pointer-events: none;
}

.product-card-wrap:hover .product-card__media {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(83, 61, 39, 0.08);
}

.product-card-wrap:hover .product-card__media img {
  transform: scale(1.05);
}

.product-card-wrap:hover .product-card__media::after {
  opacity: 1;
}

.product-card__caption {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 4px;
}

.product-card__title {
  font-size: 17.5px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 14px;
  line-height: 1.35;
  transition: color 0.25s ease;
}

.product-card-wrap:hover .product-card__title {
  color: var(--brown);
}

/* Specs Container Hidden on Grid List (Processed by jQuery for details modal) */
.product-card__specs {
  display: none;
}

/* Text link with Arrow details button style */
.btn-card-detail {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brown);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  margin-top: auto;
  align-self: flex-start;
  transition: color 0.3s ease;
}

.btn-card-detail i {
  font-size: 12px;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Parent card hover triggers details link styles */
.product-card-wrap:hover .btn-card-detail {
  color: var(--ink);
}

.product-card-wrap:hover .btn-card-detail i {
  transform: translateX(4px);
}

/* 3. Product Details Modal Styles */
.product-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.product-modal.active {
  display: flex;
}

.product-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 13, 14, 0.6);
  backdrop-filter: blur(4px);
}

.product-modal__content {
  position: relative;
  width: 100%;
  max-width: 900px;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(11, 13, 14, 0.15);
  z-index: 2010;
  overflow: hidden;
  animation: modalFadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  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: 2020;
}

.product-modal__close:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.product-modal__body {
  display: grid;
  grid-template-columns: 42% 1fr;
}

.product-modal__image {
  height: 100%;
  min-height: 480px;
  position: relative;
}

.product-modal__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-modal__info {
  padding: 44px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 90vh;
}

.product-modal__cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--brown);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
  display: block;
}

.product-modal__title {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 16px;
  line-height: 1.25;
}

.product-modal__desc {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 26px;
}

.product-modal__specs-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.product-modal__specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

.product-modal__specs-table tr {
  border-bottom: 1px solid var(--line);
}

.product-modal__specs-table tr:last-child {
  border-bottom: none;
}

.product-modal__specs-table td {
  padding: 10px 0;
  font-size: 13.5px;
  vertical-align: middle;
}

.product-modal__specs-table td.label {
  color: var(--muted);
  font-weight: 600;
  width: 38%;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.product-modal__specs-table td.value {
  color: var(--ink);
  font-weight: 700;
}

.product-modal__actions {
  margin-top: auto;
}

.product-modal__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 32px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 4px;
  text-decoration: none;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1080px) {
  .products-layout-container {
    gap: 34px;
  }

  .products-list-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 24px;
  }
}

@media (max-width: 760px) {
  .products-layout-section {
    padding: 50px 0 80px;
  }

  .products-layout-container {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Responsive Sidebar Panel on Mobile */
  .products-sidebar {
    position: static;
    margin-bottom: 40px;
  }

  .products-list-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .product-card__media {
    height: 240px;
  }

  /* Mobile Modal Adaptive View */
  .product-modal {
    padding: 10px;
  }

  .product-modal__content {
    max-height: 90vh;
    overflow-y: auto;
  }

  .product-modal__body {
    grid-template-columns: 1fr;
  }

  .product-modal__image {
    height: 200px;
    min-height: auto;
  }

  .product-modal__info {
    padding: 24px;
    max-height: none;
  }

  .product-modal__title {
    font-size: 22px;
  }
}
