/**
 * Upsell-Bundle Frontend Styles
 * Version 1.3.0
 */

/* Box Container */
.upsell-bundle-box {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 20px;
    margin: 25px 0;
    background: #fff;
}

/* Box Titel */
.upsell-bundle-box__title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

/* Micro-Copy */
.upsell-bundle-box__microcopy {
    font-size: 13px;
    color: #666;
    margin: -10px 0 15px 0;
    padding: 0 0 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

/* Titel ohne Border wenn Micro-Copy folgt */
.upsell-bundle-box__title + .upsell-bundle-box__microcopy {
    margin-top: 0;
}

.upsell-bundle-box__title:has(+ .upsell-bundle-box__microcopy) {
    border-bottom: none;
    margin-bottom: 5px;
    padding-bottom: 0;
}

/* Produkte Container */
.upsell-bundle-box__products {
    display: flex;
    flex-direction: column;
}

/* Einzelnes Produkt */
.upsell-bundle-box__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.upsell-bundle-box__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Warenkorb Button */
.upsell-bundle-box__cart-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    margin-left: auto;
    align-self: center;
}

.upsell-bundle-box__cart-btn:hover {
    background-color: #f5f5f5;
}

.upsell-bundle-box__cart-btn svg {
    width: 24px;
    height: 24px;
    fill: #666;
    transition: fill 0.2s ease;
}

.upsell-bundle-box__cart-btn:hover svg {
    fill: #333;
}

/* Icon States */
.upsell-bundle-box__icon-add,
.upsell-bundle-box__icon-added,
.upsell-bundle-box__spinner {
    display: none;
}

.upsell-bundle-box__icon-add {
    display: block;
}

/* Im Warenkorb Status */
.upsell-bundle-box__item.is-in-cart .upsell-bundle-box__icon-add {
    display: none;
}

.upsell-bundle-box__item.is-in-cart .upsell-bundle-box__icon-added {
    display: block;
}

.upsell-bundle-box__item.is-in-cart .upsell-bundle-box__cart-btn {
    cursor: default;
}

.upsell-bundle-box__item.is-in-cart .upsell-bundle-box__cart-btn svg {
    fill: #2e7d32;
}

.upsell-bundle-box__item.is-in-cart .upsell-bundle-box__cart-btn:hover {
    background-color: transparent;
}

/* Ladezustand */
.upsell-bundle-box__item.is-loading .upsell-bundle-box__icon-add,
.upsell-bundle-box__item.is-loading .upsell-bundle-box__icon-added {
    display: none;
}

.upsell-bundle-box__item.is-loading .upsell-bundle-box__spinner {
    display: block;
}

.upsell-bundle-box__item.is-loading .upsell-bundle-box__cart-btn {
    cursor: wait;
}

/* Spinner */
.upsell-bundle-box__spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #666;
    border-radius: 50%;
    animation: upsell-bundle-spin 0.8s linear infinite;
}

@keyframes upsell-bundle-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Produktbild */
.upsell-bundle-box__image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.upsell-bundle-box__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Produkt Info */
.upsell-bundle-box__info {
    flex: 1;
    min-width: 0;
}

/* Produktname */
.upsell-bundle-box__name {
    font-size: .9em;
    color: inherit;
    text-decoration: none !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
    line-height: 1.4;
}

.upsell-bundle-box__name:hover {
    text-decoration: none !important;
}

/* Preis */
.upsell-bundle-box__price {
    font-size: 15px;
    font-weight: 700;
    color: #2e7d32;
    display: block;
}

.upsell-bundle-box__price del {
    color: #999;
    font-weight: 400;
    font-size: 13px;
    margin-right: 6px;
}

.upsell-bundle-box__price ins {
    text-decoration: none;
    color: #e53935;
    font-weight: 700;
}

/* Germanized Preisangaben */
.upsell-bundle-box__gzd-info {
    display: block;
    font-size: 11px;
    color: #666;
    line-height: 1.3;
    margin-top: 2px;
}

.upsell-bundle-box__gzd-info a {
    color: #666;
    text-decoration: underline;
}

.upsell-bundle-box__gzd-info a:hover {
    color: #333;
}

/* ==================== */
/* Mobile Styles        */
/* ==================== */

@media screen and (max-width: 480px) {
    .upsell-bundle-box {
        padding: 15px;
        margin: 20px 0;
    }

    .upsell-bundle-box__title {
        font-size: 15px;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .upsell-bundle-box__item {
        gap: 10px;
        padding: 10px 0;
    }

    .upsell-bundle-box__cart-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        padding: 6px;
    }

    .upsell-bundle-box__cart-btn svg {
        width: 22px;
        height: 22px;
    }

    .upsell-bundle-box__image {
        width: 50px;
        height: 50px;
    }

    .upsell-bundle-box__name {
        font-size: .85em;
    }

    .upsell-bundle-box__price {
        font-size: 14px;
    }

    .upsell-bundle-box__price del {
        font-size: 12px;
    }
}

/* Sehr kleine Bildschirme */
@media screen and (max-width: 320px) {
    .upsell-bundle-box__image {
        width: 45px;
        height: 45px;
    }

    .upsell-bundle-box__cart-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .upsell-bundle-box__cart-btn svg {
        width: 20px;
        height: 20px;
    }
}
