.wcwn {
    --wcwn-bg: #f3f4f6;
    --wcwn-border: #e5e7eb;
    --wcwn-title: #111111;
    --wcwn-text: #5b5f66;
    --wcwn-btn-bg: #111111;
    --wcwn-btn-bg-hover: #333333;
    --wcwn-btn-color: #ffffff;

    container-type: inline-size;
    max-width: 100%;
    margin-top: 30px;
    clear: both;
}

.wcwn,
.wcwn *,
.wcwn *::before,
.wcwn *::after {
    box-sizing: border-box;
}

.wcwn[data-wcwn-mode="classic"] {
    margin-top: 0;
    margin-bottom: 30px;
}

.wcwn[data-wcwn-mode="block"] {
    margin-bottom: 30px;
}

/* Woodmart cart template without layout builder: table full width, notice left of totals. */
@media (min-width: 1025px) {
    .cart-content-wrapper > .woocommerce-cart-form {
        flex: 1 1 100%;
    }

    .cart-content-wrapper > .wcwn {
        flex: 1 1 0;
        margin-bottom: 0;
    }

    .cart-content-wrapper > .wcwn ~ .cart_totals {
        flex: 0.7 0 0;
    }
}

/* Default WooCommerce template: totals float right at 48%. */
@media (min-width: 769px) {
    .cart-collaterals > .wcwn {
        float: left;
        width: 48%;
    }
}

.wcwn[hidden] {
    display: none !important;
}

.wcwn__box {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 28px;
    background: var(--wcwn-bg);
    border: 1px solid var(--wcwn-border);
    border-radius: 10px;
}

.wcwn__media {
    display: block;
    flex: 0 0 38%;
    align-self: flex-start;
    max-width: 300px;
    line-height: 0;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.wcwn .wcwn__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 295 / 350;
    object-fit: cover;
    object-position: top center;
}

.wcwn__content {
    flex: 1 1 auto;
    min-width: 0;
}

.wcwn .wcwn__title {
    margin: 0 0 16px;
    font-size: 32px;
    line-height: 1.15;
    font-weight: 700;
    color: var(--wcwn-title);
    text-transform: none;
}

.wcwn .wcwn__text {
    margin: 0 0 14px;
    font-size: 16px;
    line-height: 1.55;
    color: var(--wcwn-text);
}

.wcwn .wcwn__text:last-of-type {
    margin-bottom: 24px;
}

.wcwn .wcwn__button,
.wcwn .wcwn__button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 15px 24px;
    background: var(--wcwn-btn-bg);
    color: var(--wcwn-btn-color);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    text-transform: none;
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.wcwn .wcwn__button:hover,
.wcwn .wcwn__button:focus-visible {
    background: var(--wcwn-btn-bg-hover);
    color: var(--wcwn-btn-color);
}

.wcwn .wcwn__button:focus-visible {
    outline: 2px solid var(--wcwn-btn-bg);
    outline-offset: 3px;
}

.wcwn__arrow {
    flex: 0 0 auto;
    transition: transform 0.2s ease;
}

.wcwn__button:hover .wcwn__arrow {
    transform: translateX(3px);
}

/* Narrow column (e.g. cart form next to totals on tablets / small desktops). */
@container (max-width: 640px) {
    .wcwn__box {
        gap: 24px;
        padding: 22px;
    }

    .wcwn .wcwn__title {
        font-size: 24px;
    }

    .wcwn .wcwn__text {
        font-size: 15px;
    }
}

/* Stacked layout: image on top, full-width button. */
@container (max-width: 520px) {
    .wcwn__box {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        padding: 20px;
    }

    .wcwn__media {
        flex: none;
        width: 100%;
        max-width: none;
    }

    .wcwn .wcwn__title {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .wcwn .wcwn__button {
        display: flex;
        width: 100%;
        padding: 14px 18px;
        text-align: left;
    }
}

/* Fallback for browsers without container queries. */
@supports not (container-type: inline-size) {
    @media (max-width: 768.98px) {
        .wcwn__box {
            flex-direction: column;
            align-items: stretch;
            gap: 20px;
            padding: 20px;
        }

        .wcwn__media {
            flex: none;
            width: 100%;
            max-width: none;
        }

        .wcwn .wcwn__title {
            font-size: 22px;
        }

        .wcwn .wcwn__button {
            display: flex;
            width: 100%;
        }
    }
}
