/* =====================================================================
   FUMARI WARENKORB-REDESIGN – v1.8.0 (28.11.2026)
   Wird nur auf der Warenkorbseite geladen (basket/index.tpl).
   Farben zentral hier anpassen:
   ===================================================================== */
.basket {
  --fm-green: #1f6b25;
  --fm-green-mid: #2e8b36;
  --fm-green-bg: #f0f7ec;
  --fm-green-border: #cfe5c4;
  --fm-text: #1a1a1a;
  --fm-muted: #5f635d;
  --fm-line: #e4e6e2;
  --fm-radius: 12px;
}

/* ---------- Überschrift ---------- */
.fm-cart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.fm-cart-head__title { margin: 0; font-weight: 800; }
.fm-cart-head__count { font-size: .65em; color: var(--fm-muted); font-weight: 700; }
.fm-cart-head__continue { font-weight: 600; color: var(--fm-green); }

/* ---------- Fortschrittsbalken Gratisversand ---------- */
.fm-freeship {
  background: #fff; border: 1px solid var(--fm-line); border-radius: var(--fm-radius);
  padding: 16px 20px; margin-bottom: 20px;
}
.fm-freeship__text { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--fm-text); }
.fm-freeship__text .fas { color: var(--fm-green); font-size: 18px; }
.fm-freeship__text strong { color: var(--fm-green); }
.fm-freeship__bar { margin-top: 12px; height: 10px; background: #e8ebe6; border-radius: 99px; overflow: hidden; }
.fm-freeship__fill { display: block; height: 100%; background: var(--fm-green-mid); border-radius: 99px; transition: width .4s ease; }
.fm-freeship.is-reached { background: var(--fm-green-bg); border-color: var(--fm-green-border); }

/* ---------- Artikelliste (kompakt) ---------- */
.basket #cart-form {
  background: #fff; border: 1px solid var(--fm-line); border-radius: var(--fm-radius);
  padding: 0 20px; margin-bottom: 24px;
}
.basket .basket-items { margin-bottom: 0 !important; }

/* Kopfzeile (Artikel / Stückpreis / Anzahl / Preis) */
.basket .cart-items-header {
  padding: 12px 0 10px !important; border-bottom: 1px solid var(--fm-line);
  font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--fm-muted) !important;
}

/* Trennlinien: statt <hr> mit viel Abstand eine feine Linie */
.basket .cart-items-header hr,
.basket .cart-items-body hr,
.basket .cart-items-header > .col-12:has(> hr),
.basket .cart-items-body > .col-12:has(> hr) { display: none !important; }
.basket .cart-items-body {
  padding: 14px 0 !important; margin: 0 !important;
  align-items: center; border-bottom: 1px solid var(--fm-line);
}
.basket .cart-items-body:last-child { border-bottom: 0; }

/* Bild kleiner */
.basket .cart-items-image { flex: 0 0 92px !important; max-width: 92px !important; }
.basket .cart-items-image img { width: 76px; height: 76px; object-fit: contain; border-radius: 10px; }

/* Text enger */
.basket .cart-items-body .row-gap-3 { row-gap: 2px !important; align-items: center !important; }
.basket .cart-items-name { font-weight: 700; font-size: 15px; line-height: 1.35; color: var(--fm-text); }
.basket .cart-items-body .list-unstyled { font-size: 12px; margin: 2px 0 0 !important; }
.basket .cart-items-body .sku,
.basket .cart-items-body .sku strong { color: var(--fm-muted); font-weight: 400; }
.basket .cart-items-body .delivery-status { color: var(--fm-green); }
.basket .cart-items-body .delivery-status strong { display: none; }
.basket .cart-items-body .delivery-status::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--fm-green-mid); margin-right: 6px; vertical-align: middle;
}
.basket .cart-items-price { font-weight: 700; font-size: 16px; }

