/* =========================================================
   MentorMe — Warenkorb
   ========================================================= */

.woocommerce-notices-wrapper {

    .woocommerce-message,
    .woocommerce-info,
    .woocommerce-error:has( .mm-already-in-cart ) {
        display: flex;
        align-items: flex-start;
        gap: 12px;

        margin: 0 0 18px !important;
        padding: 14px 18px !important;

        border: 0 !important;
        border-radius: 6px;
        background: var(--coupon-success-bg) !important;

        color: var(--checkout-green) !important;
        font-size: 14px !important;
        font-weight: 600;
        line-height: 1.4;

        &::before {
            display: none !important;
        }
    }

    .woocommerce-message::after,
    .woocommerce-info::after,
    .woocommerce-error:has( .mm-already-in-cart )::after {
        content: "";
        flex: 0 0 auto;
        order: -1;

        width: 20px;
        height: 20px;

        background: url("../../icons/check.svg") center / contain no-repeat;
    }

    .woocommerce-error:has( .mm-already-in-cart ) li {
        flex: 1 1 auto;
    }

    .mm-cart-already-in-cart-hint {
        display: block;
        margin-top: 2px;

        font-size: 12px;
        font-weight: 400;
    }
}

body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-error .button.wc-forward {
    display: none;
}

body.single-product .woocommerce-notices-wrapper .woocommerce-error:has( .mm-already-in-cart )::after {
    display: none;
}

/* Dauerhafter Banner (siehe mm_cart_permanent_banner() in functions.php) —
   läuft unabhängig von der WooCommerce-Meldungs-Session, bleibt also auch
   nach Gutschein-Aktionen oder einem abgelehnten Doppel-Hinzufügen stehen.
   Optik entspricht bewusst den transienten Meldungen oben. */
body.woocommerce-cart .mm-cart-permanent-banner {
    display: flex;
    align-items: center;
    gap: 12px;

    margin: 0 0 18px;
    padding: 14px 18px;

    border-radius: 6px;
    background: var(--coupon-success-bg);

    color: var(--checkout-green);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;

    &::before {
        content: "";
        flex: 0 0 auto;
        order: -1;

        width: 20px;
        height: 20px;

        background: url("../../icons/check.svg") center / contain no-repeat;
    }
}

body.woocommerce-cart {

.mm-cart-coupon {

    &:empty {
        display: none;
    }

    .mm-cart-coupon__notice:empty {
        display: none;
    }

    .woocommerce-message,
    .woocommerce-info {
        display: flex;
        align-items: center;
        gap: 10px;

        margin: 0 0 12px !important;
        padding: 0 !important;

        border: 0 !important;
        background: transparent !important;

        color: var(--checkout-green) !important;
        font-size: 14px !important;
        font-weight: 600;
        line-height: 1.4;

        &::before {
            display: none !important;
        }
    }

    .woocommerce-message::after,
    .woocommerce-info::after {
        content: "";
        flex: 0 0 auto;
        order: -1;

        width: 18px;
        height: 18px;

        background: url("../../icons/check.svg") center / contain no-repeat;
    }

    .mm-cart-coupon__applied {
        display: flex;
        align-items: center;

        margin-bottom: 12px;
    }

    .mm-cart-coupon__icon {
        flex: 0 0 auto;

        width: 18px;
        height: 18px;
        margin-right: 10px;

        visibility: hidden;
    }

    .mm-cart-coupon__applied-inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        row-gap: 8px;
        column-gap: 10px;
    }

    .mm-cart-coupon__text {
        font-size: 14px;
        font-weight: 400;
        line-height: 1.4;
    }

    .mm-cart-coupon__code-row {
        display: flex;
        align-items: center;
        gap: 10px;

        strong {
            display: inline-block;
            padding: 6px 12px;

            border-radius: 6px;
            background: var(--coupon-success-bg);

            color: var(--checkout-green);
            font-weight: 600;
        }
    }

    .mm-cart-coupon__remove {
        color: var(--checkout-button);
        font-size: 14px;
        font-weight: 400;
        text-decoration: none;

        &::before {
            content: "|";
            margin-right: 10px;

            color: var(--checkout-text-grey);
            font-weight: 400;
        }

        &:hover {
            text-decoration: underline;
        }
    }
}

    /* Fast geschafft Meldung ausblenden, wenn Warenkorb leer ist */
    .et_pb_column:has(.mm-cart-permanent-banner):not(:has(.et_pb_wc_cart_products .cart_item)) .mm-cart-permanent-banner {
        display: none !important;
    }

}   /* Ende body.woocommerce-cart */
