/* =========================================
   COLLECTIONS PAGE STYLES
========================================= */

.collection-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 70px 20px var(--gap-section-sm) 20px;
  /* 50px topbar + 20px gap */
}

/* --- Header Section --- */
.collection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--gap-element-lg);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 15px;
}

.collection-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.collection-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.sort-select {
  font-family: var(--font-primary);
  font-size: 0.85rem;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  cursor: pointer;
  outline: none;
}

.btn-filter-mobile {
  display: none;
  /* Hidden on desktop */
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 15px;
  border: 1px solid #000;
  background: #fff;
  cursor: pointer;
}

/* --- Content Layout --- */
.collection-content {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}

/* --- Sidebar Filters --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

/* Filter panel header: title + X button on same line (mobile only) */
.filter-panel-header {
  display: none;
}

.sidebar-close-btn {
  display: none;
}

.collection-sidebar {
  position: sticky;
  top: 100px;
  /* Below topbar */
}

.filter-group {
  margin-bottom: 30px;
}

.filter-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #444;
  cursor: pointer;
  transition: color 0.2s ease;
}

.filter-label:hover {
  color: #000;
}

.filter-label input[type="checkbox"],
.filter-label input[type="radio"] {
  accent-color: #000;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.product-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: #999;
}

/* --- Collection Navigation Links --- */
.collection-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.85rem;
  color: #555;
  text-decoration: none;
  border-bottom: 1px solid #f5f5f5;
  transition: color 0.15s;
  font-weight: 400;
}

.collection-nav-link::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1.5px solid #ccc;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.15s;
}

.collection-nav-link.active {
  color: #000;
  font-weight: 600;
}

.collection-nav-link.active::before {
  border-color: #000;
  background: #000;
  box-shadow: inset 0 0 0 3px #fff;
}

.collection-nav-link:hover {
  color: #000;
}

.collection-nav-link:hover::before {
  border-color: #888;
}

/* --- Filter Footer (Clear filters link) --- */
.filter-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  text-align: center;
}

/* --- Nested filter groups (parent → children) --- */
.filter-group-nested {
  margin-bottom: 2px;
}

/* Parent row: radio label LEFT + expand button RIGHT */
.filter-parent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.filter-parent-label {
  flex: 1;
}

.filter-parent-label strong {
  font-weight: 600;
  color: #111;
}

/* + / − expand button */
.filter-accordion-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  font-size: 1rem;
  line-height: 1;
  color: #aaa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  padding: 0;
}
.filter-accordion-btn:hover {
  color: #333;
  border-color: #bbb;
  background: #f8f8f8;
}

/* Children: hidden by default, shown via JS toggle */
.filter-children {
  padding-left: 16px;
  margin-top: 6px;
  flex-direction: column;
  gap: 8px;
  border-left: 2px solid #f0f0f0;
  display: none; /* JS sets display:flex when open */
}

.filter-child-label {
  font-size: 0.82rem;
  color: #666;
  transition: color 0.15s;
}

.filter-child-label:hover {
  color: #000;
}

.clear-filters-link {
  font-size: 0.8rem;
  color: #888;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s;
}

.clear-filters-link:hover {
  color: #000;
}

/* --- Mobile Responsive --- */
@media (max-width: 992px) {
  .collection-container {
    padding: 70px 0 var(--gap-section-sm) 0;
    /* Keep top padding, remove horizontal for edge-to-edge */
  }

  .collection-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .collection-header {
    flex-direction: row;
    /* Keep filter and sort inline */
    align-items: center;
    padding: 0 20px 15px 20px;
    /* Add padding back to header since container lost it */
  }

  .collection-controls {
    width: 100%;
    justify-content: space-between;
  }

  .btn-filter-mobile {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  /* Off-canvas Sidebar */
  .collection-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    /* Hidden to the left */
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    padding: 20px 24px 30px;
    overflow-y: auto;
    transition: left 0.3s ease;
    border: none;
    margin: 0;
  }

  .collection-sidebar.active {
    left: 0;
  }

  /* Header row: "Filters" label + X button on same line */
  .filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
  }

  .filter-panel-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #111;
  }

  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: static;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #000;
    padding: 4px;
    line-height: 1;
  }
}