/* ==================================================================
   Marburger Tapetenfabrik – Warenkorb
   Lädt nur auf der Warenkorbseite (siehe functions-snippet.php).
   Stil: angelehnt an die Musterübersicht – weiß, Navy, eckig, feine Linien.
   ================================================================== */

.mb-cart {
  --mb-navy: #06305f;
  --mb-navy-hover: #0b4a8a;
  --mb-text: #000;           /* Schriftfarbe – hier zentral ändern */
  --mb-ink: var(--mb-text);
  --mb-muted: #555b63;
  --mb-line: #e3e7ec;
  --mb-soft: #f5f7f9;
  --mb-focus: #005c9e;
  --mb-ok: #1f6f4a;

  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--mb-ink);
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 72px;
}
.mb-cart *,
.mb-cart *::before,
.mb-cart *::after { box-sizing: border-box; }
.mb-cart :focus-visible { outline: 2px solid var(--mb-focus); outline-offset: 2px; }

/* ---------- Kopf ---------- */
.mb-cart__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--mb-line);
}
.mb-cart__title {
  margin: 0;
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--mb-text);
}
.mb-cart .mb-cart__back {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mb-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mb-cart .mb-cart__back:hover { color: var(--mb-navy-hover); }

/* ---------- Layout ---------- */
.mb-cart__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}
@media (min-width: 992px) {
  .mb-cart__layout {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 56px;
    align-items: start;
  }
  .mb-cart__aside { position: sticky; top: 110px; }
}

/* ---------- Listenkopf ---------- */
.mb-list__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--mb-line);
}
.mb-list__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--mb-text);
}
.mb-list__count { font-size: 0.875rem; color: var(--mb-muted); }

/* ---------- Versand-Fortschritt (optional) ---------- */
.mb-ship {
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--mb-line);
  font-size: 0.875rem;
}
.mb-ship__text { margin: 0; }
.mb-ship__bar {
  display: block;
  height: 4px;
  margin-top: 8px;
  background: var(--mb-soft);
  overflow: hidden;
}
.mb-ship__fill {
  display: block;
  height: 100%;
  background: var(--mb-navy);
  transition: width 0.4s ease;
}
.mb-ship.is-done { color: var(--mb-ok); }
.mb-ship.is-done .mb-ship__fill { background: var(--mb-ok); }

/* ---------- Position ---------- */
.mb-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "thumb body  price"
    "thumb ctrl  ctrl";
  gap: 6px 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--mb-line);
}
.mb-item__thumb {
  grid-area: thumb;
  display: block;
  width: 104px;
  aspect-ratio: 4 / 5;
  background: var(--mb-soft);
  overflow: hidden;
}
.mb-item__thumb a { display: block; height: 100%; }
.mb-cart .mb-item__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
}
.mb-item__body {
  grid-area: body;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mb-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mb-muted);
}
.mb-item__title {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--mb-text);
}
.mb-cart .mb-item__title a { color: inherit; text-decoration: none; }
.mb-cart .mb-item__title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mb-item__data { font-size: 0.8125rem; color: var(--mb-muted); }
.mb-item__data dl { margin: 0; }
.mb-item__data dt, .mb-item__data dd { display: inline; margin: 0; }
.mb-item__data dd p { display: inline; margin: 0; }

.mb-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.mb-badge {
  padding: 3px 8px;
  border: 1px solid var(--mb-line);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mb-text);
}
.mb-badge--b2b { background: var(--mb-navy); border-color: var(--mb-text); color: #fff; }

.mb-item__price {
  grid-area: price;
  text-align: right;
  white-space: nowrap;
}
.mb-item__total { font-size: 1rem; font-weight: 600; color: var(--mb-text); }
.mb-item__unit { display: block; margin-top: 2px; font-size: 0.75rem; color: var(--mb-muted); }

.mb-item__controls {
  grid-area: ctrl;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 8px;
}

/* ---------- Mengenwahl ---------- */
.mb-qty {
  display: inline-flex;
  align-items: stretch;
  height: 38px;
  border: 1px solid var(--mb-line);
  background: #fff;
}
.mb-qty:focus-within { border-color: var(--mb-text); }
.mb-cart .mb-qty .quantity { display: flex; margin: 0; }
.mb-cart .mb-qty .quantity input.qty {
  width: 44px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--mb-line);
  border-right: 1px solid var(--mb-line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  color: var(--mb-text);
  -moz-appearance: textfield;
  appearance: textfield;
}
.mb-cart .mb-qty input.qty::-webkit-outer-spin-button,
.mb-cart .mb-qty input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mb-cart .mb-qty .mb-qty__btn {
  display: grid;
  place-items: center;
  width: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--mb-text);
  font-family: inherit;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}
