/* Mediatech Produktfilter, Agent Q, 28.09.2026.
   Abstaende nach Fibonacci: 5, 8, 13, 21, 34, 55 Pixel. Hausfarbe #823a2d.
   Laedt nur auf Shop-, Kategorie- und Suchseiten (mediatech-filter.php, Prioritaet 115). */

.mt-filter {
  font-size: 13px;
  line-height: 21px;
}

.mt-filter-block {
  margin-bottom: 21px;
  padding-bottom: 13px;
  border-bottom: 1px solid #e8e2db;
}

.mt-filter-block:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.mt-filter-titel {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #2b2b2b;
  margin: 0 0 8px;
  padding: 0;
}

.mt-filter-liste {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mt-filter-liste li {
  margin: 0;
  padding: 0;
}

.mt-filter-liste li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  margin: 0 -8px;
  border-radius: 3px;
  color: #444;
  text-decoration: none;
  min-height: 34px;
}

.mt-filter-liste li > a:hover,
.mt-filter-liste li > a:focus {
  background: #f6f2ee;
  color: #823a2d;
}

.mt-filter-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mt-filter-zahl {
  flex: 0 0 auto;
  font-size: 11px;
  color: #8a8a8a;
  background: #f2efe9;
  border-radius: 8px;
  padding: 0 8px;
  line-height: 21px;
}

.mt-filter-an > a,
.mt-filter-an > a:hover {
  background: #823a2d;
  color: #fff;
  font-weight: 600;
}

.mt-filter-an > a .mt-filter-zahl {
  background: rgba(255, 255, 255, 0.21);
  color: #fff;
}

.mt-filter-weg {
  flex: 0 0 auto;
  font-size: 11px;
  text-decoration: underline;
}

.mt-filter-gesetzt .mt-filter-titel {
  color: #823a2d;
}

/* Seitenleiste selbst: ruhiger Kasten, Fibonacci-Innenabstand. */
.site-content .sidebar .widget.mt_produktfilter {
  background: #fff;
  border: 1px solid #e8e2db;
  border-radius: 5px;
  padding: 13px 13px 21px;
  margin-bottom: 21px;
}

.site-content .sidebar .widget.mt_produktfilter > .widget-title,
.site-content .sidebar .widget.mt_produktfilter > h3,
.site-content .sidebar .widget.mt_produktfilter > h4 {
  font-size: 16px;
  margin: 0 0 13px;
  padding: 0 0 8px;
  border-bottom: 2px solid #823a2d;
}

/* ------------------------------------------------------------------ Telefon
   Eigener Aufklapper (mediatech-filter.php). Die Klasse mt-filter-bereit setzt das
   JavaScript; ohne JavaScript greift nichts davon und es bleibt beim Verhalten des
   Elternthemas. Abstaende nach Fibonacci, Tippflaechen mindestens 44 Pixel. */

.mt-filter-leiste { display: none; }
.mt-filter-kopf { display: none; }
.mt-filter-hintergrund { display: none; }

@media (max-width: 991.98px) {

  /* Knopf ueber dem Raster. */
  body.mt-filter-bereit .mt-filter-leiste {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 13px;
    margin: 0 0 13px;
  }

  body.mt-filter-bereit .mt-filter-knopf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 21px;
    border: 1px solid #823a2d;
    border-radius: 3px;
    background: #823a2d;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 21px;
  }

  body.mt-filter-bereit .mt-filter-knopf::before {
    content: "";
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    background:
      linear-gradient(#fff, #fff) left 0 top 2px / 13px 2px no-repeat,
      linear-gradient(#fff, #fff) left 0 top 6px / 13px 2px no-repeat,
      linear-gradient(#fff, #fff) left 0 top 10px / 13px 2px no-repeat;
  }

  body.mt-filter-bereit .mt-filter-knopf:focus-visible {
    outline: 2px solid #2b2b2b;
    outline-offset: 2px;
  }

  body.mt-filter-bereit .mt-filter-knopf-zahl {
    font-size: 13px;
    color: #6a6a6a;
  }

  /* Electros Umschalter tritt zurueck, es soll nur einen Knopf geben. */
  body.mt-filter-bereit .shop-control-bar .handheld-sidebar-toggle { display: none !important; }

  /* Der Kasten selbst. Hoehere Spezifitaet als .site-content .sidebar des Elternthemas,
     damit weder opacity 0 noch visibility hidden noch left -280px dazwischenfunken. */
  body.mt-filter-bereit .site-content .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(89vw, 377px);
    max-width: 100%;
    height: 100%;
    margin: 0;
    padding: 0 0 55px;
    background: #fff;
    z-index: 1050;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 1;
    visibility: visible;
    transform: translateX(-102%);
    transition: transform 0.21s ease-out;
    box-shadow: none;
  }

  body.mt-filter-bereit.mt-filter-offen .site-content .sidebar {
    transform: none;
    box-shadow: 0 0 21px rgba(0, 0, 0, 0.34);
  }

  /* Im Aufklapper stehen nur Filter. Die uebrigen Widgets der Seitenleiste
     (Bild, Neu im Sortiment) gehoeren auf dem Telefon nicht in einen Kasten, der Filter heisst. */
  body.mt-filter-bereit .site-content .sidebar > aside:not(.mt_produktfilter) { display: none; }

  body.mt-filter-bereit .mt-filter-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 13px;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 13px;
    background: #fff;
    border-bottom: 2px solid #823a2d;
  }

  .mt-filter-kopf-titel {
    font-size: 16px;
    font-weight: 700;
    color: #2b2b2b;
  }

  body.mt-filter-bereit .mt-filter-schliessen {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 13px;
    border: 1px solid #823a2d;
    border-radius: 3px;
    background: #fff;
    color: #823a2d;
    font-size: 14px;
    font-weight: 600;
  }

  body.mt-filter-bereit .mt-filter-schliessen:focus-visible {
    outline: 2px solid #823a2d;
    outline-offset: 2px;
  }

  body.mt-filter-bereit .site-content .sidebar .widget.mt_produktfilter {
    border: 0;
    border-radius: 0;
    padding: 13px;
    margin: 0;
  }

  body.mt-filter-bereit .site-content .sidebar .widget.mt_produktfilter > .widget-title,
  body.mt-filter-bereit .site-content .sidebar .widget.mt_produktfilter > h3,
  body.mt-filter-bereit .site-content .sidebar .widget.mt_produktfilter > h4 { display: none; }

  body.mt-filter-bereit .mt-filter-hintergrund {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1049;
    background: rgba(0, 0, 0, 0.55);
  }

  body.mt-filter-bereit .mt-filter-hintergrund[hidden] { display: none; }

  .mt-filter-liste li > a { min-height: 44px; }
}

/* Wer keine Bewegung mag, bekommt keine. */
@media (prefers-reduced-motion: reduce) {
  body.mt-filter-bereit .site-content .sidebar { transition: none; }
}