/* Merken / Entfernen: kleine Icons statt großer Buttons */
.basket .cart-items-delete { margin: 0 !important; display: flex; gap: 4px; }
.basket .cart-items-delete .btn { padding: 4px 6px !important; color: var(--fm-muted); }

/* Mengenauswahl kleiner */
.basket .quantity-input--cart .js-spinner-button { width: 34px !important; height: 34px !important; min-width: 0 !important; min-height: 0 !important; }
.basket .quantity-input--cart .quantity { height: 34px !important; font-size: 15px; }
.basket .quantity-input--cart .js-spinner__unit-addon { display: none; }

/* ---------- Bestellübersicht ---------- */
.basket .cart-summary .basket-heading { font-weight: 800; }
.basket .cart-summary .card { border: 1px solid var(--fm-line); border-radius: var(--fm-radius); }

/* Gutschein */
.fm-cart-coupon { padding: 16px 20px; }
.fm-cart-coupon__label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.fm-cart-coupon__row { display: flex; gap: 8px; }
.fm-cart-coupon__row .form-control { flex: 1 1 auto; min-width: 0; height: 44px; }
.fm-cart-coupon__row .btn { height: 44px; white-space: nowrap; text-transform: none; letter-spacing: 0; padding: 0 14px; font-size: 14px; }
.fm-cart-coupon__row.has-error .form-control { border-color: #c62828; }

/* Summen */
.fm-cart-totals { display: flex; flex-direction: column; gap: 6px; }
.fm-cart-totals__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.fm-cart-totals__row--total { font-size: 17px; font-weight: 700; border-top: 0 !important; padding-top: 0 !important; margin-top: 0 !important; }
.fm-cart-totals__row--total .total-sum { font-size: 24px; font-weight: 800; }
.fm-cart-totals__tax { text-align: right; font-size: 12px; color: var(--fm-muted); }
.fm-cart-totals__shipping { font-size: 13px; color: var(--fm-muted); margin-top: 6px; text-align: right; }

/* Zur-Kasse-Button */
.basket #cart-checkout-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; margin-top: 16px;
  border-radius: 10px; font-size: 16px; font-weight: 700;
}

/* Alte Versand-Infobox: ersetzt durch den Fortschrittsbalken oben.
   Falls du die Gewichtsanzeige nutzt, diese Regel löschen. */
.basket .basket-summary-notice { display: none; }

/* Gratisgeschenk als hervorgehobene Box */
.basket .cart-summary .free-gift-hint {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--fm-green-bg); border: 1px solid var(--fm-green-border);
  border-radius: 10px; padding: 14px 16px; margin-top: 16px; font-size: 14px;
}
.basket .cart-summary .free-gift-hint .fa-gifts { color: var(--fm-green); font-size: 20px; margin-top: 2px; }
.basket .cart-summary .free-gift-hint .btn-link {
  display: inline-block; margin-top: 8px; padding: 6px 14px !important;
  border: 2px solid var(--fm-green); border-radius: 8px; background: #fff;
  color: var(--fm-green); font-weight: 700; text-decoration: none;
}
.basket .cart-summary .free-gift-hint .btn-link u { text-decoration: none; }

/* Vertrauens-Hinweise */
.fm-cart-trust { list-style: none; margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--fm-line); display: flex; flex-direction: column; gap: 12px; }
.fm-cart-trust li { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--fm-muted); }
.fm-cart-trust .fas { color: var(--fm-green); width: 20px; text-align: center; font-size: 16px; margin-top: 2px; }
.fm-cart-trust strong { display: block; color: var(--fm-text); font-size: 14px; }

/* 18+ */
.fm-cart-age {
  display: flex; gap: 10px; align-items: center; margin-top: 14px;
  background: #fff6e6; border-radius: 8px; padding: 10px 12px;
  font-size: 13px; color: #6a4300;
}
.fm-cart-age__badge {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: 2px solid #b26a00; border-radius: 50%;
  font-weight: 800; font-size: 11px;
}