.mb-cart .mb-qty .mb-qty__btn:hover:not(:disabled) { background: var(--mb-soft); color: var(--mb-text); }
.mb-cart .mb-qty .mb-qty__btn:disabled { color: #b8c0ca; background: #fff; cursor: not-allowed; }
.mb-qty-fixed { font-size: 0.8125rem; color: var(--mb-muted); }

/* ---------- Entfernen (überschreibt WooCommerce' rotes x) ---------- */
.mb-cart .mb-item .product-remove a.remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  height: auto;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  color: var(--mb-muted) !important;
}
.mb-cart .mb-item .product-remove a.remove:hover {
  background: none;
  color: var(--mb-text) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mb-cart .mb-item .product-remove svg { width: 14px; height: 14px; flex: none; }

/* ---------- Gutschein / Aktualisieren ---------- */
.mb-actions { padding-top: 20px; }
.mb-coupon summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mb-text);
}
.mb-coupon summary::-webkit-details-marker { display: none; }
.mb-coupon summary::after { content: '+'; margin-left: 8px; }
.mb-coupon[open] summary::after { content: '–'; }
.mb-coupon__row { display: flex; gap: 8px; max-width: 420px; margin-top: 12px; }
.mb-cart .mb-coupon__row input.input-text {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--mb-line);
  border-radius: 0;
  font-family: inherit;
  font-size: 0.9375rem;
}
.mb-cart .mb-actions .button {
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--mb-navy);
  border-radius: 0;
  background: #fff;
  color: var(--mb-text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.mb-cart .mb-actions .button:hover { background: var(--mb-navy); color: #fff; }
/* Automatische Aktualisierung – der Button bleibt nur als technische Auslöser im DOM */
body .mb-cart .mb-actions button.mb-cart__update,
body .mb-cart .mb-actions button.mb-cart__update:disabled,
body .mb-cart .mb-actions button.mb-cart__update:hover {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.mb-actions { position: relative; }
.mb-actions:not(:has(.mb-coupon)) { padding-top: 0; }

/* ---------- Bestellübersicht (WooCommerce cart_totals) ---------- */
.mb-summary { padding: 28px; border: 1px solid var(--mb-line); background: #fff; }
.mb-cart .mb-summary.cart-collaterals .cart_totals { float: none; width: 100%; margin: 0; }
.mb-cart .cart_totals > h2 { margin: 0 0 12px; font-size: 1.125rem; font-weight: 600; color: var(--mb-text); }
.mb-cart .cart_totals table.shop_table {
  width: 100%;
  margin: 0 0 20px;
  border: 0;
  border-radius: 0;
  border-collapse: collapse;
}
.mb-cart .cart_totals table.shop_table tbody tr { display: table-row; }
.mb-cart .cart_totals table.shop_table tbody th,
.mb-cart .cart_totals table.shop_table tbody td {
  display: table-cell;
  padding: 10px 0;
  border: 0;
  border-top: 1px solid var(--mb-line);
  background: none;
  font-size: 0.9375rem;
  vertical-align: top;
}
.mb-cart .cart_totals table.shop_table tbody tr:first-child th,
.mb-cart .cart_totals table.shop_table tbody tr:first-child td { border-top: 0; }
.mb-cart .cart_totals table.shop_table tbody th { text-align: left; font-weight: 400; color: var(--mb-muted); }
.mb-cart .cart_totals table.shop_table tbody td { text-align: right !important; color: var(--mb-ink); }
.mb-cart .cart_totals table.shop_table tbody td::before { display: none !important; }
.mb-cart .cart_totals .order-total th,
.mb-cart .cart_totals .order-total td {
  padding-top: 16px;
  border-top: 1px solid var(--mb-navy);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--mb-text);
}
.mb-cart .cart_totals .order-total td .woocommerce-Price-amount { font-size: 1.375rem; }
.mb-cart .cart_totals .includes_tax { display: block; font-size: 0.75rem; font-weight: 400; color: var(--mb-muted); }
.mb-cart .woocommerce-shipping-methods { margin: 0; padding: 0; list-style: none; }
.mb-cart .woocommerce-shipping-methods li { margin: 0; }
.mb-cart .woocommerce-shipping-destination { margin: 4px 0 0; font-size: 0.75rem; color: var(--mb-muted); }
.mb-cart .woocommerce-shipping-calculator { font-size: 0.8125rem; }
.mb-cart .cart_totals .wc-proceed-to-checkout { padding: 0; }
.mb-cart .mb-summary .cart_totals .wc-proceed-to-checkout a.checkout-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 0 24px;
  border: 0;
  border-radius: 0;
  background: var(--mb-navy);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.mb-cart .mb-summary .cart_totals .wc-proceed-to-checkout a.checkout-button:hover {
  background: var(--mb-navy-hover);
  color: #fff;
}

.mb-summary__legal { margin: 12px 0 0; font-size: 0.75rem; text-align: center; color: var(--mb-muted); }
.mb-trust {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--mb-line);
  list-style: none;
}
.mb-trust li { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 0.8125rem; }
.mb-trust svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--mb-text); }

