
/* ========== Layout / Breakout (TT5 safe, centered) ========== */
.master-produkt-wrap{
  --mp-pad: clamp(12px, 2vw, 24px);
  --mp-sidebar: 306px; /* -15% vs 360 */
  --mp-sticky-gap: 10px;
  --mp-stickybar-h: 0px; /* set via JS */
  width: 100%;
  padding-left: var(--mp-pad);
  padding-right: var(--mp-pad);
  /* Force light appearance inside plugin even if the site is in dark mode */
  color-scheme: light;
  color: #111;
}

/* Keep widths predictable inside the plugin */
.master-produkt-wrap, .master-produkt-wrap *{ box-sizing: border-box; }

.mp-width-full .master-produkt-wrap{
  width: calc(100vw - (2 * var(--mp-pad)));
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.mp-width-wide .master-produkt-wrap{
  width: min(calc(100vw - (2 * var(--mp-pad))), var(--wp--style--global--wide-size, 1400px));
  max-width: var(--wp--style--global--wide-size, 1400px);
  margin-left: calc(50% - min(50vw, calc(var(--wp--style--global--wide-size, 1400px) / 2)));
  margin-right: calc(50% - min(50vw, calc(var(--wp--style--global--wide-size, 1400px) / 2)));
}
.mp-width-content .master-produkt-wrap{
  width: min(calc(100vw - (2 * var(--mp-pad))), var(--wp--style--global--content-size, 720px));
  max-width: var(--wp--style--global--content-size, 720px);
  margin-left: calc(50% - min(50vw, calc(var(--wp--style--global--content-size, 720px) / 2)));
  margin-right: calc(50% - min(50vw, calc(var(--wp--style--global--content-size, 720px) / 2)));
}

/*
  Mobile full width
  -----------------
  Some themes (incl. Twenty Twenty-Five) constrain content width even on mobile.
  The catalog should use the full viewport width on small screens.
*/
@media (max-width: 782px){
  .master-produkt-wrap,
  .mp-width-wide .master-produkt-wrap,
  .mp-width-content .master-produkt-wrap{
    width: calc(100vw - (2 * var(--mp-pad)));
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  /* Prefer dynamic viewport units when available (avoids iOS URL bar jumps) */
  @supports (width: 100dvw){
    .master-produkt-wrap,
    .mp-width-wide .master-produkt-wrap,
    .mp-width-content .master-produkt-wrap{
      width: calc(100dvw - (2 * var(--mp-pad)));
      margin-left: calc(50% - 50dvw);
      margin-right: calc(50% - 50dvw);
    }
  }
}

/* ========== Layout grid ========== */
.master-produkt-wrap.mp-no-sidebar .mp-layout{ grid-template-columns: 1fr; }
.master-produkt-wrap.mp-no-sidebar .mp-sidebar{ display:none; }

.mp-layout{
  display: grid;
  gap: clamp(12px, 2vw, 26px);
  align-items: start;
}

/* Sidebar LEFT */
.master-produkt-wrap.mp-sidebar-left .mp-layout{ grid-template-columns: var(--mp-sidebar) minmax(0, 1fr); }
.master-produkt-wrap.mp-sidebar-left .mp-sidebar{ order: 1; }
.master-produkt-wrap.mp-sidebar-left .mp-content{ order: 2; }

/* Sidebar RIGHT */
.master-produkt-wrap.mp-sidebar-right .mp-layout{ grid-template-columns: minmax(0, 1fr) var(--mp-sidebar); }
.master-produkt-wrap.mp-sidebar-right .mp-sidebar{ order: 2; }
.master-produkt-wrap.mp-sidebar-right .mp-content{ order: 1; }

/* ========== Sidebar ========== */
.mp-sidebar{ position: sticky; top: clamp(12px, 2vw, 24px); }
.master-produkt-wrap.mp-no-sticky-sidebar .mp-sidebar{ position: static; }

.mp-sidebar__card{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(0,0,0,.05);
}
.mp-sidebar__head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  margin-bottom: 8px;
}
.mp-sidebar__title{ font-weight: 750; font-size: 16px; }
.mp-link{
  border:0;
  background: transparent;
  cursor:pointer;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 10px;
  opacity: .85;
}
.mp-link:hover{ background: rgba(0,0,0,.05); opacity:1; }

.mp-sidebar__row{ margin-top: 10px; }
.mp-sidebar__section{ margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,.06); }
.mp-sidebar__labelRow{ display:flex; justify-content:space-between; align-items:center; gap: 10px; margin-bottom: 8px; }
.mp-sidebar__label{ font-weight: 750; font-size: 13px; opacity:.9; }