/* ---------- Handy ---------- */
@media (max-width: 767.98px) {
  .basket #cart-form { padding: 0 14px; }
  .basket .cart-items-body { align-items: flex-start; }
  .basket .cart-items-image { flex: 0 0 80px !important; max-width: 80px !important; }
  .basket .cart-items-image img { width: 64px; height: 64px; }
  .basket .cart-items-name { font-size: 14px; }
  /* Stückpreis + "Preis:"-Beschriftung weg, Menge und Preis in EINE Zeile */
  .basket .cart-items-single-price,
  .basket .cart-items-price-text { display: none !important; }
  .basket .cart-items-body .row-gap-3 { row-gap: 6px !important; }
  .basket .cart-items-quantity { flex: 0 0 auto !important; max-width: none !important; width: auto !important; order: 2; }
  .basket .cart-items-price { flex: 1 1 0 !important; max-width: none !important; text-align: right; order: 3; font-size: 16px; }
  .basket .cart-items-body .row-gap-3 > .col-12:not(.cart-items-quantity):not(.cart-items-price):not(.cart-items-single-price):not(.cart-items-delete) { order: 1; }
  .basket .cart-items-delete { order: 4; }
  .fm-cart-coupon { padding: 14px 16px; }
  .fm-freeship { padding: 14px; }
  .fm-freeship__text { font-size: 14px; }
}

/* ---------- Gratisgeschenk-Slider: Scrollbalken ausblenden ----------
   Die User-CSS (Block "product-slider ... slick-list overflow-x: auto",
   max-width 767px) macht alle Slider auf dem Handy wischbar. Dabei zeigt
   Windows/Chrome einen grauen Scrollbalken unter und neben dem Slider.
   Hier nur im Warenkorb unsichtbar machen – Wischen funktioniert weiter. */
.basket .product-slider,
.basket .product-slider .slick-list {
  scrollbar-width: none;
  -ms-overflow-style: none;
  overflow-y: hidden !important;
}
.basket .product-slider::-webkit-scrollbar,
.basket .product-slider .slick-list::-webkit-scrollbar {
  display: none; width: 0; height: 0;
}

