/* ═══════════════════════════════════════════════════
   Amazzingfilter — Theme override
   Matches the speaking URL wizard aesthetic:
   mono-800 dark header, mono-200 borders, brand accents
   ═══════════════════════════════════════════════════ */

/* Hide Marca and Modello filters — managed by the wizard */
.af_filter[data-url="marca"],
.af_filter[data-url="modello"] {
  display: none !important;
}

/* ── Outer wrapper — matches wizard card ──────────── */
#amazzing_filter {
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.af-form {
  padding-top: 0;
}

/* ── Title block — matches wizard header ─────────── */
#amazzing_filter .title_block {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
  background: #171717;
  margin: 0;
  padding: 10px 16px;
  border-radius: 0;
  position: relative;
}
#amazzing_filter .title_block::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #e72e47;
}

/* ── Filter groups ───────────────────────────────── */
.af_filter {
  position: relative;
  margin-bottom: 0;
  border-bottom: 1px solid #e5e5e5;
  padding: 0;
}
.af_filter:last-child {
  border-bottom: none;
}

/* ── Subtitle (group header / toggle) ────────────── */
.af_subtitle {
  position: relative;
  margin: 0;
  padding: 12px 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #525252;
  transition: color 0.2s;
}
.af_subtitle.toggle-content {
  cursor: pointer;
}
.af_subtitle.toggle-content:hover {
  color: #171717;
}
.af_subtitle.toggle-content:before {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 6px;
  height: 6px;
  margin-top: -4px;
  border: solid #a3a3a3;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-135deg);
  transition: transform 0.2s, border-color 0.2s;
}
.closed .af_subtitle.toggle-content:before {
  transform: rotate(45deg);
  margin-top: -6px;
}
.no-available-items .af_subtitle,
.no-available-items .af_filter_content {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.closed .af_filter_content,
.hide-zero-matches .no-available-items {
  display: none;
}

/* ── Filter content area ─────────────────────────── */
.af_filter_content {
  padding: 0 16px 12px;
}
.special .af_filter_content {
  display: block;
  margin: 0;
  padding: 8px 16px 12px;
}

/* ── List items ──────────────────────────────────── */
.af_filter li {
  padding: 0;
  margin: 0;
  position: relative;
  display: block;
}
.hide-zero-matches .no-matches {
  display: none;
}
.hide-zero-matches .no-matches.active {
  display: block;
}

.af_filter label {
  font-weight: normal;
  text-align: left;
  cursor: pointer;
  margin: 0;
  padding: 5px 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  font-size: 0.8125rem;
  color: #404040;
  transition: color 0.15s;
  gap: 6px;
}
.af_filter label:hover {
  color: #171717;
}
.af_filter .af-color-label {
  align-items: center;
  padding: 0;
}

/* ── Checkbox / radio inputs ─────────────────────── */
.af_filter .checkbox,
.af_filter .radio {
  margin: 0;
  min-height: 0;
  flex-shrink: 0;
}

/* ── Name & count ────────────────────────────────── */
.af_filter .name {
  padding-left: 0;
}
.af_filter .count {
  color: #a3a3a3;
  margin-left: auto;
  padding-left: 4px;
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}
.af_filter .count:before { content: "("; }
.af_filter .count:after { content: ")"; }
.hide-counters .count {
  display: none;
}

/* ── Scrollable list ─────────────────────────────── */
.af_filter ul {
  max-height: 282px;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: #d4d4d4 transparent;
}
.af-parent-category > ul {
  margin: 0 0 0 20px;
  padding: 0;
  max-height: 100%;
}

/* ── Select dropdowns ────────────────────────────── */
.af_filter select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  font-size: 0.8125rem;
  color: #404040;
  background: #f5f5f5;
  transition: border-color 0.2s;
  appearance: none;
}
.af_filter select:focus {
  border-color: #525252;
  outline: none;
}
.vertical-layout .af_filter.type-3:not(.closed) {
  padding-bottom: 8px;
}

