/*
 * Kent & Hudson Frontend - Products Page Styles
 * 产品列表/详情页样式
 */

/* ========== Page Header ========== */
.prd-header {
  padding: 50px 0 30px;
  text-align: center;
  border-bottom: 1px solid var(--style-border);
}

.prd-header .section-tag {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--style-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.prd-title {
  font-size: 42px;
  font-weight: 500;
  margin-bottom: 12px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  letter-spacing: -0.01em;
}

.prd-subtitle {
  font-size: 14px;
  color: var(--style-muted);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ========== Layout ========== */
.prd-main {
  padding: 40px 0 80px;
}

.prd-layout {
  display: flex;
  gap: 40px;
  position: relative;
}

/* ========== Sidebar ========== */
.prd-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 130px;
  align-self: flex-start;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding-right: 10px;
}

.prd-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--style-border);
  margin-bottom: 24px;
}

.prd-filter-header h3 {
  font-size: 18px;
  font-weight: 500;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.prd-filter-close {
  display: none;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #1a1a1a;
}

.prd-filter-block {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--style-border);
}

.prd-filter-block:last-child { border-bottom: none; }

.prd-filter-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  color: #1a1a1a;
  font-family: inherit;
}

.prd-filter-list li {
  margin-bottom: 10px;
  font-size: 13px;
}

.prd-filter-list li a,
.prd-filter-list li label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #555;
  cursor: pointer;
  transition: color 0.25s;
}

.prd-filter-list li a:hover,
.prd-filter-list li label:hover { color: var(--style-color); }

.prd-filter-list li a.active,
.prd-filter-list li label input:checked + span {
  color: var(--style-color);
  font-weight: 600;
}

.prd-filter-list li input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--style-color);
  cursor: pointer;
}

.prd-filter-list .count {
  font-size: 12px;
  color: #999;
}

/* Colors */
.prd-filter-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid transparent;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: transform 0.2s, outline-color 0.2s, border-color 0.2s;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.color-swatch::after {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free', 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--style-color-gold);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  pointer-events: none;
}

.color-swatch:has(input:checked) {
  outline-color: var(--style-color);
  border-color: var(--style-color);
}

.color-swatch:has(input:checked::after),
.color-swatch input[type="checkbox"]:checked ~ * {
  /* fallback */
}

.color-swatch:has(input:checked)::after {
  opacity: 1;
}

/* Light swatch fallback border so it's visible */
.color-swatch[style*="background:#fff"],
.color-swatch[style*="background:#ffffff"],
.color-swatch[style*="background: white"] {
  border: 1px solid #ddd;
}
.color-swatch:has(input:checked)[style*="background:#fff"],
.color-swatch:has(input:checked)[style*="background:#ffffff"] {
  border-color: var(--style-color);
}

/* ========== Content ========== */
.prd-content {
  flex: 1;
  min-width: 0;
}

.prd-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--style-border);
}

.prd-filter-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #fff;
  border: 1px solid var(--style-border);
  border-radius: 0;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  color: #1a1a1a;
}

.prd-result-count {
  font-size: 13px;
  color: var(--style-muted);
  margin: 0;
  flex: 1;
}

.prd-result-count strong { color: #1a1a1a; }

.prd-sort {
  width: 200px;
}

.prd-sort .select-input {
  padding: 9px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.prd-view-toggle {
  display: flex;
  gap: 6px;
}

.prd-view-toggle button {
  width: 36px;
  height: 36px;
  background: #fff;
  border: 1px solid var(--style-border);
  cursor: pointer;
  font-size: 13px;
  color: #555;
  transition: all 0.25s;
}

.prd-view-toggle button.active,
.prd-view-toggle button:hover {
  background: var(--style-color);
  border-color: var(--style-color);
  color: #fff;
}

/* Clear All Filters — themed text button */
.btn-text {
  display: inline-block;
  background: transparent;
  border: none;
  color: var(--style-color);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--style-color-gold);
  font-family: inherit;
  transition: color 0.25s, text-decoration-color 0.25s;
}

.btn-text:hover {
  color: var(--style-color-gold);
  text-decoration-color: var(--style-color);
}

/* ========== Product Grid ========== */
.prd-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 24px;
}

