:root {
    --te-cart-rail-width: 318px;
    --te-cart-rail-gap: 12px;
    --te-cart-rail-top: 198px;
    --te-cart-ink: #0e1a2b;
    --te-cart-copper: #b84f00;
    --te-cart-surface: #ffffff;
    --te-cart-muted: #667085;
    --te-cart-line: #dfe5ec;
}

/* Die feste Warenkorb-Leiste ersetzt die grosse JTL-Hinzufuegen-Bestaetigung. */
#pushed-success,
#result-wrapper > .container:has(> #pushed-success) {
    display: none !important;
}

#te-cart-rail {
    position: fixed;
    z-index: 1015;
    top: var(--te-cart-rail-top);
    right: var(--te-cart-rail-gap);
    width: var(--te-cart-rail-width);
    max-height: calc(100vh - var(--te-cart-rail-top) - 12px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    color: var(--te-cart-ink);
    background: var(--te-cart-surface);
    border: 1px solid var(--te-cart-line);
    border-radius: 16px;
    box-shadow: 0 16px 38px rgba(14, 26, 43, .16);
    font-size: 14px;
}

body.te-cart-rail-open #te-cart-rail { display: flex; }

body.te-cart-rail-open #main-wrapper,
body.te-cart-rail-open #footer {
    box-sizing: border-box;
    padding-right: calc(var(--te-cart-rail-width) + (var(--te-cart-rail-gap) * 2));
    transition: padding-right .2s ease;
}

.te-cart-rail__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 12px;
    background: var(--te-cart-ink);
    color: #fff;
}

.te-cart-rail__title {
    margin: 0;
    color: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.te-cart-rail__count {
    display: inline-flex;
    min-width: 25px;
    height: 25px;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: 999px;
    color: var(--te-cart-ink);
    background: #fff;
    font-weight: 700;
}

.te-cart-rail__items {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px 14px;
}

.te-cart-rail__item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 11px;
    padding: 12px 0;
    border-bottom: 1px solid var(--te-cart-line);
}

.te-cart-rail__image {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 9px;
    background: #f5f7f9;
}

.te-cart-rail__name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    color: var(--te-cart-ink);
    font-weight: 650;
    line-height: 1.3;
    text-decoration: none;
}

.te-cart-rail__name:hover,
.te-cart-rail__name:focus {
    color: var(--te-cart-copper);
    text-decoration: underline;
}

.te-cart-rail__meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-top: 7px;
    color: var(--te-cart-muted);
    font-size: 12px;
}

.te-cart-rail__price {
    color: var(--te-cart-ink);
    font-size: 14px;
    font-weight: 750;
}

.te-cart-rail__foot {
    padding: 13px 14px 14px;
    background: #f7f8fa;
}

.te-cart-rail__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-weight: 700;
}

.te-cart-rail__total strong {
    color: var(--te-cart-copper);
    font-size: 18px;
}

.te-cart-rail__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.te-cart-rail__actions .btn {
    margin: 0;
    padding: 9px 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

@media (max-width: 1199.98px) {
    :root { --te-cart-rail-width: 286px; }
}

@media (max-width: 991.98px) {
    #te-cart-rail {
        top: auto;
        right: 10px;
        bottom: 62px;
        left: 10px;
        width: auto;
        max-height: 42vh;
        border-radius: 14px;
    }

    body.te-cart-rail-open #main-wrapper,
    body.te-cart-rail-open #footer {
        padding-right: 0;
    }

    body.te-cart-rail-open { padding-bottom: 156px; }

    .te-cart-rail__head { padding: 9px 12px; }
    .te-cart-rail__items { display: none; }
    .te-cart-rail__foot { padding: 9px 12px 11px; }
    .te-cart-rail__total { margin-bottom: 7px; }
}

@media print {
    #te-cart-rail { display: none !important; }
    body.te-cart-rail-open #main-wrapper,
    body.te-cart-rail-open #footer { padding-right: 0 !important; }
}
