/* =========================================================
   Catalogue Page — Sidebar Filters & Product Grid
   Modern 2026 redesign · uses tokens from css2/theme.css
   ========================================================= */

.dn-grid-text {
  text-align: center !important;
}


/* ==========================================================
   SIDEBAR — Widget Cards
   ========================================================== */

body .wep-col-filters .dn-widgets .dn-widget-blank_product_filter,
body .wep-col-filters .dn-widgets .dn-widget-search .dn-search-container,
body .wep-col-filters .dn-widgets .dn-widget-blank_product_categories {
  background: var(--surface-elevated);
  border-radius: var(--radius-3);
  border: 1px solid var(--color-gray-200);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: 20px;
  font-family: var(--font-body);
  transition: box-shadow 0.25s var(--ease-2), border-color 0.25s var(--ease-2);
}

body .wep-col-filters .dn-widgets .dn-widget-blank_product_filter:hover,
body .wep-col-filters .dn-widgets .dn-widget-search .dn-search-container:hover,
body .wep-col-filters .dn-widgets .dn-widget-blank_product_categories:hover {
  border-color: var(--color-gray-300);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 6px 24px rgba(0, 0, 0, 0.06);
}


/* ----------------------------------------------------------
   Section headings  (h2, h3 inside filter widgets)
   ---------------------------------------------------------- */

body .wep-col-filters .dn-widgets h2.dn-styled,
body .wep-col-filters .dn-widgets h3.dn-styled {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: var(--font-weight-6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 14px;
  line-height: 1;
}


/* ==========================================================
   CATEGORIES  (links list)
   ========================================================== */

body .wep-col-filters .dn-widget-blank_product_categories ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body .wep-col-filters .dn-widget-blank_product_categories li {
  position: relative;
  padding: 0;
  transition: none;
  border-radius: var(--radius-2);
}

body .wep-col-filters .dn-widget-blank_product_categories li:hover {
  background: transparent;
}

body .wep-col-filters .dn-widget-blank_product_categories li span {
  display: block;
}

body .wep-col-filters .dn-widget-blank_product_categories li a {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-2);
  font-size: 13.5px;
  font-weight: var(--font-weight-4);
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition:
    color 0.15s var(--ease-2),
    background-color 0.15s var(--ease-2),
    border-color 0.15s var(--ease-2);
}

body .wep-col-filters .dn-widget-blank_product_categories li a:hover {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
  border-left-color: var(--color-primary-200);
}

/* Active / current category */
body .wep-col-filters .dn-widget-blank_product_categories li.dn-selected a,
body .wep-col-filters .dn-widget-blank_product_categories li a:active {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
  border-left-color: var(--color-accent);
  font-weight: var(--font-weight-6);
}

/* Hierarchy expander */
.dn-widget-blank_product_categories .dn-hierarchy-expander::before {
  content: "\203A";
  display: inline-block;
  color: var(--color-gray-400);
  font-size: 0.9rem;
  margin-right: 6px;
  transition: transform 0.2s var(--ease-2);
}

.dn-widget-blank_product_categories .dn-expanded > .dn-hierarchy-expander::before {
  transform: rotate(90deg);
}

/* Hierarchy labels & links */
.dn-widget-blank_product_categories .dn-hierarchy-label,
.dn-widget-blank_product_categories .dn-hierarchy-label a {
  color: var(--text-secondary);
  font-size: var(--font-size-1);
  text-decoration: none;
  transition: color 0.15s var(--ease-2);
}

.dn-widget-blank_product_categories .dn-hierarchy-label a:hover {
  color: var(--color-primary-400);
}

/* Nested children */
.dn-widget-blank_product_categories .dn-hierarchy-children {
  padding-left: 14px;
  margin-top: 2px;
  border-left: 2px solid var(--color-gray-200);
  transition: max-height 0.3s var(--ease-2), opacity 0.3s var(--ease-2);
  overflow: hidden;
}

/* Selected hierarchy node */
.dn-widget-blank_product_categories .dn-selected > .dn-hierarchy-label,
.dn-widget-blank_product_categories .dn-selected > .dn-hierarchy-label a {
  font-weight: var(--font-weight-6);
  color: var(--color-primary);
}


/* ==========================================================
   COLOR SWATCHES  (filter-color)
   ========================================================== */

body .wep-col-filters .dn-filter-color {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px;
}

body .wep-col-filters .dn-filter-color .dn-filter-list-value.dn-horizontal {
  width: auto;
  padding: 0;
  margin: 0;
}

body .wep-col-filters .dn-filter-color .dn-filter-list-color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--color-gray-200) !important;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-2),
    box-shadow 0.2s var(--ease-2),
    border-color 0.2s var(--ease-2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body .wep-col-filters .dn-filter-color .dn-filter-list-color-swatch:hover {
  transform: scale(1.15);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.12),
    0 0 0 2px var(--surface-elevated);
  border-color: var(--color-gray-400) !important;
}