/* ── Quick search ────────────────────────────────── */
.af-quick-search {
  position: relative;
  margin-bottom: 8px;
}
.af-quick-search:before {
  content: "";
  position: absolute;
  right: 10px;
  top: 8px;
  display: block;
  width: 10px;
  height: 10px;
  border: 1.5px solid #a3a3a3;
  border-radius: 100%;
  z-index: 1;
}
.af-quick-search:after {
  content: "";
  position: absolute;
  display: block;
  height: 5px;
  width: 0;
  border: 1px solid #a3a3a3;
  top: 14px;
  right: 8px;
  transform: rotate(45deg);
  z-index: 1;
  margin-top: 4px;
}
.qsInput {
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  transition: all 0.2s;
  background: #f5f5f5;
  width: 100%;
  padding: 6px 32px 6px 10px;
  font-size: 0.8125rem;
  color: #404040;
}
body .qsInput:focus,
.qsInput.has-value {
  background: #fff;
  border-color: #525252;
  outline: none;
}
.af_filter li.qs-hidden { display: none; }
.af_filter li.qs-hidden.active,
.af_filter li.qs-hidden.qs-half-hidden { display: block; }
.af_filter li.qs-hidden.active > label,
.af_filter li.qs-hidden.qs-half-hidden > label { opacity: 0.4; }
.qs-no-matches {
  margin: 8px 0;
  padding: 6px;
  font-size: 0.75rem;
  color: #a3a3a3;
}

/* ── Dimmed / no-match values ────────────────────── */
.dim-zero-matches .no-matches > label {
  opacity: 0.3;
  cursor: no-drop;
}
.dim-zero-matches .no-matches.active > label {
  cursor: pointer;
}
.dim-zero-matches .no-matches .af-color-box:before {
  content: "";
  position: absolute;
  display: block;
  border-bottom: 2px solid #fff;
  width: 23px;
  top: 50%;
  margin: -1px 0 0 1px;
  transform: rotate(-45deg);
}
.dim-zero-matches .no-matches .af-color-box.bright:before { border-color: #d4d4d4; }
.dim-zero-matches .no-matches.active .af-color-box:before { left: -6px; }

/* ── Color boxes ─────────────────────────────────── */
.af-color-box {
  display: inline-block;
  width: 22px;
  height: 22px;
  min-width: 22px;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  border-radius: 50%;
  text-align: center;
  position: relative;
  box-shadow: inset 0 0 3px rgba(0,0,0,0.15);
}
.active .af-color-box {
  width: 14px;
  min-width: 14px;
  height: 14px;
  margin: 4px;
}
.active .af-color-box:after {
  content: "";
  position: absolute;
  top: -4px; right: -4px; bottom: -4px; left: -4px;
  border: 2px solid #262626;
  border-radius: 50%;
}
.af-inline-colors { display: inline-block; width: 100%; }
.af-inline-colors li { float: left; margin: 2px 4px 2px 0; }
.af-color-box .checkbox,
.af-color-box .radio,
.af-inline-colors .name,
.af-inline-colors .count { display: none; }

/* ── Text boxes ──────────────────────────────────── */
.af_filter.tb li {
  float: left;
  border: 1px solid #d4d4d4;
  border-radius: 9999px;
  margin: 0 4px 4px 0;
  padding: 5px 10px;
  line-height: 1;
  font-size: 0.75rem;
  transition: all 0.15s;
}
.af_filter.tb li:hover {
  border-color: #525252;
}
.af_filter.tb li.active {
  border-color: #171717;
  background: #171717;
  color: #fff;
}
.af_filter.tb li.active label {
  color: #fff;
}
.af_filter.tb label,
.af_filter.tb .name { padding: 0; margin: 0; }
.af_filter.tb .checkbox { display: none; }

/* ── Selected filters bar ────────────────────────── */
.selectedFilters {
  clear: both;
  padding: 0 16px;
}
.selectedFilters .clearAll {
  padding: 8px 0;
  background: transparent;
  text-align: right;
  line-height: 1;
}
.selectedFilters .clearAll .txt {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: #737373;
}
.selectedFilters .clearAll i {
  vertical-align: middle;
  margin-left: 4px;
  color: #737373;
}
.selectedFilters .clearAll a {
  color: #737373;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
  text-decoration: none;
}
.selectedFilters .clearAll a:hover {
  color: #171717;
}
.selectedFilters .cf {
  padding: 5px 24px 5px 10px;
  background: #f5f5f5;
  position: relative;
  line-height: 1.2;
  border: 1px solid #d4d4d4;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #404040;
  transition: border-color 0.15s;
}
.selectedFilters .cf:hover {
  border-color: #525252;
}
.selectedFilters .cf a {
  position: absolute;
  float: none;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1em;
  opacity: 0.4;
  transition: opacity 0.15s;
}
.selectedFilters .cf a:hover {
  opacity: 1;
}

/* ── Selected filters inline ─────────────────────── */
.selectedFilters.inline {
  margin: 8px 0 4px 0;
  padding: 0 16px;
  text-align: left;
  line-height: 1.2;
}
.selectedFilters.inline .clearAll {
  float: right;
  padding: 5px 0;
  margin-bottom: 8px;
  text-align: center;
  background: transparent;
}
.selectedFilters.inline .cf {
  display: inline-flex;
  align-items: center;
  margin: 0 6px 6px 0;
  padding: 5px 28px 5px 10px;
}
.selectedFilters.inline .cf a {
  position: absolute;
  right: 8px;
  margin-left: 0;
}
.has-compact-filter .selectedFilters.inline .clearAll { float: none; }
.selectedFilters.inline .clearAll i { display: none; }
.selected-filters-label {
  margin-right: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #737373;
}
.has-compact-filter .selected-filters-label { display: none; }

/* ── Buttons ─────────────────────────────────────── */
#amazzing_filter .btn {
  margin-top: 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: relative;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 600;
  background-color: #171717;
  color: #fff;
  border: none;
  transition: background-color 0.15s;
}
#amazzing_filter .btn:hover {
  background-color: #262626;
}

