/* Warenkorb-Styling */
.cart-icon-container {
    position: fixed;
    bottom: 120px;
    right: 50px;
    z-index: 1000;
}

.cart-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #cc071e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.cart-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #343a40;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.cart-count.has-items {
    background-color: #28a745;
}

/* Warenkorb-Benachrichtigung */
.cart-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #343a40;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.cart-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Modal-Styling für Warenkorb */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #e0e0e0;
    width: 90%;
    max-width: 1000px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 0;
    background-color: #ffffff;
}

.modal-body {
    flex: 1;
    overflow: auto;
    padding: 0;
    /*background-color: #ffffff;*/
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333333;
}

.close {
    /*color: #cc071e;*/
    /*font-size: 28px;*/
    /*font-weight: bold;*/
    cursor: pointer;
    /*background: none;*/
    /*border: none;*/
    /*padding: 0;*/
    /*line-height: 1;*/
    /*transition: color 0.2s ease;*/
}

.close:hover,
.close:focus {
    color: #a00618;
    /*text-decoration: none;*/
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
    margin-top: 0;
    display: flex;
    justify-content: flex-end;
    background-color: #ffffff;
}

/* Neues Warenkorb-Layout */
.cart-container {
    display: flex;
    height: 60vh;
    min-height: 400px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background-color: #ffffff;
}

.cart-sidebar {
    width: 300px;
    background-color: #f9f9f9;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.cart-list-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
}

.cart-list {
    flex: 1;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.cart-list-item {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.cart-list-item:hover {
    background-color: #f5f5f5;
}

.cart-list-item.active {
    background-color: #cc071e;
    color: white;
}

.cart-list-item.active .cart-list-item-info small {
    color: rgba(255, 255, 255, 0.9);
}

.cart-list-item-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-list-item-info {
    display: flex;
    justify-content: space-between;
}

.cart-list-item-info small {
    color: #666666;
    font-size: 0.75rem;
}

.cart-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: #ffffff;
}

.cart-detail {
    display: none;
    flex-direction: column;
    height: 100%;
    background-color: #ffffff;
}

.cart-detail.active {
    display: flex;
}

.cart-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
}

.cart-title h4 {
    margin-bottom: 5px;
    font-weight: 600;
    color: #333333;
}

.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #ffffff;
    max-height: calc(65vh - 150px); /* Maximale Höhe, um Scrollen zu ermöglichen */
    min-height: 200px; /* Minimale Höhe, damit der Container immer sichtbar ist */
    display: flex;
    flex-direction: column;
}

.cart-items {
    margin-bottom: 20px;
    flex: 1;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.cart-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.cart-item-details {
    display: flex;
    margin-bottom: 15px;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    margin-right: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #ffffff;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1rem;
    color: #333333;
}

.cart-item-price {
    color: #666666;
    font-size: 0.9rem;
}

.cart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quantity-control {
    display: flex;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
    color: #333333;
}

.quantity-btn.minus {
    border-bottom-left-radius: 8px;
    border-top-left-radius: 8px;
}

.quantity-btn.plus {
    border-bottom-right-radius: 8px;
    border-top-right-radius: 8px;
}

.quantity-btn:hover {
    background-color: #f0f0f0;
}

.quantity-input {
    width: 60px;
    height: 32px;
    border: 1px solid #e0e0e0;
    text-align: center;
    -moz-appearance: textfield;
    background-color: #ffffff;
    color: #333333;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-item-total {
    font-weight: 600;
    font-size: 1rem;
    color: #333333;
}

.remove-btn {
    padding: 0.25rem 0.5rem;
    color: #cc071e;
    border-color: #cc071e;
}

.remove-btn:hover {
    background-color: #cc071e;
    color: #ffffff;
}

.cart-summary {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    margin-top: auto;
    border: 1px solid #e0e0e0;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #333333;
}

.total-amount {
    font-weight: 700;
    color: #cc071e;
    font-size: 1.25rem;
}

.cart-checkout {
    display: flex;
    justify-content: flex-end;
}

.empty-cart,
.empty-carts-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 30px;
    background-color: #ffffff;
}