@media (min-width: 768px) {
  .prd-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) {
  .prd-grid { grid-template-columns: repeat(4, 1fr); gap: 50px 24px; }
}

/* List view */
.prd-grid.list-view {
  grid-template-columns: 1fr;
  gap: 20px;
}

.prd-grid.list-view .product-item {
  display: flex;
  gap: 0;
  border: 1px solid var(--style-border);
  transition: box-shadow 0.3s, border-color 0.3s;
  background: #fff;
  overflow: hidden;
}

.prd-grid.list-view .product-item:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  border-color: var(--style-color-light);
}

.prd-grid.list-view .product-item .img-wrap {
  flex: 0 0 320px;
  height: 240px;
  overflow: hidden;
  position: relative;
}

.prd-grid.list-view .product-item .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.prd-grid.list-view .product-item:hover .img-wrap img {
  transform: scale(1.04);
}

.prd-grid.list-view .product-item .info {
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 36px;
  position: relative;
}

.prd-grid.list-view .product-item .brand {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--style-color);
  margin-bottom: 6px;
}

.prd-grid.list-view .product-item .name {
  font-size: 22px;
  text-align: left;
  line-height: 1.35;
  margin-bottom: 10px;
  min-height: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.prd-grid.list-view .product-item .name a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.25s;
}

.prd-grid.list-view .product-item .name a:hover {
  color: var(--style-color);
}

.prd-grid.list-view .product-item .price {
  text-align: left;
  font-size: 20px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 16px;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.prd-grid.list-view .product-item .price .old {
  font-size: 15px;
  color: var(--style-muted);
  text-decoration: line-through;
  margin-right: 8px;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
}

.prd-grid.list-view .product-item .info-desc {
  font-size: 13px;
  color: var(--style-muted);
  line-height: 1.7;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prd-grid.list-view .product-item .quick-actions {
  position: static;
  opacity: 1;
  transform: none;
  display: inline-flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 0;
}

.prd-grid.list-view .product-item .quick-actions button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--style-border);
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  font-size: 13px;
}

.prd-grid.list-view .product-item .quick-actions button:hover {
  background: var(--style-color);
  border-color: var(--style-color);
  color: #fff;
}

.prd-grid.list-view .product-item .quick-actions button.quick-wishlist:hover {
  background: #c41e3a;
  border-color: #c41e3a;
}

.prd-grid.list-view .product-item .actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.prd-grid.list-view .product-item .add-to-cart {
  position: static;
  opacity: 1;
  transform: none;
  display: inline-flex;
  width: auto;
  padding: 10px 28px;
  background: var(--style-color);
  border: none;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.25s;
  margin-top: 0;
}

.prd-grid.list-view .product-item .add-to-cart:hover {
  background: var(--style-color-light);
}

.prd-grid.list-view .product-item .view-details {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--style-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
  padding-bottom: 1px;
}

.prd-grid.list-view .product-item .view-details:hover {
  border-color: var(--style-color);
}

.prd-grid.list-view .product-item .badge {
  top: 16px;
  left: 16px;
}

/* ========== 响应式 ========== */
@media (min-width: 576px) {
  .prd-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .prd-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 992px) {
  .prd-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1200px) {
  .prd-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 991px) {
  .prd-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100%;
    background: #fff;
    z-index: 1000;
    padding: 24px;
    transition: right 0.3s;
    max-height: none;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  }

  .prd-sidebar.open {
    right: 0;
  }

  .prd-filter-close {
    display: block;
  }

  .prd-filter-btn {
    display: inline-flex;
  }

  .prd-sort {
    flex: 1;
    width: auto;
  }
}

@media (max-width: 767px) {
  .prd-title { font-size: 30px; }
  .prd-grid { gap: 30px 16px; }
  .prd-grid.list-view .product-item { flex-direction: column; }
  .prd-grid.list-view .product-item .img-wrap { flex: none; width: 100%; height: 240px; }
  .prd-grid.list-view .product-item .info { padding: 24px; }
  .prd-grid.list-view .product-item .name { font-size: 18px; }
  .prd-grid.list-view .product-item .price { font-size: 18px; }
  .prd-toolbar { gap: 8px; }
  .prd-result-count { font-size: 12px; flex: 1 0 100%; order: -1; }
}