/* ── Slider ──────────────────────────────────────── */
.slider-values {
  height: 20px;
  font-size: 0.75rem;
  color: #525252;
}

/* ── Cut-off toggle ──────────────────────────────── */
.af_filter .toggle-cut-off {
  position: static;
  font-size: 0.75rem;
  line-height: 14px;
  text-align: center;
  padding: 4px 0 10px;
  display: none;
}
.af_filter.expandable .toggle-cut-off { display: block; }
.toggle-cut-off span {
  padding: 0 6px;
  background: #fff;
  color: #737373;
  font-weight: 600;
  font-size: 0.6875rem;
}
.toggle-cut-off .more,
.cut-off .toggle-cut-off .less,
.cut-off .cut { display: none; }
.cut-off .toggle-cut-off .more,
.toggle-cut-off .less { display: inline-block; }

/* ── More filters button ─────────────────────────── */
#amazzing_filter .toggleMoreFilters,
#amazzing_filter .toggleMoreFilters:focus {
  margin-top: 12px;
  background: #f5f5f5;
  color: #525252;
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  outline: none;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
  transition: all 0.15s;
}
#amazzing_filter .toggleMoreFilters:hover {
  border-color: #a3a3a3;
}
.af-form.show-more-f .toggleMoreFilters .more-txt,
.af-form:not(.show-more-f) .toggleMoreFilters .less-txt,
.af-form:not(.show-more-f) .more-f { display: none; }

/* ── Foldered categories ─────────────────────────── */
.foldered .af-parent-category > label .name {
  padding-right: 15px;
  position: relative;
}
.foldered .af-toggle-child:after {
  content: "+";
  font-family: 'Montserrat', sans-serif;
  position: absolute;
  padding: 3px 5px;
  line-height: 0.5em;
  font-size: 1.2em;
  font-weight: 600;
  color: #a3a3a3;
}
.foldered .open > label .af-toggle-child:after { content: "−"; }
.af_filter.foldered .af-parent-category > ul { display: none; }
.af_filter.foldered .af-parent-category.open > ul { display: block; }

/* ═══════════════════════════════════════════════════
   Horizontal layout
   ═══════════════════════════════════════════════════ */

.horizontal-layout .title_block { display: none; }
.horizontal-layout .af-form { padding: 0; }