/* ---------- Gratisgeschenk-Auswahl dezent als Karte ---------- */
.basket .basket-freegift {
  background: #fff; border: 1px solid var(--fm-line); border-radius: var(--fm-radius);
  margin: 0 0 24px !important; padding: 16px 8px 8px;
}
.basket #freeGiftsHeading {
  display: flex !important; align-items: center; justify-content: flex-start !important; gap: 0;
  font-size: 17px !important; font-weight: 800; line-height: 1.3;
  text-align: left !important; margin: 0 0 8px !important; padding: 0 !important;
}
.basket #freeGiftsHeading::before,
.basket #freeGiftsHeading::after { display: none !important; content: none !important; }
.basket #freeGiftsHeading a { color: var(--fm-text); text-decoration: none; }
.basket #freeGiftsHeading > :first-child::before,
.basket #freeGiftsHeading:not(:has(a))::before {
  content: "\f06b" !important; display: inline-block !important;
  flex: none !important; width: auto !important; height: auto !important;
  background: none !important; border: 0 !important;
  font-family: "Font Awesome 5 Free", "FontAwesome"; font-weight: 900;
  color: var(--fm-green); font-size: 18px; margin: 0 10px 0 0 !important;
}
.basket .basket-freegift .product-wrapper-freegift { padding: 6px 8px !important; }
.basket .basket-freegift .custom-control-label { width: 100%; cursor: pointer; }
.basket .basket-freegift picture,
.basket .basket-freegift img.freegift-image {
  display: block; height: 120px !important; width: 100% !important; max-width: none !important;
  object-fit: contain; margin: 0 auto 6px;
}
.basket .basket-freegift .caption p { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--fm-text); margin: 0 0 6px; }
.basket .basket-freegift .not-available-yet .caption p { color: var(--fm-muted); }
.basket .basket-freegift .progress { height: 6px !important; background: #e8ebe6 !important; border-radius: 99px !important; margin: 0 0 4px; }
.basket .basket-freegift .progress-bar { background: var(--fm-green-mid) !important; border-radius: 99px; }
.basket .basket-freegift .small { font-size: 12px; color: var(--fm-muted); }
.basket .basket-freegift .mt-1 { margin: 2px 0 0 !important; font-size: 12px; }
.basket .basket-freegift .mt-1 a { color: var(--fm-green); font-weight: 600; }

/* ---------- Gratisgeschenke als Slider (eigener Slick-Slider) ----------
   Das Script in basket/index.tpl startet den Slider neu mit der Klasse
   fm-gift-slider (statt product-slider). Dadurch greifen die Handy-Regeln
   aus der User-CSS für .product-slider hier nicht mehr, und Wischen
   funktioniert wieder. Erkennbar als Slider durch Pfeile + Punkte. */
.basket #freeGiftsHeading { border: 0 !important; }
.basket #freegift.fm-gift-slider { margin: 0 !important; }
.basket #freegift.fm-gift-slider .slick-slide { padding: 6px 8px; }

/* Punkte unter dem Slider */
.basket #freegift.fm-gift-slider .slick-dots {
  display: flex !important; justify-content: center; gap: 6px;
  list-style: none; padding: 0; margin: 10px 0 2px; position: static;
}
.basket #freegift.fm-gift-slider .slick-dots li { margin: 0; width: auto; height: auto; }
.basket #freegift.fm-gift-slider .slick-dots button {
  font-size: 0; line-height: 0; width: 8px; height: 8px; padding: 0; border: 0;
  border-radius: 99px; background: #cfd3cc; cursor: pointer;
  transition: width .2s ease, background-color .2s ease;
}
.basket #freegift.fm-gift-slider .slick-dots button::before { display: none; }
.basket #freegift.fm-gift-slider .slick-dots .slick-active button { background: var(--fm-green); width: 22px; }

/* "Weitere Geschenke  ‹ ›" rechts unter der Überschrift */
.fm-gift-nav {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  margin: -4px 4px 6px 0; font-size: 12px; font-weight: 600; color: var(--fm-green);
}
.fm-gift-nav[hidden] { display: none; }
.fm-gift-nav__label { order: 0; margin-right: 4px; }
.fm-gift-nav__btn {
  order: 1; width: 32px; height: 32px; padding: 0 0 2px; border-radius: 50%;
  border: 1px solid #d3d6d0; background: #fff; color: var(--fm-text);
  font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.fm-gift-nav__btn--next { order: 2; }
.fm-gift-nav__btn:hover:not(.slick-disabled) { border-color: var(--fm-green); color: var(--fm-green); }
.fm-gift-nav__btn.slick-disabled { opacity: .35; cursor: default; }
.fm-gift-nav__btn.slick-hidden { display: none; }

/* ---------- Handy: Chat-Button & Trusted-Shops-Siegel über die "Zur Kasse"-Leiste ----------
   Solange die feste Leiste unten sichtbar ist (body.fm-sticky-visible),
   rutschen Smartsupp (rechts) und das Trusted-Shops-Siegel (links) nach oben,
   damit sie Summe und Button nicht verdecken. Ist der echte Button im Bild,
   verschwindet die Leiste und beide gehen wieder an ihren normalen Platz. */
@media (max-width: 991.98px) {
  body.fm-sticky-visible #smartsupp-widget-container div[style*="position: fixed"] {
    bottom: calc(var(--fm-sticky-offset, 0px) + 84px) !important;
    transition: bottom .25s ease;
  }
  body.fm-sticky-visible [id^="trustbadge-container"] > div > div {
    bottom: calc(var(--fm-sticky-offset, 0px) + 80px) !important;
    transition: bottom .25s ease;
  }
}