/* Selected color swatch — accent ring */
body .wep-col-filters .dn-filter-color .dn-selected .dn-filter-list-color-swatch,
body .wep-col-filters .dn-filter-color .dn-filter-list-value.dn-selected .dn-filter-list-color-swatch {
  border-color: var(--color-accent) !important;
  box-shadow:
    0 0 0 2px var(--surface-elevated),
    0 0 0 4px var(--color-accent);
  transform: scale(1.1);
}


/* ==========================================================
   BRAND / TEXT FILTERS  (filter-manufacturer, etc.)
   ========================================================== */

body .wep-col-filters .dn-filter-manufacturer,
body .wep-col-filters .dn-filter-lists .dn-filter-values-container:not(.dn-filter-color):not(.dn-filter-price) {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

body .wep-col-filters .dn-filter-list-value:not(.dn-horizontal) {
  border-radius: var(--radius-2);
  transition: background-color 0.15s var(--ease-2);
}

body .wep-col-filters .dn-filter-list-value:not(.dn-horizontal):hover {
  background-color: var(--surface-card);
}

body .wep-col-filters .dn-filter-list-value:not(.dn-horizontal) a {
  display: block;
  padding: 7px 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-2);
  transition: color 0.15s var(--ease-2);
  line-height: 1.4;
}

body .wep-col-filters .dn-filter-list-value:not(.dn-horizontal) a:hover {
  color: var(--text-primary);
}

/* Selected brand/text filter */
body .wep-col-filters .dn-filter-list-value.dn-selected:not(.dn-horizontal) {
  background-color: var(--color-primary-light);
}

body .wep-col-filters .dn-filter-list-value.dn-selected:not(.dn-horizontal) a {
  color: var(--color-primary);
  font-weight: var(--font-weight-6);
}

/* "Show more" expander */
body .wep-col-filters .dn-filter-list-expander {
  padding: 6px 10px 2px;
  cursor: pointer;
  opacity: 1;
  font-size: 12px;
  font-weight: var(--font-weight-5);
  color: var(--color-primary-400);
  transition: color 0.15s var(--ease-2);
}

body .wep-col-filters .dn-filter-list-expander:hover {
  color: var(--color-primary);
}

body .wep-col-filters .dn-filter-list-expander > div::after {
  font-size: 10px;
  vertical-align: 1px;
  margin-left: 2px;
}


/* ==========================================================
   PRICE FILTER  (min / max inputs)
   ========================================================== */

body .wep-col-filters .dn-filter-price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

body .wep-col-filters .dn-filter-price .dn-filter-list-value {
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
}

body .wep-col-filters .dn-filter-price label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: var(--font-weight-5);
  white-space: nowrap;
  min-width: auto;
  padding-right: 0;
}

body .wep-col-filters .dn-filter-price input.dn-styled {
  width: 72px;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-2);
  background: var(--surface-elevated);
  color: var(--text-primary);
  transition: border-color 0.2s var(--ease-2), box-shadow 0.2s var(--ease-2);
  font-family: var(--font-body);
}

body .wep-col-filters .dn-filter-price input.dn-styled:focus {
  outline: none;
  border-color: var(--color-primary-200);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}


/* ==========================================================
   SEARCH WIDGET
   ========================================================== */

body .wep-col-filters .dn-search-container .dn-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body .wep-col-filters .dn-search-container .dn-form > li {
  margin-bottom: 0;
}

body .wep-col-filters .dn-search-container input.dn-styled {
  width: 100%;
  padding: 10px 14px;
  font-size: 13.5px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-2);
  background: var(--surface-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: border-color 0.2s var(--ease-2), box-shadow 0.2s var(--ease-2), background 0.2s var(--ease-2);
}

body .wep-col-filters .dn-search-container input.dn-styled:focus {
  outline: none;
  background: var(--surface-elevated);
  border-color: var(--color-primary-200);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

body .wep-col-filters .dn-search-container .dn-form-footer-actions {
  padding-top: 0;
}

body .wep-col-filters .dn-search-container .dn-btn.dn-btn-std.dn-styled {
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: var(--font-weight-5);
  letter-spacing: 0.02em;
  transition:
    background 0.2s var(--ease-2),
    box-shadow 0.2s var(--ease-2),
    transform 0.15s var(--ease-2);
}

body .wep-col-filters .dn-search-container .dn-btn.dn-btn-std.dn-styled:hover {
  background: var(--color-primary);
  box-shadow: 0 4px 12px rgba(0, 43, 73, 0.2);
  transform: translateY(-1px);
}

body .wep-col-filters .dn-search-container .dn-btn.dn-btn-std.dn-styled:active {
  transform: translateY(0);
  box-shadow: none;
}


/* ==========================================================
   COLLAPSIBLE WIDGET HEADINGS  (js-catalogue-sidebar.js)
   ========================================================== */

.wep-collapsible-heading {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 2px 0;
  border-radius: var(--radius-1);
  transition: color 0.15s var(--ease-2);
}

.wep-collapsible-heading:hover {
  color: var(--text-secondary);
}

/* Chevron indicator */
.wep-collapsible-heading::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--color-gray-400);
  border-bottom: 1.5px solid var(--color-gray-400);
  transform: rotate(45deg);
  transition:
    transform 0.25s var(--ease-2),
    border-color 0.2s var(--ease-2);
  flex-shrink: 0;
  margin-left: 8px;
}