/* ---------- Mobile Kassen-Leiste ---------- */
.mb-stickybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--mb-line);
  background: #fff;
  box-shadow: 0 -4px 16px rgba(6, 48, 95, 0.08);
  transition: transform 0.25s ease;
}
.mb-stickybar[hidden] { display: none; }
.mb-stickybar.is-hidden { transform: translateY(110%); }
.mb-stickybar__label { display: block; font-size: 0.75rem; color: var(--mb-muted); }
.mb-stickybar__total { font-size: 1.125rem; font-weight: 600; color: var(--mb-text); }
.mb-cart .mb-stickybar__btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  background: var(--mb-navy);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}
.mb-cart .mb-stickybar__btn:hover { background: var(--mb-navy-hover); color: #fff; }
@media (min-width: 992px) { .mb-stickybar { display: none !important; } }

/* ---------- Kleine Screens ---------- */
@media (max-width: 600px) {
  .mb-cart { padding: 16px 16px 104px; }
  .mb-cart__head { margin-bottom: 20px; }
  .mb-summary { padding: 20px; }
  .mb-item {
    grid-template-columns: 84px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "thumb body"
      "thumb price"
      "ctrl  ctrl";
    gap: 4px 16px;
    padding: 20px 0;
  }
  .mb-item__thumb { width: 84px; }
  .mb-item__price { text-align: left; }
  .mb-item__unit { display: inline; margin-left: 6px; }
  .mb-item__controls { justify-content: space-between; margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .mb-cart *, .mb-stickybar { transition: none !important; }
}

/* ==================================================================
   1.0.1 – Absicherung gegen bestehendes Theme-/Elementor-Warenkorb-CSS
   ================================================================== */
body .woocommerce div.mb-cart {
  display: block !important;
  float: none !important;
  flex: 1 1 100% !important;
  width: 100% !important;
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body .mb-cart .mb-cart__head { display: flex !important; width: 100% !important; }
body .mb-cart .mb-cart__layout { width: 100% !important; }

/* Vertrauenshinweise: Text gegen fremde span-Regeln absichern */
body .mb-cart .mb-trust li > span {
  display: inline !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  clip: auto !important;
  overflow: visible !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-size: 0.8125rem !important;
  line-height: 1.4 !important;
  color: var(--mb-ink) !important;
}

/* Versand: nur Methode + Preis */
.mb-cart .woocommerce-shipping-destination,
.mb-cart .woocommerce-shipping-calculator { display: none !important; }
.mb-cart .woocommerce-shipping-methods label { font-weight: 400; }
.mb-cart .woocommerce-shipping-methods .woocommerce-Price-amount { font-weight: 600; white-space: nowrap; }

/* PayPal-Später-bezahlen-Hinweis */
.mb-cart .cart_totals [data-pp-message],
.mb-cart .cart_totals .ppcp-messages { margin: 0 0 12px !important; }

/* ==================================================================
   1.0.3 – Hinweise (entfernt / Gutschein / Info / Fehler)
   ================================================================== */
body.woocommerce-cart .woocommerce-notices-wrapper:empty { display: none; }
body.woocommerce-cart .woocommerce-notices-wrapper { margin: 0 0 24px; }

body.woocommerce-cart .woocommerce-message,
body.woocommerce-cart .woocommerce-info,
body.woocommerce-cart .woocommerce-error {
  --mb-accent: #06305f;
  --mb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E");
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 14px;
  row-gap: 10px;
  width: auto;
  margin: 0 0 12px;
  padding: 14px 52px 14px 16px;
  list-style: none;
  background: #f5f7f9;
  border: 1px solid #e3e7ec;
  border-left: 3px solid var(--mb-accent);
  border-radius: 0;
  box-shadow: none;
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  color: #000;
  animation: mb-notice-in 0.25s ease-out;
}
body.woocommerce-cart .woocommerce-message {
  --mb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E");
}
body.woocommerce-cart .woocommerce-error {
  --mb-accent: #b3261e;
  --mb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6M12 16h.01'/%3E%3C/svg%3E");
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 4px;
  padding-right: 16px;
  background: #fdf6f5;
  border-color: #f1d4d1;
  border-left-color: var(--mb-accent);
}
body.woocommerce-cart .woocommerce-error li { grid-column: 2; margin: 0; padding: 0; }

/* Icon (ersetzt WooCommerce' Icon-Font) */
body.woocommerce-cart .woocommerce-message::before,
body.woocommerce-cart .woocommerce-info::before,
body.woocommerce-cart .woocommerce-error::before {
  content: '';
  position: static;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  font-family: inherit;
  background-color: var(--mb-accent);
  -webkit-mask: var(--mb-icon) no-repeat center / contain;
  mask: var(--mb-icon) no-repeat center / contain;
}
body.woocommerce-cart .woocommerce-message::after,
body.woocommerce-cart .woocommerce-info::after,
body.woocommerce-cart .woocommerce-error::after { display: none; content: none; }
body.woocommerce-cart .woocommerce-message:focus,
body.woocommerce-cart .woocommerce-info:focus,
body.woocommerce-cart .woocommerce-error:focus { outline: none; }

/* Links im Fließtext */
body.woocommerce-cart .woocommerce-message a:not(.button):not(.restore-item),
body.woocommerce-cart .woocommerce-info a:not(.button),
body.woocommerce-cart .woocommerce-error a:not(.button) {
  color: #000;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* "Rückgängig" und Buttons in Hinweisen (z. B. "Warenkorb anzeigen") */
body.woocommerce-cart .woocommerce-message a.restore-item,
body.woocommerce-cart .woocommerce-message a.button,
body.woocommerce-cart .woocommerce-info a.button {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  float: none;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #06305f;
  border-radius: 0;
  background: #fff;
  color: #000;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}
body.woocommerce-cart .woocommerce-message a.restore-item:hover,
body.woocommerce-cart .woocommerce-message a.button:hover,
body.woocommerce-cart .woocommerce-info a.button:hover {
  background: #06305f;
  color: #fff;
}

/* Schließen */
body.woocommerce-cart .woocommerce-message .mb-notice-close,
body.woocommerce-cart .woocommerce-info .mb-notice-close {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #555b63;
  cursor: pointer;
  transform: translateY(-50%);
}
body.woocommerce-cart .woocommerce-message .mb-notice-close:hover,
body.woocommerce-cart .woocommerce-info .mb-notice-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #000;
}
body.woocommerce-cart .mb-notice-close svg { width: 14px; height: 14px; }

@keyframes mb-notice-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
body.woocommerce-cart .mb-notice-text { min-width: 0; }
@media (max-width: 600px) {
  body.woocommerce-cart .woocommerce-message,
  body.woocommerce-cart .woocommerce-info { grid-template-columns: 18px minmax(0, 1fr); }
  body.woocommerce-cart .woocommerce-message a.restore-item,
  body.woocommerce-cart .woocommerce-message a.button,
  body.woocommerce-cart .woocommerce-info a.button { grid-column: 2; grid-row: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  body.woocommerce-cart .woocommerce-message,
  body.woocommerce-cart .woocommerce-info,
  body.woocommerce-cart .woocommerce-error { animation: none; }
}
