/* =========================================
   SIDECART - Seitlicher Warenkorb
   JTL NOVAChild Theme
   ========================================= */

/* === Modal als Sidebar positionieren === */
#cartModal {
    background-color: rgba(0, 0, 0, 0.45);
}

/* === Erfolgs-Banner === */
.sidecart-success-banner {
    background-color: #d4edda;
    color: #155724;
    border-bottom: 1px solid #c3e6cb;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.modal-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    right: -450px;
    margin: 0 0 0 auto;
    height: 100%;
    width: 100%;
    max-width: 420px;
    transition: right 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal.show .modal-sidebar {
    right: 0;
}

.modal-sidebar .modal-content {
    height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.modal-sidebar .modal-body {
    overflow-y: auto;
    flex-grow: 1;
}

/* === Header === */
.sidecart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin: 0;
}

.sidecart-close-btn {
    background: #e9ecef;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    line-height: 1;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: background-color 0.2s, color 0.2s;
    position: static;
    transform: none;
}

.sidecart-close-btn:hover {
    background-color: var(--primary, #007bff);
    color: #fff;
}

/* === Versandkostenfrei Fortschrittsbalken === */
.sidecart-shipping-bar {
    padding: 1rem 1.5rem;
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.sidecart-shipping-text {
    font-size: 0.875rem;
    color: #555;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.sidecart-shipping-text i {
    margin-right: 0.35rem;
}

.sidecart-shipping-text.text-success {
    color: #28a745 !important;
}

.sidecart-progress {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.sidecart-progress-bar {
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

.sidecart-progress-bar--pending {
    background-color: #333 !important;
}

/* === Artikelliste === */
.sidecart-items-wrapper {
    padding: 1.25rem 1.5rem;
    flex-grow: 1;
    overflow-y: auto;
    position: relative;
}

.sidecart-items-wrapper.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* === Einzelner Artikel === */
.sidecart-item {
    display: flex;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.sidecart-item:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidecart-item-img {
    width: 70px;
    height: 70px;
    min-width: 70px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 1rem;
}

.sidecart-item-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.sidecart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.sidecart-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    display: block;
    text-decoration: none;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sidecart-item-title:hover {
    color: var(--primary, #007bff);
    text-decoration: none;
}

.sidecart-item-price {
    font-weight: 700;
    font-size: 0.95rem;
    color: #333;
    display: block;
    margin-bottom: 0.5rem;
}

/* === Mengensteuerung & Aktionen === */
.sidecart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.sidecart-qty-wrapper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    height: 32px;
}

.sidecart-qty-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 100%;
    cursor: pointer;
    color: #333;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    padding: 0;
    line-height: 1;
}

.sidecart-qty-btn:hover {
    background-color: #f2f2f2;
}

.sidecart-qty-input {
    width: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-size: 0.9rem;
    font-weight: 600;
    background: transparent;
    pointer-events: none;
    outline: none;
    padding: 0;
    height: 100%;
}

.sidecart-remove-btn {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 1rem;
    transition: background-color 0.2s, color 0.2s;
    line-height: 1;
}

.sidecart-remove-btn:hover {
    background-color: #dc3545;
    color: #fff;
}

/* === Zwischensumme === */
.sidecart-totals {
    margin-top: 1rem;
    background: #f8f9fa;
    padding: 1rem 1.25rem;
    border-radius: 8px;
}

.sidecart-totals-tax {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.35rem;
}

.sidecart-totals-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.05rem;
    color: #333;
}

.sidecart-totals-shipping {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.sidecart-totals-shipping a {
    color: #333;
    text-decoration: underline;
}

/* === Leerer Warenkorb === */
.sidecart-empty {
    text-align: center;
    color: #6c757d;
    margin-top: 4rem;
}

.sidecart-empty i {
    opacity: 0.4;
}

/* === Footer === */
.sidecart-footer {
    padding: 1.25rem 1.5rem;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
    margin: 0;
    display: block;
    flex-shrink: 0;
}

.sidecart-footer .btn-primary {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* === Toast-Benachrichtigung (Artikel hinzugefuegt) === */
.sidecart-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    align-items: center;
    background: #1a5c4b;
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    overflow: hidden;
    max-width: 420px;
    animation: sidecartToastIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sidecart-toast-icon {
    background: rgba(255,255,255,0.12);
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    align-self: stretch;
}

.sidecart-toast-text {
    padding: 0.85rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: 500;
}

@keyframes sidecartToastIn {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@media (max-width: 576px) {
    .sidecart-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* === JTL Standard Mini-Warenkorb verstecken === */
body #cart-dropdown-container {
    display: none !important;
}

/* === Mobile Anpassungen === */
@media (max-width: 576px) {
    .modal-sidebar {
        max-width: 100%;
        right: -100%;
    }

    .sidecart-item-img {
        width: 60px;
        height: 60px;
        min-width: 60px;
    }

    .sidecart-header,
    .sidecart-shipping-bar,
    .sidecart-items-wrapper,
    .sidecart-footer,
    .sidecart-success-banner {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