.mp-sidebar__list{
  display:flex; flex-direction:column; gap: 8px;
  max-height: 300px; overflow:auto; padding-right: 4px;
  border-radius: 12px;
}
.mp-count{ font-size: 12px; opacity: .65; margin-left: 6px; }

.mp-input, .mp-select{
  width: 100%;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: #111;
  color-scheme: light;
}

.mp-input--mini{ padding: 8px 10px; font-size: 13px; border-radius: 10px; }

/* Subtle inputs */
.mp-input--subtle{
  border-color: rgba(0,0,0,.08);
  background: rgba(0,0,0,.025);
}
.mp-input--subtle:focus{
  outline: none;
  border-color: rgba(0,0,0,.18);
  background: #fff;
}
.mp-mini{ font-size: 12px; opacity:.75; display:block; margin-bottom: 6px; }
.mp-mini--hint{ margin-top: 8px; opacity:.65; }

.mp-check{ display:flex; gap:10px; align-items:center; font-size: 14px; }
.mp-check--small{ font-size: 13px; }
.mp-pillRow{ display:flex; gap: 6px; }
.mp-pill{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: #fff;
  cursor:pointer;
}
.mp-pill:hover{ background: rgba(0,0,0,.03); }

/* PRICE GRID: responsive (no overlap) + visible gap */
.mp-priceGrid{
  display:grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.mp-priceInput{
  width: 100%;
  min-width: 0;
}

/* PRICE SLIDER (dual range) */
.mp-priceSliderWrap{ margin-top: 10px; }
.mp-range{ position: relative; height: 28px; }
.mp-rangeTrack{
  position:absolute; left:0; right:0; top:50%;
  transform: translateY(-50%);
  height: 6px;
  border-radius: 999px;
  background: rgba(0,0,0,.10);
  overflow:hidden;
}
.mp-rangeFill{
  position:absolute; top:0; height:100%;
  background: var(--mp-in-cart-bg, #0ea5e9);
  border-radius: 999px;
  left: 0; width: 0;
}
.mp-range input[type="range"]{
  -webkit-appearance: none;
  appearance: none;
  position:absolute; left:0; top:0;
  width:100%; height:28px;
  margin:0;
  background: transparent;
  pointer-events: none; /* thumbs re-enabled below */
}
.mp-range input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #111;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  pointer-events: auto;
}
.mp-range input[type="range"]::-moz-range-thumb{
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #111;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  pointer-events: auto;
}
.mp-range input[type="range"]::-webkit-slider-runnable-track{ height: 6px; background: transparent; }
.mp-range input[type="range"]::-moz-range-track{ height: 6px; background: transparent; }
.mp-range input[type="range"]:focus{ outline: none; }

/* Aktionen */
.mp-actionList{ display:flex; flex-direction:column; gap: 8px; }
.mp-actionItem .mp-mini--count{ opacity:.7; margin-left: 4px; }

@media (max-width: 360px){
  .mp-priceGrid{ grid-template-columns: 1fr; }
}

/* Accordion */
.mp-accordion{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 12px;
  overflow:hidden;
  background: rgba(0,0,0,.02);
}
.mp-accordion__sum{
  cursor:pointer;
  padding: 10px 12px;
  font-weight: 650;
  font-size: 13px;
  list-style:none;
}
.mp-accordion__body{ padding: 10px 12px 12px; background: #fff; }
.mp-catTree{ display:flex; flex-direction:column; gap: 8px; }
.mp-catNode{ padding: 6px 0; }
.mp-catDetails{ margin-left: 22px; }
.mp-catSummary{ cursor:pointer; font-size: 12px; opacity:.7; }

/* ========== Sticky bar / chips ========== */
.mp-stickybar{
  position: sticky;
  top: clamp(12px, 2vw, 24px);
  z-index: 2;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  margin-bottom: var(--mp-sticky-gap);
  background: linear-gradient(to bottom, rgba(255,255,255,.96), rgba(255,255,255,.80));
  backdrop-filter: blur(10px);
}
.master-produkt-wrap.mp-no-sticky-bar .mp-stickybar{ position: static; }
.master-produkt-wrap.mp-no-chips .mp-chips{ display:none; }

.mp-stickyLeft{ display:flex; flex-direction:column; gap: 8px; min-width: 0; }
.mp-hitcount{ font-size: 13px; opacity:.75; }

.mp-stickyRight{ display:flex; align-items:center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.mp-actionBtn{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  padding: 8px 10px;
  background:#fff;
  cursor:pointer;
  font-size: 13px;
  display:inline-flex;
  gap: 8px;
  align-items:center;
}

.mp-actionBtn--icon{ padding: 8px 9px; min-width: 40px; justify-content:center; }

.mp-views{ display:flex; align-items:center; gap: 8px; }
.mp-select--mini{ padding: 7px 10px; min-height: 36px; width: 180px; max-width: 48vw; }
.mp-sort{ min-width: 220px; }

.mp-chips{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 36px;
  align-items: center;
  min-width: 0;
}
.mp-chipHint{ font-size: 13px; opacity:.65; }
.mp-chip{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}
.mp-chip span{ margin-left: 8px; opacity: .7; }

/* Hamburger icon */
.mp-hamb{
  width: 14px;
  height: 10px;
  display:inline-block;
  position: relative;
}
.mp-hamb::before,
.mp-hamb::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  height:2px;
  background: rgba(0,0,0,.75);
  border-radius: 999px;
}
.mp-hamb::before{ top:0; }
.mp-hamb::after{ bottom:0; }
.mp-hamb{ background: rgba(0,0,0,.75); border-radius:999px; height:2px; top:0; }
.mp-hamb{ transform: translateY(4px); }

/* Mobile filter toggle hidden by default */
.mp-filterToggle{ display:none; }

/* ========== Product grid/cards ========== */
.mp-grid{
  display: grid;
  grid-template-columns: repeat(var(--mp-columns, 4), minmax(0, 1fr));
  gap: clamp(12px, 2vw, 18px);
  padding-bottom: 8px;
}

.mp-card{
  position: relative;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
  min-height: 100%;
}
.mp-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0,0,0,.10);
}

