/* =============================================================
   Product Archive Stylesheet
   ============================================================= */

/* Archive Layout */
.bwe-archive-page { padding-bottom: 80px; }

.bwe-archive-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  padding-top: 40px;
}

/* --- Filters Sidebar --- */
.bwe-filters {
  background: var(--bwe-white);
  border: 1px solid var(--bwe-border);
  border-radius: var(--bwe-radius-lg);
  padding: 24px;
  position: sticky;
  top: calc(var(--bwe-topbar-h) + var(--bwe-header-h) + 20px);
  max-height: calc(100vh - var(--bwe-topbar-h) - var(--bwe-header-h) - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bwe-border) transparent;
}
.bwe-filters::-webkit-scrollbar { width: 4px; }
.bwe-filters::-webkit-scrollbar-track { background: transparent; }
.bwe-filters::-webkit-scrollbar-thumb { background: var(--bwe-border); border-radius: 4px; }

.bwe-filters__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bwe-border);
}
.bwe-filters__title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--bwe-font-body);
}
.bwe-filters__clear {
  font-size: 0.78rem;
  color: var(--bwe-yellow);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bwe-filters__clear:hover { color: var(--bwe-yellow-dk); }

.bwe-filter-group {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--bwe-border);
}
.bwe-filter-group:last-child { border-bottom: none; margin-bottom: 0; }
.bwe-filter-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bwe-dark);
  margin-bottom: 10px;
  font-family: var(--bwe-font-body);
}

.bwe-filter-list { display: flex; flex-direction: column; gap: 6px; }
.bwe-filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--bwe-text-light);
  cursor: pointer;
  padding: 3px 0;
  transition: color var(--bwe-transition);
}
.bwe-filter-check:hover { color: var(--bwe-dark); }
.bwe-filter-check input[type="radio"],
.bwe-filter-check input[type="checkbox"] {
  accent-color: var(--bwe-yellow);
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.bwe-filter-count { color: var(--bwe-gray); font-size: 0.78rem; margin-left: auto; }

.bwe-filter-search-wrap { position: relative; }
.bwe-filter-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--bwe-border);
  border-radius: var(--bwe-radius);
  font-size: 0.875rem;
  transition: border-color var(--bwe-transition);
}
.bwe-filter-input:focus { outline: none; border-color: var(--bwe-yellow); }

.bwe-filter-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--bwe-border);
  border-radius: var(--bwe-radius);
  font-size: 0.875rem;
  background: var(--bwe-white);
  cursor: pointer;
  transition: border-color var(--bwe-transition);
}
.bwe-filter-select:focus { outline: none; border-color: var(--bwe-yellow); }

.bwe-filter-submit {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

/* --- Results Bar --- */
.bwe-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bwe-border);
  flex-wrap: wrap;
}
.bwe-results-count { font-size: 0.875rem; color: var(--bwe-gray); font-weight: 600; }
.bwe-results-sort { display: flex; align-items: center; gap: 8px; }
.bwe-results-sort label { font-size: 0.8rem; color: var(--bwe-gray); }

.bwe-mobile-filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bwe-off-white);
  border: 1px solid var(--bwe-border);
  border-radius: var(--bwe-radius);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bwe-dark);
  transition: background var(--bwe-transition);
}
.bwe-mobile-filter-toggle:hover { background: var(--bwe-light-gray); }

/* --- Product Grid --- */
.bwe-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.bwe-product-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.bwe-product-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }

/* --- Product Card --- */
.bwe-product-card {
  background: var(--bwe-white);
  border: 1px solid var(--bwe-border);
  border-radius: var(--bwe-radius-lg);
  overflow: hidden;
  transition: box-shadow var(--bwe-transition), transform var(--bwe-transition);
  display: flex;
  flex-direction: column;
}
.bwe-product-card:hover { box-shadow: var(--bwe-shadow-lg); transform: translateY(-4px); }

.bwe-product-card__image-link {
  display: block;
  position: relative;
  aspect-ratio: 3/2;
  overflow: hidden;
  background: var(--bwe-light-gray);
}
.bwe-product-card__image-link img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.bwe-product-card:hover .bwe-product-card__image-link img { transform: scale(1.05); }
.bwe-product-card__no-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.bwe-product-card__image-link .bwe-badge { position: absolute; top: 10px; left: 10px; }
.bwe-product-card__image-link .bwe-avail { position: absolute; top: 10px; right: 10px; }

.bwe-product-card__body { padding: 14px 14px 16px; display: flex; flex-direction: column; flex: 1; }
.bwe-product-card__meta { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.bwe-product-card__year,
.bwe-product-card__brand {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bwe-gray);
  background: var(--bwe-off-white);
  padding: 2px 8px;
  border-radius: 2px;
}
.bwe-product-card__title {
  font-family: var(--bwe-font-body);
  font-size: 0.98rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 4px;
  line-height: 1.35;
}
.bwe-product-card__title a { color: var(--bwe-dark); }
.bwe-product-card__title a:hover { color: var(--bwe-yellow); }
.bwe-product-card__model { font-size: 0.78rem; color: var(--bwe-gray); margin-bottom: 4px; }
.bwe-product-card__location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--bwe-gray);
  margin-bottom: 8px;
}
.bwe-product-card__price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--bwe-dark);
  margin-top: auto;
  margin-bottom: 14px;
}
.bwe-product-card__price--call { color: var(--bwe-gray); font-size: 0.9rem; }
.bwe-product-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 2px 2px; /* pulls buttons away from card corners */
}
.bwe-product-card__actions .bwe-btn { justify-content: center; font-size: 0.75rem; padding: 8px 10px; }

/* --- Archive Responsive --- */
@media (max-width: 1024px) {
  .bwe-archive-layout { grid-template-columns: 240px 1fr; gap: 24px; }
  .bwe-product-grid { grid-template-columns: repeat(2, 1fr); }
  .bwe-product-grid--cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .bwe-archive-layout { grid-template-columns: 1fr; }
  .bwe-archive-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    overflow-y: auto;
    background: var(--bwe-white);
    padding: 24px;
    border-radius: 0;
    max-height: 100vh;
  }
  .bwe-archive-sidebar.is-open { display: block; }
  .bwe-mobile-filter-toggle { display: flex; }
  .bwe-product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .bwe-product-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .bwe-product-grid { grid-template-columns: 1fr; }
  .bwe-product-card__actions { grid-template-columns: 1fr; }
}
