/**
 * Diamond Brothers Default Active — front-end styles.
 *
 * Every rule is scoped under .dbda-filter-widget so nothing here can leak onto
 * the theme, Elementor or the Berocket filter markup. The default (no JS /
 * desktop) state keeps the body open and the arrow hidden; the JS adds
 * .dbda-is-mobile only at or below the configured breakpoint, at which point
 * the accordion styles take over.
 */

.dbda-filter-widget {
  display: block;
}

/* ---- Header ---------------------------------------------------------- */

.dbda-filter-widget .dbda-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0 0 18px;
  padding: 12px 0 18px;
  background: transparent;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  /* On desktop the header is not interactive, so keep the default cursor. */
  cursor: default;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: inherit;
  border-bottom: 1px solid #e7e7e7;
  border-radius: 0px;
}

.dbda-filter-widget .dbda-filter-title {
  font-family: "Prata", serif !important;
  margin: 0;
  font-size: 1.875rem;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.2;
}

/* ---- Arrow (hidden unless the accordion is active on mobile) --------- */

.dbda-filter-widget .dbda-filter-arrow {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: inherit;
  transition: transform 0.25s ease;
}

.dbda-filter-widget .dbda-filter-arrow svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* ---- Body ------------------------------------------------------------ */

.dbda-filter-widget .dbda-filter-body {
  /* Default / desktop / no-JS: always visible, no height constraint. */
  overflow: visible;
}

/* ---- Editor-only diagnostic notice ----------------------------------- */

.dbda-filter-widget .dbda-filter-notice {
  padding: 12px 14px;
  border: 1px dashed #c3c4c7;
  border-radius: 4px;
  background: #f6f7f7;
  color: #50575e;
  font-size: 13px;
  line-height: 1.5;
}

/* ---------------------------------------------------------------------- *
 * Mobile accordion state.
 *
 * .dbda-is-mobile is toggled by dbda-frontend.js purely on viewport width,
 * so the accordion is genuinely mobile-only and never affects desktop —
 * regardless of any CSS media-query breakpoints the theme may use.
 * ---------------------------------------------------------------------- */

.dbda-filter-widget.dbda-is-mobile .dbda-filter-header {
  cursor: pointer;
}

.dbda-filter-widget.dbda-is-mobile .dbda-filter-arrow {
  display: inline-flex;
}

/* Collapsed arrow points down (expand); expanded arrow flips up. */
.dbda-filter-widget.dbda-is-mobile.dbda-is-open .dbda-filter-arrow {
  transform: rotate(180deg);
}

/*
 * On mobile the body is height-animated. It is clipped to its max-height and
 * the actual open/closed height values are set inline by dbda-frontend.js
 * (0 when collapsed, the content height while animating, then "none" once
 * open so the filter can grow freely). Desktop keeps the rules above, so it
 * never carries a transition or a height cap.
 */
.dbda-filter-widget.dbda-is-mobile .dbda-filter-body {
  overflow: hidden;
  transition: max-height 0.3s ease;
  will-change: max-height;
}

/* Honour users who ask for reduced motion — collapse/expand instantly. */

@media (max-width: 1024px) {
  .dbda-filter-widget .dbda-filter-header {
    margin: 0 0 12px;
    padding: 12px 0 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dbda-filter-widget .dbda-filter-arrow,
  .dbda-filter-widget.dbda-is-mobile .dbda-filter-body {
    transition: none;
  }
}

@media (max-width: 599px) {
  .dbda-filter-widget .dbda-filter-title {
    font-size: 1.675rem;
  }
}