.horizontal-layout .af_subtitle {
  background: #f5f5f5;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  padding: 9px 28px 9px 12px;
  text-transform: uppercase;
  font-size: 0.6875rem;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  transition: border-color 0.15s;
}
.horizontal-layout .af_subtitle:hover {
  border-color: #a3a3a3;
}
.horizontal-layout .closed .af_subtitle { border-color: #e5e5e5; }
.horizontal-layout .af_subtitle.toggle-content:before { right: 10px; }
.horizontal-layout .af_filter { border: 0; }

.horizontal-layout .af_filter_content {
  position: absolute;
  left: 0; right: 0;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #d4d4d4;
  border-top-width: 0;
  border-radius: 0 0 6px 6px;
  z-index: 99999;
  margin-top: -1px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.horizontal-layout .special .af_filter_content {
  position: relative;
  border-color: #e5e5e5;
  border-top-width: 1px;
  border-radius: 6px;
  margin: 4px 0 0;
  z-index: 1;
  box-shadow: none;
}
.horizontal-layout .af_filter_content > ul {
  padding: 0 8px;
  margin: 0 -8px;
  max-height: 320px;
}
.horizontal-layout .special .af_filter_content label {
  margin: 0;
  color: inherit;
}
.horizontal-layout .special .name {
  text-transform: uppercase;
  font-size: 0.6875rem;
}
.horizontal-layout .type-3 .af_filter_content,
.horizontal-layout .has-slider .af_filter_content {
  overflow: visible;
  padding-bottom: 12px;
}
.horizontal-layout .has-selection .af_subtitle {
  border-color: #171717;
  background: #171717;
  color: #fff;
}
.horizontal-layout .has-selection .af_subtitle.toggle-content:before {
  border-color: rgba(255,255,255,0.5);
}
.horizontal-layout .has-selection .af_filter_content {
  border-color: #262626;
}
.horizontal-layout .af_filter .toggle-cut-off {
  bottom: 0;
  border-top: 1px solid #e5e5e5;
  margin: 0 8px;
}
.horizontal-layout .af_filter .toggle-cut-off span {
  position: relative;
  top: -7px;
}
.horizontal-layout .af_filter.expandable .af_filter_content { padding-bottom: 2em; }
.horizontal-layout .toggleMoreFilters { width: 100%; }
.horizontal-layout .toggleMoreFilters i { float: right; line-height: 0; }

@media (min-width: 480px) {
  .horizontal-layout { margin: 0 -4px 8px -4px; }
  .horizontal-layout:after { content: ""; display: block; clear: both; }
  .horizontal-layout .selectedFilters { margin: 0 4px; }
  .horizontal-layout .h-el { float: left; width: 50%; padding: 0 4px 4px 4px; }
  .horizontal-layout .af_filter_content { left: 4px; right: 4px; }
  #amazzing_filter.horizontal-layout .btn { padding: 10px; margin: 0; line-height: 1; }
}
@media (min-width: 768px) { .horizontal-layout .h-el { width: 33.3%; } }
@media (min-width: 1200px) { .horizontal-layout .h-el { width: 25%; } }

/* ═══════════════════════════════════════════════════
   Compact / mobile view
   ═══════════════════════════════════════════════════ */

.has-compact-filter.show-filter {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: auto;
}
.has-compact-filter #amazzing_filter {
  opacity: 1;
  z-index: 10001;
  bottom: 0;
  width: 100%;
  left: 0;
  transform: translateY(100%);
  padding: 0;
  background: #fff;
  border: none;
  border-radius: 12px 12px 0 0;
  height: 100%;
  max-height: 80vh;
  overflow: auto;
  border-radius: 12px 12px 0 0;
}
.has-compact-filter.show-filter #amazzing_filter {
  transform: translateY(32px);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
}
.has-compact-filter #amazzing_filter.animation-ready {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.has-compact-filter .af.block .block_content {
  padding: 8px 0;
  max-height: 100%;
  overflow-y: auto;
}
.has-compact-filter .af_filter.expandable ul { max-height: none; }
.has-compact-filter.show-filter .af.block .block_content { -webkit-overflow-scrolling: touch; }
.has-compact-filter .af-form { padding-bottom: 0; }