.wep-collapsible-heading.wep-heading-collapsed::after {
  transform: rotate(-45deg);
}

.wep-collapsible-heading:hover::after {
  border-color: var(--text-secondary);
}

/* Collapsible widget body */
.wep-widget-body {
  overflow: hidden;
  max-height: 2000px;
  opacity: 1;
  transition:
    max-height 0.35s var(--ease-2),
    opacity 0.2s var(--ease-2);
}

.wep-widget-body.wep-collapsed {
  max-height: 0;
  opacity: 0;
}


/* ==========================================================
   MOBILE — Sidebar Toggle & Responsive
   ========================================================== */

.wep-sidebar-toggle {
  display: none;
}

@media (max-width: 768px) {

  /* Compact cards on mobile */
  body .wep-col-filters .dn-widgets .dn-widget-blank_product_filter,
  body .wep-col-filters .dn-widgets .dn-widget-search .dn-search-container,
  body .wep-col-filters .dn-widgets .dn-widget-blank_product_categories {
    padding: 16px;
    border-radius: var(--radius-2);
    box-shadow: none;
  }

  /* Mobile toggle button */
  .wep-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-2);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: var(--font-weight-5);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 43, 73, 0.18);
    transition:
      background 0.2s var(--ease-2),
      box-shadow 0.2s var(--ease-2),
      transform 0.15s var(--ease-2);
    letter-spacing: 0.01em;
  }

  .wep-sidebar-toggle:hover {
    background: var(--color-primary);
    box-shadow: 0 4px 14px rgba(0, 43, 73, 0.25);
  }

  .wep-sidebar-toggle:active {
    transform: scale(0.98);
  }

  .wep-sidebar-toggle-icon {
    font-size: 1rem;
    line-height: 1;
  }

  /* Hide sidebar widgets by default on mobile */
  .wep-col-filters .dn-widgets {
    display: none;
    animation: wep-sidebar-reveal 0.3s var(--ease-2);
  }

  @keyframes wep-sidebar-reveal {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Show when toggle is active */
  .wep-col-filters.wep-sidebar-open .dn-widgets {
    display: block;
  }

  /* Reduce spacing between widgets on mobile */
  .wep-col-filters .dn-widgets .dn-widget {
    margin-bottom: 8px;
  }
}


/* ==========================================================
   Reduced Motion
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
  .wep-widget-body,
  .wep-collapsible-heading::after,
  .wep-col-filters .dn-widgets,
  .dn-widget-blank_product_categories .dn-hierarchy-children,
  .dn-color-cells-wrapper,
  .dn-color-gradient-overlay,
  body .wep-col-filters .dn-filter-color .dn-filter-list-color-swatch,
  body .wep-col-filters .dn-search-container .dn-btn.dn-btn-std.dn-styled,
  .wep-sidebar-toggle {
    transition: none !important;
    animation: none !important;
  }
}


/* ==========================================================
   PRODUCT CARDS — Show-More Color Rows
   ========================================================== */

.dn-product-colors {
  position: relative;
}

.dn-color-cells-wrapper {
  position: relative;
  overflow: hidden;
  transition: max-height 0.3s var(--ease-2);
}

.dn-color-cells-wrapper.collapsed {
  max-height: var(--collapsed-height, 60px);
}

.dn-color-cells-wrapper.expanded {
  max-height: none;
}

.dn-color-gradient-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95));
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s var(--ease-2);
}

.dn-color-cells-wrapper.expanded + .dn-color-gradient-overlay {
  opacity: 0;
}

.dn-color-toggle-btn {
  display: inline-block;
  margin-top: var(--space-3xs);
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-primary-400);
  transition: color 0.15s var(--ease-2);
  font-weight: var(--font-weight-5);
  text-decoration: none;
}

.dn-color-toggle-btn:hover {
  color: var(--color-primary);
}

.dn-color-toggle-btn:focus {
  outline: none;
  color: var(--color-primary);
}

.dn-color-toggle-btn.hidden {
  display: none;
}

.dn-toggle-icon {
  display: inline-block;
  margin-left: 2px;
  font-size: 10px;
  transition: transform 0.3s var(--ease-2);
  opacity: 0.7;
}

.dn-color-toggle-btn:hover .dn-toggle-icon {
  opacity: 1;
}

.dn-color-toggle-btn.expanded .dn-toggle-icon {
  transform: rotate(180deg);
}
