/* ============================================
   Product List Page — Styles
   Namespace: .plist-*
   Brand tokens from global-tokens.css
   ============================================ */

/* --- Container --- */
.plist-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   Section 1: Banner
   ============================================ */
.plist-banner {
  padding: 30px 0;
}

.plist-banner .plist-spacer {
  height: 30px;
}

.plist-banner-image {
  text-align: center;
}

.plist-banner-image a {
  display: block;
}

.plist-banner-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ============================================
   Section 2: Product Filter / Search
   ============================================ */
.plist-filter-section {
  padding: 20px 0 10px;
}

.plist-filter-bar {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.plist-filter-dropdown {
  position: relative;
  flex: 1;
}

.plist-select-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--brand-line, #e4e7ec);
  border-radius: 6px;
  background: var(--brand-paper, #fff);
  cursor: pointer;
  user-select: none;
  min-height: 44px;
  font-size: 14px;
  color: var(--brand-ink, #101722);
}

.plist-select-input .plist-default-text {
  color: var(--brand-muted, #667085);
}

.plist-select-input .plist-icon-down {
  font-size: 10px;
  color: var(--brand-muted, #667085);
  transition: transform 0.2s;
  line-height: 1;
}

.plist-select-input.open .plist-icon-down {
  transform: rotate(180deg);
}

.plist-select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--brand-paper, #fff);
  border: 1px solid var(--brand-line, #e4e7ec);
  border-radius: 6px;
  margin-top: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  max-height: 300px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
}

.plist-select-dropdown.show {
  display: block;
}

.plist-select-dropdown li {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--brand-ink, #101722);
  transition: background 0.15s;
}

.plist-select-dropdown li:hover {
  background: var(--brand-soft, #f3f4f6);
}

.plist-select-dropdown li.selected {
  color: var(--brand-red, #0178DA);
  font-weight: 600;
}

.plist-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  border: none;
  border-radius: 6px;
  background: var(--brand-red, #0178DA);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.plist-search-btn:hover {
  background: var(--brand-red-dark, #0056A0);
}

.plist-search-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ============================================
   Section 3: Main Content (2-column)
   ============================================ */
.plist-main-content {
  padding: 20px 0;
}

.plist-content-row {
  display: flex;
  gap: 30px;
}

.plist-content-left {
  flex: 1;
  min-width: 0;
}

.plist-content-right {
  width: 280px;
  flex-shrink: 0;
}

/* --- Product Grid --- */
.plist-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.plist-product-item {
  break-inside: avoid;
}

.plist-product-card {
  border: 1px solid var(--brand-line, #e4e7ec);
  border-radius: 8px;
  overflow: hidden;
  background: var(--brand-paper, #fff);
  transition: box-shadow 0.25s, border-color 0.25s;
}

.plist-product-card:hover {
  border-color: var(--brand-red, #0178DA);
  box-shadow: 0 4px 12px rgba(1, 120, 218, 0.1);
}

.plist-product-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--brand-soft, #f3f4f6);
}

.plist-product-image-wrap a {
  display: block;
  width: 100%;
  height: 100%;
}

.plist-product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.plist-product-card:hover .plist-product-image-wrap img {
  transform: scale(1.08);
}

.plist-product-info {
  padding: 14px;
}

.plist-product-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--brand-ink, #101722);
  text-decoration: none;
  min-height: 2.8em;
  transition: color 0.2s;
}

.plist-product-card:hover .plist-product-name {
  color: var(--brand-red, #0178DA);
}

.plist-product-divider {
  height: 1px;
  background: var(--brand-line, #e4e7ec);
  margin: 10px 0;
  transition: background 0.2s;
}

.plist-product-card:hover .plist-product-divider {
  background: var(--brand-red, #0178DA);
}

.plist-product-actions {
  display: flex;
  gap: 8px;
}

.plist-btn-inquire,
.plist-btn-basket {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 12px;
  border: 1px solid var(--brand-line-strong, #d0d5dd);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--brand-paper, #fff);
  color: var(--brand-ink, #101722);
  text-decoration: none;
  line-height: 1;
}

.plist-btn-inquire:hover,
.plist-btn-basket:hover {
  background: var(--brand-soft, #f3f4f6);
  border-color: var(--brand-muted, #667085);
}

.plist-btn-inquire svg,
.plist-btn-basket svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* --- Pagination --- */
.plist-pagination-wrap {
  margin-top: 30px;
  text-align: center;
}

.plist-pagination {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.plist-pagination a,
.plist-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  font-size: 14px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
  color: var(--brand-ink, #101722);
  background: transparent;
  border: 1px solid transparent;
}

.plist-pagination .current {
  background: var(--brand-red, #0178DA);
  color: #fff;
  font-weight: 600;
  border-color: var(--brand-red, #0178DA);
}

.plist-pagination a:hover {
  background: var(--brand-soft, #f3f4f6);
  border-color: var(--brand-line, #e4e7ec);
}

.plist-pagination .next,
.plist-pagination .prev {
  font-size: 16px;
}

/* ============================================
   Sidebar: Category Tree
   ============================================ */
.plist-category-sidebar {
  margin-bottom: 20px;
  border: 1px solid var(--brand-line, #e4e7ec);
  border-radius: 8px;
  padding: 16px;
}

.plist-sidebar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-ink, #101722);
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--brand-red, #0178DA);
}

.plist-category-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plist-category-tree .plist-cat-item {
  position: relative;
}

/* 默认每级链接无额外缩进——缩进由 .plist-sub-menu 的 padding-left 处理 */
.plist-category-tree .plist-cat-item .plist-cat-link {
  display: block;
  padding: 7px 0;
  font-size: 13px;
  color: var(--brand-ink, #101722);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1.4;
}

.plist-category-tree .plist-cat-link:hover {
  color: var(--brand-red, #0178DA);
}

.plist-category-tree .plist-cat-item.on > .plist-cat-header > .plist-cat-link {
  color: var(--brand-red, #0178DA);
  font-weight: 600;
}

.plist-category-tree .has-children > .plist-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plist-category-tree .has-children > .plist-cat-header .plist-cat-link {
  flex: 1;
}

/* --- Toggle icon (SVG) --- */
.plist-category-tree .plist-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 6px;
  color: var(--brand-muted, #667085);
  user-select: none;
  flex-shrink: 0;
}

.plist-category-tree .plist-toggle-icon .plist-toggle-svg {
  display: block;
  transition: transform 0.2s ease;
  transform: rotate(-90deg);  /* 收起状态：箭头朝右 */
}

.plist-category-tree .plist-toggle-icon.open .plist-toggle-svg {
  transform: rotate(0deg);   /* 展开状态：箭头朝下 */
}

/* --- Sub-menu: 层级缩进 --- */
.plist-category-tree .plist-sub-menu {
  display: none;
  list-style: none;
  padding: 0 0 4px 18px;
  margin: 0;
  border-left: 1px dashed var(--brand-line, #e4e7ec);
}

.plist-category-tree .plist-sub-menu.open {
  display: block;
}

/* 子级链接字号递降 */
.plist-category-tree .plist-sub-menu .plist-cat-link {
  font-size: 12.5px;
}

/* 更深层级再小一点 */
.plist-category-tree .plist-sub-menu .plist-sub-menu .plist-cat-link {
  font-size: 12px;
}

/* ============================================
   Section 4: Product Description
   ============================================ */
.plist-description {
  padding: 30px 0;
}

.plist-description .plist-desc-content {
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.7;
  color: var(--brand-text, #344054);
  font-size: 15px;
}

.plist-description .plist-desc-content p {
  margin-bottom: 14px;
}

.plist-description .plist-desc-content strong {
  color: var(--brand-ink, #101722);
}

/* ============================================
   Section 5: Contact Form
   ============================================ */
.plist-contact-section {
  padding: 40px 0;
}

.plist-contact-wrap {
  max-width: 900px;
  margin: 0 auto;
}

.plist-contact-inner {
  background: var(--brand-paper, #fff);
  border: 1px solid var(--brand-line, #e4e7ec);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.plist-contact-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-red, #0178DA);
}

.plist-contact-title-area {
  text-align: center;
  padding: 24px 20px 0;
}

.plist-contact-title-area .plist-contact-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-muted, #667085);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.plist-contact-title-area .plist-contact-subtitle {
  font-size: 18px;
  font-weight: 600;
  color: var(--brand-ink, #101722);
}

.plist-contact-box {
  display: flex;
  gap: 24px;
  padding: 20px;
}

.plist-contact-image {
  flex: 0 0 280px;
}

.plist-contact-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.plist-contact-form-area {
  flex: 1;
  min-width: 0;
}

.plist-contact-form-area .plist-form-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-ink, #101722);
  margin-bottom: 16px;
}

.plist-contact-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.plist-form-group {
  width: calc(50% - 15px);
  margin-bottom: 14px;
}

.plist-form-group:nth-child(odd) {
  margin-right: 30px;
}

.plist-form-group.plist-form-full {
  width: calc(100% - 30px);
}

.plist-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-ink, #101722);
  margin-bottom: 4px;
}

.plist-form-group label .plist-required {
  color: #e53935;
  margin-right: 2px;
}

.plist-form-group input,
.plist-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--brand-line, #e4e7ec);
  border-radius: 6px;
  font-size: 14px;
  color: var(--brand-ink, #101722);
  background: var(--brand-paper, #fff);
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}

.plist-form-group input:focus,
.plist-form-group textarea:focus {
  outline: none;
  border-color: var(--brand-red, #0178DA);
  background: var(--brand-red-bg, rgba(1, 120, 218, 0.03));
}

.plist-form-group input::placeholder,
.plist-form-group textarea::placeholder {
  color: var(--brand-muted, #667085);
  opacity: 0.7;
}

.plist-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.plist-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  width: calc(100% - 30px);
}

.plist-btn-submit,
.plist-btn-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

.plist-btn-submit {
  background: var(--brand-red, #0178DA);
  color: #fff;
}

.plist-btn-submit:hover {
  background: var(--brand-red-dark, #0056A0);
}

.plist-btn-reset {
  background: var(--brand-soft, #f3f4f6);
  color: var(--brand-ink, #101722);
}

.plist-btn-reset:hover {
  background: var(--brand-line, #e4e7ec);
}

/* Contact form success/error messages */
.plist-form-message {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 14px;
  width: calc(100% - 30px);
  display: none;
}

.plist-form-message.success {
  display: block;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.plist-form-message.error {
  display: block;
  background: #fce4ec;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* ============================================
   Footer Spacer
   ============================================ */
.plist-footer-spacer {
  height: 40px;
}

/* ============================================
   Animations
   ============================================ */
.plist-fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.plist-fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1199px) {
  .plist-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 989px) {
  .plist-content-row {
    flex-direction: column;
  }

  .plist-content-right {
    width: 100%;
    order: -1;
  }

  .plist-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .plist-contact-box {
    flex-direction: column;
  }

  .plist-contact-image {
    flex: 0 0 auto;
    max-width: 300px;
  }
}

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

  .plist-filter-bar {
    flex-direction: column;
  }

  .plist-search-btn {
    width: 100%;
  }

  .plist-form-group {
    width: 100%;
    margin-right: 0 !important;
  }

  .plist-form-group.plist-form-full,
  .plist-form-actions,
  .plist-form-message {
    width: 100%;
  }

  .plist-form-actions {
    flex-direction: column;
  }

  .plist-contact-box {
    padding: 16px;
  }

  .plist-banner .plist-spacer {
    height: 15px;
  }

  .plist-sidebar-title {
    font-size: 14px;
  }
}

/* Keep the product type menu above the category sidebar when stacked on mobile. */
.plist-filter-section {
  position: relative;
  z-index: 101;
}