#amazzing_filter .compact-toggle {
  position: absolute;
  top: 50%;
  margin-top: -16px;
  left: -32px;
  text-align: center;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: none;
}
.has-compact-filter #amazzing_filter .compact-toggle { display: block; }
.compact-toggle-text {
  position: absolute;
  transform: rotate(270deg);
  transform-origin: left;
  left: 16px;
  bottom: 16px;
  background: inherit;
  padding-right: 7px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 32px;
  white-space: nowrap;
}
.compact-toggle .compact-toggle-icon {
  display: block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  font-size: 18px;
}
.has-compact-filter #amazzing_filter.compact-offset-left { transform: translateX(-100%); }
.has-compact-filter.show-filter #amazzing_filter.compact-offset-left {
  transform: translateX(-32px);
  padding-left: 32px;
  padding-right: 0;
}
#amazzing_filter.compact-offset-left .compact-toggle {
  transform-origin: right;
  right: -32px;
  left: auto;
}
.has-compact-filter #amazzing_filter.compact-offset-left .btn-holder { left: 32px; right: 0; }
.compact-toggle.type-2 .compact-toggle-icon { opacity: 0; }
.compact-toggle.type-2 .compact-toggle-text { bottom: -6px; }
.compact-toggle.type-3 .compact-toggle-text { display: none; }

.af-compact-overlay { display: none; }
.has-compact-filter .af-compact-overlay {
  display: block;
  position: fixed;
  opacity: 0;
  margin: 0;
  transition: opacity 0.3s;
}
.has-compact-filter.show-filter .af-compact-overlay {
  background: #171717;
  opacity: 0.4;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 10000;
}
.has-compact-filter #amazzing_filter .title_block {
  display: block;
  border-radius: 0;
  padding: 14px 16px;
}

/* ── View products button (compact) ──────────────── */
.btn-holder {
  padding: 0 16px;
}
.btn.full-width { width: 100%; }

/* ═══════════════════════════════════════════════════
   Loading & animations
   ═══════════════════════════════════════════════════ */

.loading-indicator,
.viewFilteredProducts.loading:after {
  content: "";
  position: absolute;
  display: inline-block;
  width: 16px;
  height: 16px;
  left: 50%;
  top: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid;
  border-left-color: transparent;
  opacity: 0.5;
  border-radius: 100%;
  z-index: 2;
  animation: spinning 0.4s infinite linear;
}
.viewFilteredProducts.loading { pointer-events: none; }
.viewFilteredProducts.loading:before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  background: inherit;
  border-radius: inherit;
  z-index: 1;
}

/* ── Dynamic loading ─────────────────────────────── */
.dynamic-loading { text-align: center; margin-bottom: 2em; position: relative; clear: both; }
.dynamic-loading.infinite-scroll { margin: 0; }
.dynamic-product-count { display: block; margin: 0.5em 0 1.5em 0; font-size: 0.8125rem; color: #737373; }
.relative-container { position: relative; }
.infinite-scroll .loading-indicator { position: relative; left: auto; }
.dynamic-loading.infinite-scroll .loadMore { display: none; }
.dynamic-loading .loadMore,
.dynamic-loading.loading .loading-indicator { visibility: visible; transition: none; }
.dynamic-loading .loading-indicator,
.dynamic-loading.loading .loadMore { visibility: hidden; }

.hidden-name .name { display: none; }
.force-hidden { display: none; }
.af-basic-layout { margin-top: 15px; }
.af-basic-layout .showall { display: none; }

#amazzing_filter a,
#amazzing_filter a:focus { text-decoration: none; }

/* ── Animations ──────────────────────────────────── */
.btn-pulsate { animation: btn-pulsate 0.3s; }
@keyframes btn-pulsate {
  20% { transform: scale(0.95); }
  40% { transform: scale(1.05); }
  60% { transform: scale(0.98); }
  80% { transform: scale(1.02); }
}
@keyframes spinning {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.is-iphone .qsInput,
.is-iphone .input-text { font-size: 16px; }

/* ── Extended compatibility ──────────────────────── */
.u-times:before {
  content: "×";
  font-family: 'Montserrat', sans-serif;
  font-size: 1.3em;
  line-height: 1;
  position: relative;
  top: -3px;
  right: -2px;
}
.pull-left { float: left; }
.pull-right { float: right; }
.hidden { display: none; }
.clear-both { clear: both; }
.text-center { text-align: center; }

/* ── Mobile sticky bar ───────────────────────────── */
#mobile_sticky {
  transition: all 0.3s;
  transform: translateY(0);
}
.show-filter #mobile_sticky {
  transform: translateY(200px);
}
