/* ==========================================
   JADA B2B - UPSELL PURCHASE
   Samme design som vores variantvisning
   ========================================== */

/* Købsområde */
.jada-upsell-purchase {
    width: 100%;
    min-width: 0;
}

/* ==========================================
   KØBEKNAP - LÆG I KURV +
   ========================================== */

.jada-upsell-purchase .jada-upsell-buy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;
    min-height: 40px;
    padding: 10px 18px;

    background: #756E60;
    color: #ffffff;

    border: none;
    border-radius: 5px;

    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;

    cursor: pointer;
    transition: background 0.2s ease;
}

.jada-upsell-purchase .jada-upsell-buy-button:hover {
    background: #686356;
}

/* ==========================================
   I KURVEN + ANTALVÆLGER
   ========================================== */

.jada-upsell-purchase .jada-upsell-quantity {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 15px;

    width: 100%;
    min-width: 0;
}

/* Status: I kurven */
.jada-upsell-purchase .jada-upsell-in-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 6px;
    white-space: nowrap;
}

/* Grøn cirkel */
.jada-upsell-purchase .jada-upsell-in-cart-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;
    flex: 0 0 18px;

    background: #5f7f63;
    border-radius: 50%;

    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

/* Tekst: I kurven */
.jada-upsell-purchase .jada-upsell-in-cart > span:last-child {
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: #4f6f57;
}

/* Antalvælger */
.jada-upsell-purchase .item-quantity-group {
    display: flex;
    align-items: center;
    justify-content: center;

    width: auto;
    max-width: 100%;
    min-width: 0;
    margin: 0;
}

/* ==========================================
   HIDDEN - VIGTIGT
   ========================================== */

.jada-upsell-purchase .jada-upsell-buy-button[hidden],
.jada-upsell-purchase .jada-upsell-quantity[hidden] {
    display: none !important;
}

/* ==========================================
   TABLET
   ========================================== */

@media (min-width: 768px) and (max-width: 1124px) {

    .jada-upsell-purchase .jada-upsell-buy-button {
        min-height: 44px;
        padding: 10px 14px;
    }

    .jada-upsell-purchase .jada-upsell-quantity {
        gap: 10px;
    }
}
/* ==========================================
   JADA B2B - UPSELL RESPONSIVE LAYOUT
   ========================================== */

/* Fælles opsætning */
.upsell-products .jada-upsell-item {
    box-sizing: border-box;
}

.upsell-products .jada-upsell-product-name,
.upsell-products .jada-upsell-product-price,
.upsell-products .jada-upsell-purchase {
    min-width: 0;
}

.upsell-products .jada-upsell-product-name p {
    margin: 0;
    overflow-wrap: break-word;
}

/* Skjulte elementer må aldrig optage plads */
.upsell-products .jada-upsell-buy-button[hidden],
.upsell-products .jada-upsell-quantity[hidden] {
    display: none !important;
}


/* ==========================================
   DESKTOP OG TABLET
   Køb | Produktnavn | Pris
   ========================================== */

@media (min-width: 768px) {

    .upsell-products .jada-upsell-item {
        display: grid;
        grid-template-columns: 190px minmax(0, 1fr) 90px;
        align-items: center;
        column-gap: 12px;
        width: 100%;
    }

    /* Købsområdet i første kolonne */
    .upsell-products .jada-upsell-purchase {
        grid-column: 1;
        grid-row: 1;

        display: flex;
        align-items: center;

        width: 100%;
        max-width: none;
        margin: 0;
    }

    /* Produktnavn i anden kolonne */
    .upsell-products .jada-upsell-product-name {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
    }

    /* Pris i tredje kolonne */
    .upsell-products .jada-upsell-product-price {
        grid-column: 3;
        grid-row: 1;

        width: 100%;
        justify-self: end;
        text-align: right;
    }

    /* Alle købsknapper fylder samme bredde */
    .upsell-products .jada-upsell-buy-button {
        width: 100%;
        max-width: 100%;
        min-height: 40px;
        box-sizing: border-box;
    }

    /* I kurven og antalvælger bruger samme område */
    .upsell-products .jada-upsell-quantity {
        width: 100%;
        max-width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
    }
}


/* ==========================================
   JADA B2B - UPSELL MOBIL
   Navn -> Pris -> Køb
   ========================================== */

@media (max-width: 767px) {

    .upsell-products .upsell-product.jada-upsell-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }

    /* 1. Produktnavn */
    .upsell-products .jada-upsell-item > .jada-upsell-product-name {
        order: 1 !important;
        width: 100%;
        min-width: 0;
    }

    /* 2. Pris */
    .upsell-products .jada-upsell-item > .jada-upsell-product-price {
        order: 2 !important;
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin: 0;
        text-align: left;
    }

    /* 3. Købsområde - ALTID SIDST */
    .upsell-products .jada-upsell-item > form.jada-upsell-purchase {
        order: 3 !important;
        display: flex;
        align-items: center;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
    }

    /* Købeknap i fuld bredde */
    .upsell-products .jada-upsell-buy-button {
        width: 100%;
        max-width: 100%;
        min-height: 44px;
        box-sizing: border-box;
    }

    /* I kurven + antalvælger */
    .upsell-products .jada-upsell-quantity {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        width: 100%;
        min-width: 0;
    }
}
/* ==========================================
   JADA B2B - MOBIL FIX
   Købsområdet skal være sit eget element
   ========================================== */

@media (max-width: 767px) {

    .upsell-products .jada-upsell-item > form.jada-upsell-purchase {
        display: flex !important;
        flex-direction: row;
        align-items: center;

        order: 3 !important;

        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
    }

}
/* ==========================================
   JADA B2B - MOBIL RABATMÆRKE
   ========================================== */

@media (max-width: 767px) {

    .upsell-products .jada-upsell-product-price .sale-badge {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;

        width: fit-content !important;
        min-width: 55px;
        max-width: max-content;

        padding: 2px 10px;
        box-sizing: border-box;
        flex: 0 0 auto;
    }

    .upsell-products .jada-upsell-product-price .sale-badge-text {
        width: auto;
        white-space: nowrap;
    }

}
/* JADA B2B - Sikr korrekt upsell-layout på desktop og tablet */
@media (min-width: 768px) {

    .upsell-products .upsell-product.jada-upsell-item {
        display: grid !important;
    }

}
