/* =====================================================================
   Webshop: Katalog, Filter, Produkt, Warenkorb, Kasse, Bestellungen
   ===================================================================== */

.shop-layout {
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
  gap: clamp(var(--s-5), 3vw, var(--s-7));
  align-items: start;
  padding-block: var(--s-6) var(--s-9);
}

@media (max-width: 940px) { .shop-layout { grid-template-columns: 1fr; } }

.filter-panel {
  position: sticky;
  top: calc(var(--header-h) + var(--s-4));
  display: grid;
  gap: var(--s-5);
  padding: var(--s-5);
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  max-height: calc(100dvh - var(--header-h) - var(--s-7));
  overflow-y: auto;
}

@media (max-width: 940px) {
  .filter-panel { position: static; max-height: none; }
  .filter-panel[hidden] { display: none; }
}

.filter-group { display: grid; gap: var(--s-2); }

.filter-group > h3 {
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 680;
}

.filter-list { display: grid; gap: 2px; }

.filter-list label {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  font-size: .9rem;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.filter-list label:hover { background: var(--surface-alt); }
.filter-list input { width: 18px; height: 18px; min-height: 0; flex: none; accent-color: var(--primary); }
.filter-list .count { margin-left: auto; font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

.product-grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}

.product-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  transition: transform var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease);
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: color-mix(in srgb, var(--primary) 34%, transparent);
}

.product-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: var(--surface-alt);
  color: var(--text-muted);
  overflow: hidden;
}

.product-thumb svg { width: 46%; height: 46%; opacity: .32; }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; padding: var(--s-4); }

.product-flags {
  position: absolute;
  top: var(--s-3);
  left: var(--s-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
}

.product-body { padding: var(--s-4); display: grid; gap: var(--s-2); align-content: start; }
.product-body .sku { font-family: var(--font-mono); font-size: .74rem; color: var(--text-muted); letter-spacing: -.01em; }
.product-body h3 { font-size: 1rem; line-height: 1.35; }
.product-body .desc {
  font-size: .86rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-foot {
  padding: var(--s-4);
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.price { display: grid; gap: 0; }
.price b { font-size: 1.12rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price small { font-size: .74rem; color: var(--text-muted); }
.price .strike { text-decoration: line-through; opacity: .6; font-weight: 500; font-size: .85rem; }

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--surface);
}

.qty button {
  width: 36px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.qty button:hover { background: var(--surface-alt); color: var(--text); }

.qty input {
  width: 46px;
  height: 38px;
  min-height: 0;
  border: 0;
  border-inline: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  background: transparent;
  padding: 0;
}

.qty input:focus { box-shadow: none; outline: 2px solid var(--primary); outline-offset: -2px; }

/* -------------------------------- Warenkorb --------------------------- */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(var(--s-5), 3vw, var(--s-6));
  align-items: start;
  padding-block: var(--s-6) var(--s-9);
}

@media (max-width: 940px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-line {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: var(--s-4);
  align-items: center;
  padding: var(--s-4);
  border-bottom: 1px solid var(--line-soft);
}

.cart-line:last-child { border-bottom: 0; }

.cart-line .thumb {
  width: 84px;
  height: 66px;
  border-radius: var(--r-md);
  background: var(--surface-alt);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  overflow: hidden;
}

.cart-line .thumb svg { width: 42%; opacity: .4; }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.cart-line .info { display: grid; gap: 2px; min-width: 0; }
.cart-line .info b { font-size: .96rem; }
.cart-line .info span { font-size: .8rem; color: var(--text-muted); }
.cart-line .actions { display: grid; gap: var(--s-2); justify-items: end; }

@media (max-width: 620px) {
  .cart-line { grid-template-columns: 64px minmax(0, 1fr); }
  .cart-line .thumb { width: 64px; height: 54px; }
  .cart-line .actions { grid-column: 1 / -1; justify-items: stretch; grid-auto-flow: column; align-items: center; }
}

.summary {
  position: sticky;
  top: calc(var(--header-h) + var(--s-4));
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-1);
}

@media (max-width: 940px) { .summary { position: static; } }

.summary-rows { display: grid; gap: var(--s-2); font-size: .93rem; }

.summary-rows > div {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  color: var(--text-muted);
}

.summary-rows > div span:last-child { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }

.summary-total {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.summary-total span:last-child { font-variant-numeric: tabular-nums; }

/* --------------------------------- Kasse ------------------------------ */
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: clamp(var(--s-5), 3vw, var(--s-6));
  align-items: start;
  padding-block: var(--s-6) var(--s-9);
}

@media (max-width: 980px) { .checkout-layout { grid-template-columns: 1fr; } }

.stepper {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
  flex-wrap: wrap;
}

.stepper .st {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: .86rem;
  font-weight: 620;
  color: var(--text-muted);
}

.stepper .st i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-alt);
  font-style: normal;
  font-size: .8rem;
  font-weight: 700;
}

.stepper .st.is-active { color: var(--text); }
.stepper .st.is-active i { background: var(--primary); color: var(--on-primary); }
.stepper .st.is-done i { background: var(--status-ok-bg); color: var(--status-ok-fg); }
.stepper .sep { flex: 1 1 20px; height: 1px; background: var(--line); min-width: 16px; }

/* .pay-option steht jetzt in components.css: dieselbe Wahlkachel
   wird auch im Konto fuer die Kundenart benutzt, und dort wird
   shop.css nicht geladen. Genau deshalb klebte dort "Privatperson"
   an "Lieferung an eine Privatadresse" - die Regeln fehlten.   */

/* ------------------------------ Bestellungen -------------------------- */
.order-card {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line-soft);
}

.order-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.order-head .no { font-family: var(--font-mono); font-size: .92rem; font-weight: 640; }
.order-items { display: grid; gap: var(--s-2); font-size: .9rem; }

.order-items > div {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-2) 0;
  border-bottom: 1px dashed var(--line-soft);
}

.order-items > div:last-child { border-bottom: 0; }
.order-items .q { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.timeline { display: grid; gap: var(--s-3); padding-left: var(--s-4); border-left: 2px solid var(--line-soft); }

.timeline > div { position: relative; font-size: .88rem; color: var(--text-muted); }

.timeline > div::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--s-4) - 5px);
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  border: 2px solid var(--surface);
}

.timeline > div.is-done::before { background: var(--status-ok-fg); }
.timeline > div b { display: block; color: var(--text); font-weight: 620; }

/* --------------------------- Landefeld-Hinweis ------------------------ */
.source-note {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: .76rem;
  color: var(--text-muted);
  padding: 3px var(--s-3);
  border-radius: var(--r-pill);
  background: var(--surface-alt);
}

.source-note svg { width: 13px; height: 13px; }

/* ------------------------------ Preisschranke ------------------------- */
.price.locked {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text-muted);
}

.price.locked svg { width: 15px; height: 15px; flex: none; }
.price.locked b { font-size: .86rem; font-weight: 600; }

.notice.gate-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
}

.notice.gate-banner .btn { flex: none; }

/* ---------------------------- Mengenstaffel --------------------------- */
.staffel {
  width: 100%;
  margin-top: var(--s-3);
  border-collapse: collapse;
  font-size: .88rem;
}

.staffel caption {
  text-align: left;
  font-weight: 650;
  font-size: .82rem;
  color: var(--text-muted);
  padding-bottom: var(--s-2);
}

.staffel td {
  padding: 4px 0;
  border-top: 1px solid var(--line-soft);
}

.staffel td:nth-child(2) { text-align: center; color: var(--tertiary); font-weight: 600; }
.staffel td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.staffel-hinweis { color: var(--tertiary); font-weight: 600; }