.empty-cart-icon,
.empty-carts-icon {
    color: #cccccc;
    margin-bottom: 20px;
}

.empty-cart h5,
.empty-carts-container h4 {
    margin-bottom: 10px;
    font-weight: 600;
    color: #333333;
}

.empty-cart p,
.empty-carts-container p {
    color: #666666;
    margin-bottom: 20px;
}

/* Warenkorb-Auswahldialog */
.cart-chooser {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #ffffff;
}

.selected-product {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.selected-product-header {
    background-color: #f9f9f9;
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.selected-product-header h6 {
    margin: 0;
    font-weight: 600;
    color: #333333;
}

.selected-product-content {
    display: flex;
    padding: 15px;
    background-color: #ffffff;
}

.selected-product-image {
    width: 80px;
    height: 80px;
    margin-right: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
}

.selected-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    color: #cccccc;
}

.selected-product-info {
    flex: 1;
}

.selected-product-name {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1rem;
    color: #333333;
}

.selected-product-price {
    color: #666666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.selected-product-quantity {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #333333;
}

.selected-product-total {
    font-weight: 600;
    color: #cc071e;
}

.cart-chooser-header {
    margin-top: 10px;
    padding: 5px 0;
}

.cart-chooser-header h6 {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333333;
}

.cart-chooser-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
}

.cart-chooser-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.2s ease;
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.cart-chooser-item:hover {
    background-color: #f9f9f9;
    border-color: #d0d0d0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.cart-chooser-item-info {
    flex: 1;
}

.cart-chooser-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333333;
}

.cart-chooser-item-details {
    display: flex;
    justify-content: space-between;
    color: #666666;
    font-size: 0.85rem;
}

.cart-item-count {
    background-color: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #666666;
}

.cart-select-button {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #cc071e;
    border-color: #cc071e;
    box-shadow: 0 2px 4px rgba(204, 7, 30, 0.2);
}

.cart-select-button:hover {
    background-color: #a00618;
    border-color: #a00618;
    box-shadow: 0 4px 8px rgba(204, 7, 30, 0.3);
}

.empty-carts-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 15px;
    background-color: #f9f9f9;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.empty-carts-icon {
    color: #cccccc;
    margin-bottom: 15px;
}

.empty-carts-message p {
    margin-bottom: 0;
    color: #666666;
}

.cart-chooser-footer {
    margin-top: 15px;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 95vh;
        padding: 15px;
    }

    .cart-icon-container {
        bottom: 90px;
        right: 15px;
    }

    .cart-container {
        flex-direction: column;
        height: auto;
        min-height: 0;
    }

    .cart-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .cart-list {
        max-height: 200px;
    }

    .cart-content {
        height: 400px;
    }

    .cart-items-container {
        max-height: 300px;
    }

    .cart-item-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cart-item-total {
        margin-left: auto;
    }

    .remove-btn {
        margin-left: auto;
    }

    .selected-product-content {
        flex-direction: column;
    }

    .selected-product-image {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
        height: 120px;
    }

    .cart-chooser-item {
        padding: 12px;
    }

    .cart-chooser-item-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .cart-item-count {
        display: inline-block;
        margin-top: 5px;
    }

    .modal-header, .modal-footer {
        padding: 10px 0;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 2% auto;
        padding: 10px;
    }

    .cart-item {
        padding: 10px;
    }

    .cart-item-details {
        flex-direction: column;
    }

    .cart-item-image {
        width: 100%;
        height: 150px;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .cart-item-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .quantity-control {
        margin-bottom: 10px;
    }

    .cart-summary {
        padding: 15px;
    }

    .cart-total {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .total-amount {
        align-self: flex-end;
    }
}