.mp-card__badges{
  position:absolute;
  top: 10px; left: 10px;
  display:flex; gap: 6px; flex-wrap: wrap;
  z-index: 1;
}
.mp-tag{
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  font-weight: 750;
}
.mp-tag--new{ border-color: rgba(0,120,255,.25); }
.mp-tag--sale{ border-color: rgba(255,80,0,.25); }
.mp-tag--feat{ border-color: rgba(14,165,233,.25); }
.mp-tag--best{ border-color: rgba(120,0,255,.25); }

.mp-card__media{
  display:block;
  background: rgba(0,0,0,.02);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.mp-card__mediaInner{
  height: clamp(180px, 18vw, 240px);
  padding: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.mp-card__img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display:block;
}
.mp-card__img--ph{ width:100%; height:100%; }

.mp-card__body{
  padding: 12px 12px 14px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.mp-card__title{
  font-weight: 700;
  text-decoration: none;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mp-card__price{ font-weight: 800; font-size: 16px; }
.mp-card__meta{ display:flex; gap:8px; flex-wrap:wrap; }

.mp-badge{
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.02);
}
.mp-badge--ok{
  border-color: rgba(0,120,0,.25);
  background: rgba(0,120,0,.06);
}

.mp-card__actions{
  margin-top: 6px;
  display:flex;
  flex-direction: column;
  gap: 6px;
}

/* Variation bar (label + select) */
.mp-variantBar{
  display:flex;
  align-items:center;
  gap: 8px;
  width: 100%;
}
.mp-variantBar__label{
  font-size: 13px;
  opacity: .75;
  flex: 0 0 auto;
  min-width: 86px;
}

/* Action row: keep "Ansehen" + Qty + Cart in one line on desktop */
.mp-actionRow{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

/* Keep "Ansehen" compact on desktop */
.mp-viewBtn{ white-space: nowrap; flex: 0 0 auto; }

/* Add-to-cart group (qty + button/link) */
.mp-addcart{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 0;
  justify-content: flex-start;
  max-width: 100%;
  min-width: 0;
}
.mp-variantSelect{
  width: auto;
  min-height: 40px;
  border: 1px solid rgba(0,0,0,.12) !important;
  border-radius: 12px !important;
  padding: 8px 10px !important;
  background: #fff !important;
  color: inherit;
  font-size: 13px;
  line-height: 1.2;
}
.mp-variantSelect:focus{
  outline: none;
  border-color: rgba(14,165,233,.55);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
/* Inside rows */
.mp-variantBar .mp-variantSelect{ flex: 1 1 auto; min-width: 0; width: 100%; }
.mp-addcart .mp-addcart-var{
  flex: 1 1 auto; min-width: 0; }
.mp-addcart .mp-addcart-btn{
  flex: 0 1 180px; min-width: 120px; }
.mp-addcart .mp-variantSelect{
  flex: 1 1 auto; min-width: 0; }

/* Variable products: split remaining space 50/50 between select + button (modern compact row) */
.mp-addcart--var .mp-variantSelect,
.mp-addcart--var .mp-addcart-var{
  flex: 1 1 0;
  min-width: 0;
}
.mp-addcart--var .mp-addcart-var{ white-space: nowrap; }

@media (min-width: 768px){
  .mp-actionRow{ flex-wrap: nowrap; }
  .mp-addcart{ flex-wrap: nowrap; }
}

@media (max-width: 767px){
  .mp-actionRow .mp-viewBtn{ flex: 1 1 100%; }
  .mp-addcart{ flex: 1 1 100%; justify-content: stretch; }
}

/* Mobile (variable products): Row1 = View + Variant, Row2 = Qty + Add-to-cart */
@media (max-width: 767px){
  .mp-actionRow--var{
    display: grid;
    grid-template-columns: minmax(96px, 38%) 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
    align-items: stretch;
    width: 100%;
  }
  /* Hide optional Quick View to keep the layout clean on mobile */
  .mp-actionRow--var .mp-qvBtn{ display: none !important; }

  /* Let the add-to-cart wrapper exist for JS, but don't create a box */
  .mp-actionRow--var .mp-addcart{ display: contents; }

  .mp-actionRow--var .mp-viewBtn{
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    flex: none;
  }
  .mp-actionRow--var .mp-variantSelect{
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    flex: none;
  }
  .mp-actionRow--var .mp-qty{
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    flex: none;
  }
  .mp-actionRow--var .mp-addcart-var,
  .mp-actionRow--var .mp-addcart-btn{
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    flex: none;
    white-space: nowrap;
  }
}

/* Small screens: stack select + button if space is tight */
@media (max-width: 520px){
  .mp-addcart--var{ flex-wrap: wrap; }
  .mp-addcart--var .mp-variantSelect,
  .mp-addcart--var .mp-addcart-var{ flex: 1 1 100%; }
}

.mp-qty{
  width: 72px;
  flex: 0 0 72px;
  max-width: 100%;
  min-height: 40px;
  border: 1px solid rgba(0,0,0,.12) !important;
  border-radius: 12px !important;
  padding: 8px 10px !important;
  background: #fff !important;
}
.mp-qty:focus{
  outline: none;
  border-color: rgba(14,165,233,.55);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
.mp-addcart-btn.mp-in-cart{
  background: var(--mp-in-cart-bg, #0ea5e9) !important;
  color: var(--mp-in-cart-text, #ffffff) !important;
}

/* Desktop: sidebar should start at first product row (below stickybar) */
@media (min-width: 1025px){
  .master-produkt-wrap .mp-sidebar{
    padding-top: calc(var(--mp-stickybar-h, 0px) + var(--mp-sticky-gap));
  }
}
.mp-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 6px;
  border-radius: 12px;
  padding: 8px 10px;
  min-height: 40px;
  font-size: 13px;
  text-decoration:none;
  cursor:pointer;
}
.mp-btn--ghost{
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
}
.mp-btn--subtle{
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.02);
  color: inherit;
}
.mp-btn--primary{
  border: 1px solid rgba(0,0,0,.12);
  background: var(--mp-btn-bg, rgba(0,0,0,.90));
  color: var(--mp-btn-text, #fff);
}
.mp-btn--primary:hover{
  background: var(--mp-btn-hover-bg, rgba(0,0,0,.92));
  color: var(--mp-btn-hover-text, #fff);
}

/* No results */
.mp-noresults{ padding: 18px 0 6px; }
.mp-noresults__card{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  padding: 16px;
  background: rgba(0,0,0,.02);
}
.mp-noresults__title{ font-weight: 800; font-size: 16px; }
.mp-noresults__text{ opacity:.75; margin-top: 6px; }
.mp-noresults__actions{ margin-top: 12px; }

/* Load more + pagination */
.mp-loadmoreWrap{ display:flex; flex-direction:column; align-items:center; gap: 8px; padding: 18px 0 6px; }
.mp-loadmore{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 650;
  background:#fff;
  cursor:pointer;
  box-shadow: 0 10px 26px rgba(0,0,0,.05);
}
.mp-loadmore.is-loading{ opacity:.7; cursor:progress; }
.mp-loadmoreHint{ font-size: 13px; opacity:.7; }

.mp-pagination{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  padding: 14px 0 6px;
}
.mp-page{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  padding: 7px 10px;
  text-decoration:none;
  background:#fff;
  font-size: 13px;
}
.mp-page.is-active{
  font-weight: 800;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.12);
}

.mp-empty{ padding: 24px 0; font-size: 16px; }
.mp-debug{ margin-top: 10px; font-size: 12px; opacity: .85; }

/* ========== Mobile drawer + responsive ========== */
@media (max-width: 1024px){
  .mp-layout{ grid-template-columns: 1fr !important; }
  .mp-sort{ min-width: 180px; }
  .mp-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .master-produkt-wrap:not(.mp-no-sidebar):not(.mp-no-drawer) .mp-filterToggle{
    display: inline-flex;
  }

  .master-produkt-wrap:not(.mp-no-sidebar):not(.mp-no-drawer) .mp-sidebar{
    position: fixed;
    /*
      iPhone/Safari + sticky site headers/footers can cause the drawer to
      overlap UI elements. We keep a dynamic inset from top/bottom.
      Values are set via CSS variables (with JS measurement fallback).
    */
    top: calc(env(safe-area-inset-top) + var(--mp-mobile-header-h, 0px) + var(--mp-mobile-top-gap, 16px));
    bottom: calc(env(safe-area-inset-bottom) + var(--mp-mobile-footer-h, 0px) + var(--mp-mobile-bottom-gap, 16px) + var(--mp-mobile-bottom-extra, 0px));
    height: auto;
    width: min(88vw, 330px);
    z-index: 55;
    padding: var(--mp-pad);
    /* comfortable inner padding (the outer inset already accounts for safe areas) */
    padding-bottom: calc(var(--mp-pad) + 10px);
    background: transparent;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transition: transform .18s ease;
  }
  .master-produkt-wrap.mp-sidebar-right .mp-sidebar{
    right: 0; left: auto;
    transform: translateX(110%);
  }
  .master-produkt-wrap.mp-sidebar-left .mp-sidebar{
    left: 0; right: auto;
    transform: translateX(-110%);
  }
  .master-produkt-wrap.mp-drawer-open .mp-sidebar{
    transform: translateX(0);
  }

  .mp-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 54;
  }
  /* When drawer is open, hide the floating button so it doesn't cover bottom controls */
  .master-produkt-wrap.mp-drawer-open .mp-fabFilter{ display:none !important; }


  .mp-sidebar{ order: 0 !important; }
}

@media (max-width: 560px){
  .mp-grid{ grid-template-columns: 1fr; }
  .mp-sort{ min-width: 160px; }
}

/* ========== Darkmode (Device) ========== */

/* Darkmode disabled for Master Produktkatalog (forced light scheme) */



/* Remove WooCommerce auto 'View cart' link inside our cards */
.master-produkt-wrap a.added_to_cart{ display:none !important; }


/* ==========================================================
   FIX: <= 3 Reihen/Spalten — Add-to-cart als Icon-Button
   ----------------------------------------------------------
   Wenn das Grid nur noch 3 (oder weniger) Spalten hat, soll
   statt "In den Warenkorb" ein kompakter Button mit
   Warenkorb+ Symbol angezeigt werden.
   Die Klasse .mp-cols-le-3 wird per JS anhand der echten
   Grid-Spalten gesetzt.
   ========================================================== */

.master-produkt-wrap.mp-cols-le-3 .mp-card__title{
  /* Reserve 2 lines (some titles wrap) for consistent card height */
  min-height: calc(1.25em * 2);
}


.master-produkt-wrap.mp-cols-le-3 .mp-addcart .mp-addcart-btn,
.master-produkt-wrap.mp-cols-le-3 .mp-addcart .mp-addcart-var{
  font-size: 0 !important;
  padding: 0 !important;
  width: 40px !important;
  min-width: 40px !important;
  flex: 0 0 40px !important;
}
.master-produkt-wrap.mp-cols-le-3 .mp-addcart--var .mp-variantSelect{
  flex: 1 1 auto !important;
}

.master-produkt-wrap.mp-cols-le-3 .mp-addcart .mp-addcart-btn::before,
.master-produkt-wrap.mp-cols-le-3 .mp-addcart .mp-addcart-var::before{
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M7%2018c-1.1%200-1.99.9-1.99%202S5.9%2022%207%2022s2-.9%202-2-.9-2-2-2zm10%200c-1.1%200-1.99.9-1.99%202S15.9%2022%2017%2022s2-.9%202-2-.9-2-2-2zM7.16%2014h9.72c.75%200%201.4-.41%201.74-1.03l3.58-6.49a1%201%200%200%200-.87-1.48H6.21L5.27%202H1v2h3l3.6%207.59-1.35%202.44C5.52%2015.37%206.48%2017%207.96%2017H19v-2H7.96l1.2-2z'/%3E%3Cpath%20d='M11%202h2v3h3v2h-3v3h-2V7H8V5h3z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M7%2018c-1.1%200-1.99.9-1.99%202S5.9%2022%207%2022s2-.9%202-2-.9-2-2-2zm10%200c-1.1%200-1.99.9-1.99%202S15.9%2022%2017%2022s2-.9%202-2-.9-2-2-2zM7.16%2014h9.72c.75%200%201.4-.41%201.74-1.03l3.58-6.49a1%201%200%200%200-.87-1.48H6.21L5.27%202H1v2h3l3.6%207.59-1.35%202.44C5.52%2015.37%206.48%2017%207.96%2017H19v-2H7.96l1.2-2z'/%3E%3Cpath%20d='M11%202h2v3h3v2h-3v3h-2V7H8V5h3z'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
}



/* ==========================================================
   FIX: Laptop widths (e.g. 1366px) – keep action row 1-line
   ----------------------------------------------------------
   Goal:
   - Cards can get narrow (sidebar + many columns) on laptops.
   - We keep the desktop-like one-line action row (like Bild 2)
     by allowing flex items to SHRINK instead of wrapping.

   Solution:
   - Use fewer columns on mid-width desktops.
   - Per-card (container query) tighten widths + allow ellipsis.
   - Media fallback for browsers without container queries.
   ========================================================== */

/* Mid-width desktops/laptops: reduce columns for better card width */
@media (max-width: 1480px) and (min-width: 1025px){
  .master-produkt-wrap{ --mp-columns: 3; }
}
@media (max-width: 1180px) and (min-width: 1025px){
  .master-produkt-wrap{ --mp-columns: 2; }
}

/* Per-card tightening (modern browsers) */
@media (min-width: 768px){
  .mp-card{ container-type: inline-size; }
  @container (max-width: 420px){
    .mp-actionRow{ flex-wrap: nowrap; }
    .mp-addcart{ flex-wrap: nowrap; min-width: 0; width: 100%; }

    .mp-viewBtn{
      flex: 0 1 auto;
      max-width: 120px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .mp-qty{ flex: 0 0 64px; width: 64px; }

    .mp-addcart .mp-addcart-var{ flex: 1 1 auto; min-width: 0; }
    .mp-addcart .mp-variantSelect{ flex: 1 1 auto; min-width: 0; width: 100%; }

    .mp-addcart .mp-addcart-btn,
    .mp-addcart button,
    .mp-addcart .button{
      flex: 0 1 180px;
      min-width: 120px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* ==========================================================
       FIX: <= 3 Spalten / schmale Cards — Icon statt Text
       ----------------------------------------------------------
       Wenn die Cards schmal werden (typisch bei 3 Spalten), ist
       "In den Warenkorb" zu lang. Wir zeigen dann ein kompaktes
       Warenkorb+ Icon, behalten aber die ARIA-Labels/Text im DOM.
       Gilt nur ab Tablet/Desktop (min-width: 768px) und nur bei
       schmalen Card-Containern.
       ========================================================== */

    .mp-addcart .mp-addcart-btn,
    .mp-addcart .mp-addcart-var{
      /* kompakter Icon-Button */
      font-size: 0 !important;
      padding: 0 !important;
      width: 40px !important;
      min-width: 40px !important;
      flex: 0 0 40px !important;
    }
    /* Bei Variationen soll das Select die restliche Breite bekommen */
    .mp-addcart--var .mp-variantSelect{ flex: 1 1 auto !important; }

    .mp-addcart .mp-addcart-btn::before,
    .mp-addcart .mp-addcart-var::before{
      content: "";
      display: block;
      width: 18px;
      height: 18px;
      background: currentColor;
      /* Cart + Icon (SVG mask) */
      -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M7%2018c-1.1%200-1.99.9-1.99%202S5.9%2022%207%2022s2-.9%202-2-.9-2-2-2zm10%200c-1.1%200-1.99.9-1.99%202S15.9%2022%2017%2022s2-.9%202-2-.9-2-2-2zM7.16%2014h9.72c.75%200%201.4-.41%201.74-1.03l3.58-6.49a1%201%200%200%200-.87-1.48H6.21L5.27%202H1v2h3l3.6%207.59-1.35%202.44C5.52%2015.37%206.48%2017%207.96%2017H19v-2H7.96l1.2-2z'/%3E%3Cpath%20d='M11%202h2v3h3v2h-3v3h-2V7H8V5h3z'/%3E%3C/svg%3E");
      mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M7%2018c-1.1%200-1.99.9-1.99%202S5.9%2022%207%2022s2-.9%202-2-.9-2-2-2zm10%200c-1.1%200-1.99.9-1.99%202S15.9%2022%2017%2022s2-.9%202-2-.9-2-2-2zM7.16%2014h9.72c.75%200%201.4-.41%201.74-1.03l3.58-6.49a1%201%200%200%200-.87-1.48H6.21L5.27%202H1v2h3l3.6%207.59-1.35%202.44C5.52%2015.37%206.48%2017%207.96%2017H19v-2H7.96l1.2-2z'/%3E%3Cpath%20d='M11%202h2v3h3v2h-3v3h-2V7H8V5h3z'/%3E%3C/svg%3E");
      -webkit-mask-repeat: no-repeat;
      mask-repeat: no-repeat;
      -webkit-mask-size: contain;
      mask-size: contain;
      -webkit-mask-position: center;
      mask-position: center;
    }
  }
}

/* Fallback (no container queries): tighten for laptop widths */
@media (max-width: 1480px) and (min-width: 768px){
  .mp-actionRow{ flex-wrap: nowrap; }
  .mp-addcart{ flex-wrap: nowrap; min-width: 0; width: 100%; }

  .mp-viewBtn{
    flex: 0 1 auto;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mp-addcart .mp-addcart-var{ min-width: 0; }
  .mp-addcart .mp-variantSelect{ min-width: 0; }

  .mp-addcart .mp-addcart-btn,
  .mp-addcart button,
  .mp-addcart .button{
    min-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Fallback ohne Container Queries: auch hier Icon-Button bei schmalen Cards */
  .mp-addcart .mp-addcart-btn,
  .mp-addcart .mp-addcart-var{
    font-size: 0 !important;
    padding: 0 !important;
    width: 40px !important;
    min-width: 40px !important;
    flex: 0 0 40px !important;
  }
  .mp-addcart--var .mp-variantSelect{ flex: 1 1 auto !important; }

  .mp-addcart .mp-addcart-btn::before,
  .mp-addcart .mp-addcart-var::before{
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M7%2018c-1.1%200-1.99.9-1.99%202S5.9%2022%207%2022s2-.9%202-2-.9-2-2-2zm10%200c-1.1%200-1.99.9-1.99%202S15.9%2022%2017%2022s2-.9%202-2-.9-2-2-2zM7.16%2014h9.72c.75%200%201.4-.41%201.74-1.03l3.58-6.49a1%201%200%200%200-.87-1.48H6.21L5.27%202H1v2h3l3.6%207.59-1.35%202.44C5.52%2015.37%206.48%2017%207.96%2017H19v-2H7.96l1.2-2z'/%3E%3Cpath%20d='M11%202h2v3h3v2h-3v3h-2V7H8V5h3z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M7%2018c-1.1%200-1.99.9-1.99%202S5.9%2022%207%2022s2-.9%202-2-.9-2-2-2zm10%200c-1.1%200-1.99.9-1.99%202S15.9%2022%2017%2022s2-.9%202-2-.9-2-2-2zM7.16%2014h9.72c.75%200%201.4-.41%201.74-1.03l3.58-6.49a1%201%200%200%200-.87-1.48H6.21L5.27%202H1v2h3l3.6%207.59-1.35%202.44C5.52%2015.37%206.48%2017%207.96%2017H19v-2H7.96l1.2-2z'/%3E%3Cpath%20d='M11%202h2v3h3v2h-3v3h-2V7H8V5h3z'/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
  }
}


/* ========== UX Extras (Toast, Loading, Skeletons, Quick View, Favorites) ========== */

/* Primary button disabled/loading */
.mp-btn--primary[aria-disabled="true"],
.mp-btn--primary:disabled{
  background: var(--mp-btn-disabled-bg, #9ca3af);
  color: var(--mp-btn-disabled-text, #ffffff);
}
.mp-btn[aria-disabled="true"]{ pointer-events:none; opacity:.8; }
.mp-btn.is-loading,
.mp-loadmore.is-loading,
.mp-actionBtn.is-loading{
  pointer-events:none;
  opacity:.85;
}
.mp-btn.is-loading::after,
.mp-loadmore.is-loading::after,
.mp-actionBtn.is-loading::after{
  content:"";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  display:inline-block;
  margin-left: 8px;
  animation: mp-spin .8s linear infinite;
}
@keyframes mp-spin{ from{ transform: rotate(0deg);} to{ transform: rotate(360deg);} }

/* Reset button next to chips */
.mp-resetBtn{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  margin-left: 4px;
}
.mp-resetBtn[disabled]{ opacity:.55; cursor:not-allowed; }

/* Toast (inline feedback) */
.mp-addcart, .mp-card__actions{ position: relative; }
.mp-toast{
  position: absolute;
  right: 0;
  bottom: -8px;
  transform: translateY(8px);
  opacity: 0;
  pointer-events:none;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.96);
  box-shadow: 0 10px 26px rgba(0,0,0,.10);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 5;
  white-space: nowrap;
}
.mp-toast.is-show{
  opacity: 1;
  transform: translateY(0);
}

/* Warning badge (low stock) */
.mp-badge--warn{
  border-color: rgba(200,120,0,.35);
  background: rgba(200,120,0,.10);
}

/* Skeleton cards */
.mp-skelCard{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  overflow:hidden;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,.06);
}
.mp-skelMedia{
  height: 170px;
  background: linear-gradient(90deg, rgba(0,0,0,.05), rgba(0,0,0,.10), rgba(0,0,0,.05));
  background-size: 200% 100%;
  animation: mp-shimmer 1.2s ease-in-out infinite;
}
.mp-skelBody{ padding: 12px; display:flex; flex-direction:column; gap: 10px; }
.mp-skelLine{
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0,0,0,.05), rgba(0,0,0,.10), rgba(0,0,0,.05));
  background-size: 200% 100%;
  animation: mp-shimmer 1.2s ease-in-out infinite;
}
.mp-skelLine.sm{ width: 60%; }
@keyframes mp-shimmer{ 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

/* Favorites */
.mp-favBtn{
  position:absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  color: rgba(0,0,0,.62);
  transition: transform .12s ease, color .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 16px;
  line-height: 1;
  opacity: .92;
}
.mp-favBtn:hover{ transform: translateY(-1px); }
.mp-favBtn.is-active{
  color: #e11d48;
  border-color: rgba(225,29,72,.35);
  box-shadow: inset 0 0 0 2px rgba(225,29,72,.18), 0 10px 24px rgba(225,29,72,.12);
}
.mp-card.mp-isFav{ outline: 2px solid rgba(0,0,0,.10); outline-offset: 2px; }

/* Mobile sticky filter FAB */
.mp-fabFilter{
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 60;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  padding: 12px 14px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
  cursor:pointer;
  display:none;
}
@media (max-width: 1024px){
  .master-produkt-wrap:not(.mp-no-sidebar):not(.mp-no-drawer) .mp-fabFilter{ display:block; }
}

/* Drawer footer actions */
.mp-drawerFoot{
  display:none;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,.06);
}
.mp-drawerFoot .mp-btn{ flex: 1; }
@media (max-width: 1024px){
  .master-produkt-wrap:not(.mp-no-sidebar):not(.mp-no-drawer) .mp-drawerFoot{ display:flex; }
}

/* Quick View modal */
.mp-qv[hidden]{ display:none !important; }
.mp-qv{
  position: fixed;
  inset: 0;
  z-index: 80;
}
.mp-qv__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}
.mp-qv__panel{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  width: min(92vw, 920px);
  max-height: 86vh;
  overflow:auto;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  padding: 18px;
}
.mp-qv__close{
  position:absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.92);
  cursor:pointer;
  font-size: 18px;
  line-height: 1;
}
.mp-qvCard{ display:grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items:start; }
@media (max-width: 780px){ .mp-qvCard{ grid-template-columns: 1fr; } }
.mp-qvCard__media{ border: 1px solid rgba(0,0,0,.08); border-radius: 16px; overflow:hidden; }
.mp-qvCard__body{ display:flex; flex-direction:column; gap: 10px; }
.mp-qvTitle{ font-weight: 800; font-size: 18px; text-decoration:none; color: inherit; }
.mp-qvPrice{ font-weight: 900; font-size: 18px; }
.mp-qvDesc{ opacity:.85; }
.mp-qvActions{ display:flex; gap: 10px; flex-wrap:wrap; }
.mp-qvLoading{ padding: 14px; display:flex; flex-direction:column; gap: 10px; }

/* Darkmode additions */

/* Darkmode disabled (removed  block) */



/* ========== Mobile full width HARD OVERRIDE (Block themes / TT5) ========== */

/* Some block themes constrain any element inside Post Content.
   Force the catalog wrapper to break out to the full viewport width on mobile/tablet. */
@media (max-width: 1024px){
  body .master-produkt-wrap,
  body .wp-site-blocks .master-produkt-wrap,
  body .wp-block-post-content > .master-produkt-wrap,
  body .entry-content > .master-produkt-wrap,
  body .wp-block-group__inner-container > .master-produkt-wrap{
    box-sizing: border-box !important;
    display: block !important;
    width: 100vw !important;
    max-width: 100vw !important;
    inline-size: 100vw !important;
    max-inline-size: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
  }

  /* Prefer dynamic viewport units when available (avoids iOS URL bar jumps) */
  @supports (width: 100dvw){
    body .master-produkt-wrap,
    body .wp-site-blocks .master-produkt-wrap,
    body .wp-block-post-content > .master-produkt-wrap,
    body .entry-content > .master-produkt-wrap,
    body .wp-block-group__inner-container > .master-produkt-wrap{
      width: 100dvw !important;
      max-width: 100dvw !important;
      inline-size: 100dvw !important;
      max-inline-size: 100dvw !important;
      margin-left: calc(50% - 50dvw) !important;
      margin-right: calc(50% - 50dvw) !important;
    }
  }
}
/* Keep placeholders readable in dark themes */
.master-produkt-wrap input::placeholder,
.master-produkt-wrap textarea::placeholder{
  color: rgba(0,0,0,.45) !important;
}
