/* ==========================================================================
   FORGE · WARENKORB
   ========================================================================== */

.basket { padding-top: 6px; }
.basket > .row { margin: 0; gap: clamp(20px, 3vw, 48px); flex-wrap: nowrap; align-items: flex-start; }
.basket > .row > .col-lg-7, .basket > .row > .col-lg-12 { flex: 1 1 0; max-width: none; min-width: 0; padding: 0; }
.basket > .row > .col-lg-4 { flex: 0 0 clamp(340px, 30vw, 460px); max-width: none; padding: 0; margin: 0 !important; }

.fg-cart-head { margin: 8px 0 22px; }
.fg-cart-title { font-size: clamp(2.2rem, 1.4rem + 2.4vw, 3.6rem) !important; margin: 0; }
.fg-cart-count { color: var(--fg-muted); margin: 6px 0 0; }

/* Positionen als Karten */
.basket .cart-items-header { display: none !important; }
.basket .basket-items > .row > .col-12 > hr, .basket .cart-items-body > .col-12:last-child { display: none; }
.basket .basket-items { display: grid; gap: 12px; }
.basket .cart-items-body {
    position: relative; display: grid; grid-template-columns: clamp(110px, 12vw, 180px) minmax(0, 1fr); gap: clamp(14px, 2vw, 28px);
    margin: 0; padding: 16px; border-radius: var(--fg-radius-lg); border: 1px solid var(--fg-line);
    background: linear-gradient(180deg, #141919, #101414);
    transition: border-color .4s var(--fg-ease);
}
.basket .cart-items-body:hover { border-color: var(--fg-line-strong); }
.basket .cart-items-body > [class*="col"] { max-width: none; flex: none; width: auto; padding: 0; }
/* Bild ohne Platte direkt auf der Karte, Weiß per #fg-knockout (layout/footer.tpl) entfernt */
.basket .cart-items-image a { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: none; border-radius: 0; }
.basket .cart-items-image img { position: absolute; inset: 4%; width: 92%; height: 92%; object-fit: contain; mix-blend-mode: normal; filter: url(#fg-knockout); }

.basket .cart-items-body.type-1 > .col > .row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(110px, auto); grid-auto-rows: auto;
    column-gap: clamp(14px, 2vw, 32px); row-gap: 6px; margin: 0; align-items: start;
}
.basket .cart-items-body > .col > .row > [class*="col"] { max-width: none; flex: none; width: auto; padding: 0; margin: 0; }
.basket .type-1 > .col > .row > :nth-child(1) { grid-column: 1; grid-row: 1; }
.basket .type-1 > .col > .row > :nth-child(2) { grid-column: 1; grid-row: 3; font-size: .82rem; color: var(--fg-subtle); }
.basket .type-1 > .col > .row > :nth-child(3) { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.basket .type-1 > .col > .row > :nth-child(4) { grid-column: 3; grid-row: 1; text-align: right; }
.basket .type-1 > .col > .row > :nth-child(5) { grid-column: 1; grid-row: 2; }
.basket .type-1 > .col > .row > :nth-child(6) { grid-column: 2 / span 2; grid-row: 3; display: flex; justify-content: flex-end; gap: 4px; align-self: end; }
.basket .type-1 > .col > .row > :nth-child(n+7) { grid-column: 1 / -1; }

.basket .cart-items-name { font-family: var(--fg-display); font-weight: 600; font-size: 1.15rem; color: var(--fg-text) !important; line-height: 1.25; }
.basket .cart-items-name:hover { color: var(--fg-lime) !important; }
.basket .cart-items-price-text { display: none; }
.basket .cart-items-single-price { color: var(--fg-subtle); }
.basket .cart-items-single-price::before { content: "Stückpreis: "; }
.basket .price_overall { font-family: var(--fg-display); font-weight: 700; font-size: 1.35rem; color: var(--fg-text) !important; white-space: nowrap; }
.basket .shortdescription ul { display: flex; flex-wrap: wrap; gap: 2px 8px; list-style: none; margin: 0; padding: 0; }
.basket .shortdescription li { color: var(--fg-muted); font-size: .84rem; }
.basket .shortdescription li + li::before { content: "·"; margin-right: 8px; color: var(--fg-subtle); }
.basket .cart-items-body .list-unstyled { margin: 0; }
.basket .cart-items-body .sku { color: var(--fg-subtle); font-size: .78rem; margin-top: 4px; }
.basket .cart-items-body .sku .font-weight-bold-util { font-weight: 400 !important; }
.basket .qty-wrapper { max-width: none !important; }
.basket .form-counter { height: 44px; }
.basket .form-counter .form-control { width: 44px; }
.basket .cart-items-delete .btn {
    min-height: 36px; padding: 0 10px; font-size: .8rem; color: var(--fg-muted) !important; border: 1px solid transparent !important;
}
.basket .cart-items-delete .btn:hover { color: var(--fg-danger) !important; border-color: rgba(255,93,97,.3) !important; background: var(--fg-danger-bg) !important; }
.basket .cart-items-delete .wishlist-button:hover { color: var(--fg-lime) !important; border-color: rgba(198,244,50,.3) !important; background: var(--fg-lime-a10) !important; }
.basket .cart-items-delete .fas, .basket .cart-items-delete .far { margin-right: 6px; }
.basket .cart-items-body:not(.type-1) { grid-template-columns: 1fr; }
.basket .cart-items-body:not(.type-1) .cart-items-image { display: none; }
.fg-cart-continue { margin-top: 18px; display: inline-flex; }
.fg-cart-continue .fg-icon { order: -1; }
.fg-cart-continue:hover .fg-icon { transform: translateX(-4px) !important; }

/* Versandrechner */
.basket .shipping-calculator-form { margin-top: 28px; padding: 22px; border-radius: var(--fg-radius-lg); border: 1px solid var(--fg-line); background: var(--fg-surface); }
.basket .shipping-calculator-main-heading { font-family: var(--fg-display); font-size: 1.05rem !important; margin-bottom: 14px; color: var(--fg-text); }
/* Felder und Button auf einer Linie: NOVA-Form-Groups haben 16 px Abstand unten, der Button nicht */
.basket .shipping-calculator-form .form-row { align-items: center; row-gap: 10px; margin: 0 -6px; }
.basket .shipping-calculator-form .form-row > [class*="col"] { padding: 0 6px; }
.basket .shipping-calculator-form .form-group { margin-bottom: 0; }
.basket .shipping-calculator-form .form-control, .basket .shipping-calculator-form .btn { height: 46px; min-height: 46px; }
.basket .shipping-calculator-form .btn { display: inline-flex; align-items: center; justify-content: center; padding-top: 0; padding-bottom: 0; }
.basket .estimated-shipping, .basket .shipping-calculator-results { color: var(--fg-text-2); }

/* Cross-Selling */
.fg-cart-xsell { margin-top: clamp(40px, 5vw, 72px); }
.fg-card-compact .fg-card-media { aspect-ratio: 16 / 10; }
.fg-card-compact .fg-card-specs { -webkit-line-clamp: 1; }
.fg-card-compact .fg-card-stock { display: none; }

/* Zusammenfassung */
.basket .cart-summary { top: calc(var(--fg-header-h) + 20px) !important; z-index: 2; display: flex; flex-direction: column; gap: 12px; }
html.fg-header-hidden .basket .cart-summary { top: 20px !important; }
.fg-summary-title { font-family: var(--fg-display); font-size: 1.4rem !important; margin: 0 0 4px; padding: 0; }
.basket .cart-summary .card { border-radius: var(--fg-radius-lg) !important; background: var(--fg-surface) !important; overflow: hidden; }
/* Kopfzeile mit reinem Hinweistext („kein verfügbarer Coupon“) braucht Innenabstand; mit Aufklapp-Button polstert der Button */
.basket .cart-summary .card-header { padding: 16px 20px; border: 0; background: transparent; color: var(--fg-muted); font-size: .88rem; line-height: 1.5; }
.basket .cart-summary .card-header:has(> .btn) { padding: 0; }
.basket .cart-summary .card-header .btn {
    display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 56px; padding: 0 20px !important;
    color: var(--fg-text) !important; font-weight: 500; font-size: .95rem !important; text-decoration: none !important;
}
.basket .cart-summary .card-header .btn::before {
    content: ""; width: 20px; height: 20px; margin-right: 12px; background: var(--fg-lime);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z'/%3E%3Ccircle cx='7.5' cy='7.5' r='.6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z'/%3E%3Ccircle cx='7.5' cy='7.5' r='.6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.basket .cart-summary .card-header .btn::after {
    content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 1.5px solid var(--fg-muted); border-bottom: 1.5px solid var(--fg-muted);
    transform: rotate(45deg) translateY(-3px); transition: transform .4s var(--fg-ease);
}
.basket .cart-summary .card-header .btn[aria-expanded="true"]::after { transform: rotate(-135deg); }
.basket .cart-summary .card-body { padding: 20px; }
.basket .basket-summary .card-body { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.basket .basket-summary .row { margin: 0; align-items: baseline; }
.basket .basket-summary .row > [class*="col"] { padding: 0; }
.basket .basket-summary .price_label { color: var(--fg-text-2); }
.basket .basket-summary-total { padding-top: 12px; border-top: 1px solid var(--fg-line); }
.basket .basket-summary .card-body > .basket-summary-total:first-child { padding-top: 0; border-top: 0; }
.basket .basket-summary-total .price_label { font-family: var(--fg-display); font-weight: 700; font-size: 1.25rem; color: var(--fg-text); }
.basket .total-sum { font-family: var(--fg-display); font-weight: 700; font-size: 1.7rem; color: var(--fg-text); letter-spacing: -0.02em; }
.basket .shipping-costs small, .basket .basket-summary small { color: var(--fg-muted); font-size: .82rem; }
.basket .shipping-costs a { color: var(--fg-text-2); text-decoration: underline; text-underline-offset: 3px; }
.basket #cart-checkout-btn { margin-top: 6px; min-height: 58px; font-size: 1.05rem; font-weight: 700; }
.fg-secure-note { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--fg-muted); font-size: .8rem; }
.fg-secure-note .fg-icon { width: 15px; height: 15px; color: var(--fg-lime); }
.basket .cart-summary .font-weight-bold { color: var(--fg-text); font-weight: 600 !important; }
.basket .cart-summary .fa-truck { color: var(--fg-lime) !important; }
.basket .cart-summary .progress { background: var(--fg-surface-4); height: 6px; border-radius: 6px; }
.basket .cart-summary .progress-bar { background: var(--fg-lime); box-shadow: 0 0 12px var(--fg-lime-glow); }

/* Leerer Warenkorb */
.fg-cart-empty {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px;
    padding: clamp(40px, 6vw, 96px) 20px; border-radius: var(--fg-radius-lg); border: 1px dashed var(--fg-line-strong);
    background: radial-gradient(500px 240px at 50% 0%, rgba(198,244,50,.07), transparent 70%), var(--fg-surface);
}
.fg-cart-empty-icon { width: 84px; height: 84px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--fg-line-strong); color: var(--fg-lime); }
.fg-cart-empty-icon .fg-icon { width: 38px; height: 38px; }
.fg-cart-empty .fg-lead { margin: 0 auto; }
.fg-cart-empty-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }
.fg-cart-cta { margin-top: clamp(40px, 5vw, 72px); }

/* Warenkorb-Dropdown im Header */
.cart-dropdown { color: var(--fg-text-2); }
.cart-dropdown .dropdown-body, .cart-dropdown-total { background: transparent; }
.cart-dropdown .table td { border-color: var(--fg-line) !important; }
.cart-dropdown .btn-primary { width: 100%; }
.cart-dropdown-buttons .btn { flex: 1; }

@media (max-width: 991.98px) {
    .basket > .row { flex-wrap: wrap; }
    .basket > .row > .col-lg-4 { flex: 1 1 100%; }
    .basket .cart-summary { position: static !important; }
}
@media (max-width: 767.98px) {
    .basket .cart-items-body { grid-template-columns: 92px minmax(0, 1fr); padding: 12px; }
    .basket .cart-items-body.type-1 > .col > .row { grid-template-columns: minmax(0, 1fr) auto; }
    .basket .type-1 > .col > .row > :nth-child(1) { grid-column: 1 / -1; }
    .basket .type-1 > .col > .row > :nth-child(5) { grid-column: 1 / -1; grid-row: 2; }
    .basket .type-1 > .col > .row > :nth-child(3) { grid-column: 1; grid-row: 4; }
    .basket .type-1 > .col > .row > :nth-child(4) { grid-column: 2; grid-row: 4; align-self: center; }
    .basket .type-1 > .col > .row > :nth-child(2) { grid-row: 3; grid-column: 1 / -1; }
    .basket .type-1 > .col > .row > :nth-child(6) { grid-column: 1 / -1; grid-row: 5; justify-content: flex-start; }
    .basket .shortdescription { display: none; }
}
.basket .shortdescription li:nth-child(n+4) { display: none; }
.basket .shortdescription li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fg-cart-continue { width: max-content; }

/* ---------- „In den Warenkorb gelegt“: Panel oben rechts (productdetails/pushed_success.tpl, js/forge.js) ---------- */
#pushed-success.fg-added, .fg-added {
    position: fixed; top: calc(var(--fg-header-h) + 12px); right: clamp(12px, 2vw, 24px); z-index: 1060;
    width: min(400px, calc(100vw - 24px)); padding: 16px; overflow: hidden;
    border: 1px solid var(--fg-line-strong); border-radius: var(--fg-radius-lg);
    background: rgba(17, 21, 21, .96); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .9), 0 0 0 1px rgba(198, 244, 50, .12);
    animation: fg-added-in .45s var(--fg-ease) both;
}
.fg-added.is-leaving { animation: fg-added-out .3s var(--fg-ease) forwards; }
@keyframes fg-added-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
@keyframes fg-added-out { to { opacity: 0; transform: translateY(-8px) scale(.98); } }
.fg-added-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.fg-added-check {
    display: inline-flex; flex: none; width: 26px; height: 26px; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--fg-lime); color: var(--fg-lime-ink);
}
.fg-added-check .fg-icon { width: 15px; height: 15px; }
.fg-added-title { color: var(--fg-text); font-size: .95rem; font-weight: 600; }
.fg-added-close {
    display: inline-flex; width: 32px; height: 32px; margin-left: auto; align-items: center; justify-content: center;
    border: 0; border-radius: 8px; background: transparent; color: var(--fg-muted); cursor: pointer;
}
.fg-added-close:hover { background: var(--fg-surface-3); color: var(--fg-text); }
.fg-added-close .fg-icon { width: 18px; height: 18px; }
.fg-added-item {
    display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center;
    padding: 10px; border-radius: var(--fg-radius); background: var(--fg-surface-2);
}
.fg-added-img { display: flex; width: 72px; height: 60px; align-items: center; justify-content: center; }
.fg-added-img img { max-width: 100%; max-height: 100%; object-fit: contain; filter: url(#fg-knockout); }
.fg-added-info { min-width: 0; }
.fg-added-name {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    color: var(--fg-text); font-weight: 600; font-size: .9rem; line-height: 1.3;
}
.fg-added-meta { display: block; margin-top: 2px; color: var(--fg-muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.fg-added-sum {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 12px 2px;
    color: var(--fg-muted); font-size: .86rem;
}
.fg-added-sum strong { color: var(--fg-text); font-size: 1rem; font-variant-numeric: tabular-nums; }
.fg-added-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fg-added-actions .fg-btn { min-height: 44px; padding: 0 12px; font-size: .88rem; }
.fg-added-actions .fg-icon { width: 17px; height: 17px; }
.fg-added-timer {
    position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: var(--fg-lime);
    transform-origin: left; animation: fg-added-timer 10s linear forwards;
}
.fg-added:hover .fg-added-timer, .fg-added:focus-within .fg-added-timer { animation-play-state: paused; }
@keyframes fg-added-timer { to { transform: scaleX(0); } }
/* Fallback, falls NOVA den Inhalt doch im Modal zeigt */
.modal .fg-added { position: static; width: auto; animation: none; border: 0; box-shadow: none; background: transparent; padding: 0; }
.modal .fg-added-timer, .modal .fg-added-close { display: none; }
@media (max-width: 575.98px) {
    .fg-added { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .fg-added, .fg-added.is-leaving { animation: none; }
    .fg-added-timer { display: none; }
}
