body.cbvp-modal-open {
    overflow: hidden;
}

.cbvp-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    font-family: inherit;
}

.cbvp-modal.is-open {
    display: block;
}

.cbvp-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 14, 22, 0.62);
    backdrop-filter: blur(3px);
}

.cbvp-modal__dialog {
    position: relative;
    width: min(760px, calc(100vw - 30px));
    max-height: min(86vh, 850px);
    margin: 7vh auto;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
    overflow: hidden;
    border: 1px solid rgba(23, 32, 42, 0.12);
}

.cbvp-modal__stripe {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 18px;
}

.cbvp-modal__stripe span:nth-child(1) { background: #000000; }
.cbvp-modal__stripe span:nth-child(2) { background: #ff0000; }
.cbvp-modal__stripe span:nth-child(3) { background: #188450; }
.cbvp-modal__stripe span:nth-child(4) { background: #ffcc00; }
.cbvp-modal__stripe span:nth-child(5) { background: #1800ad; }

.cbvp-modal__close {
    position: absolute;
    top: 28px;
    right: 24px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 2px solid rgba(23, 32, 42, 0.18);
    background: #ffffff;
    color: #17202a;
    font-size: 30px;
    line-height: 34px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.cbvp-modal__close:hover,
.cbvp-modal__close:focus {
    transform: translateY(-1px);
    border-color: #188450;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
    outline: none;
}

.cbvp-modal__content {
    max-height: calc(86vh - 18px);
    overflow-y: auto;
    padding: 34px;
}

.cbvp-modal__loading {
    padding: 28px;
    border-radius: 18px;
    background: #f4f7fa;
    color: #17202a;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.cbvp-modal__message {
    margin: 0 0 22px;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 700;
}

.cbvp-modal__message--success {
    background: rgba(24, 132, 80, 0.10);
    color: #0c5d37;
    border: 1px solid rgba(24, 132, 80, 0.25);
}

.cbvp-modal__message--error {
    background: rgba(255, 0, 0, 0.07);
    color: #9b0000;
    border: 1px solid rgba(255, 0, 0, 0.20);
}

.cbvp-product__header {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 24px;
    align-items: center;
    padding: 0 54px 28px 0;
    border-bottom: 1px solid #dde3ea;
    margin-bottom: 28px;
}

.cbvp-product__image {
    width: 150px;
    height: 150px;
    border-radius: 22px;
    background: #f5f7fa;
    border: 1px solid #e1e7ee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cbvp-product__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cbvp-product__title {
    margin: 0 0 10px;
    color: #17202a;
    font-size: clamp(24px, 3.4vw, 34px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.cbvp-product__price {
    margin: 0 0 12px;
    color: #188450;
    font-size: 20px;
    font-weight: 800;
}

.cbvp-product__hint {
    margin: 0;
    color: #526273;
    font-size: 16px;
    line-height: 1.5;
}

.cbvp-product form.cbvp-variation-form {
    margin: 0;
}

.cbvp-product table.cbvp-variations {
    width: 100%;
    margin: 0 0 24px;
    border-collapse: separate;
    border-spacing: 0 14px;
}

.cbvp-product table.cbvp-variations th,
.cbvp-product table.cbvp-variations td {
    display: block;
    width: 100%;
    padding: 0;
    text-align: left;
    border: 0;
    background: transparent;
}

.cbvp-product table.cbvp-variations label {
    display: block;
    margin: 0 0 8px;
    color: #17202a;
    font-size: 15px;
    font-weight: 800;
}

.cbvp-product table.cbvp-variations select {
    width: 100%;
    min-height: 54px;
    border: 2px solid #dde3ea;
    border-radius: 16px;
    background: #ffffff;
    color: #17202a;
    padding: 0 16px;
    font-size: 16px;
    font-weight: 650;
    box-shadow: 0 8px 18px rgba(23, 32, 42, 0.06);
}

.cbvp-product table.cbvp-variations select:focus {
    border-color: #188450;
    outline: 3px solid rgba(24, 132, 80, 0.16);
}

.cbvp-product .reset_variations {
    display: inline-block;
    margin-top: 10px;
    color: #1800ad;
    font-weight: 800;
    text-decoration: none;
}

.cbvp-product .woocommerce-variation {
    margin: 0 0 22px;
}

.cbvp-product .woocommerce-variation-price {
    color: #188450;
    font-size: 18px;
    font-weight: 800;
}

.cbvp-product .woocommerce-variation-availability {
    color: #526273;
    font-size: 15px;
    font-weight: 700;
}

.cbvp-product .single_variation_wrap {
    margin-top: 8px;
}

.cbvp-cart-row {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.cbvp-cart-row .quantity input.qty {
    width: 90px;
    min-height: 54px;
    border: 2px solid #dde3ea;
    border-radius: 16px;
    color: #17202a;
    font-size: 17px;
    font-weight: 800;
    text-align: center;
}

.cbvp-add-to-basket,
.woocommerce a.button.cbvp-open-options,
a.button.cbvp-open-options {
    min-height: 54px;
    border: 4px solid transparent !important;
    border-radius: 18px !important;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(90deg, #000000 0 20%, #ff0000 20% 40%, #188450 40% 60%, #ffcc00 60% 80%, #1800ad 80% 100%) border-box !important;
    color: #17202a !important;
    box-shadow: 0 12px 28px rgba(23, 32, 42, 0.16) !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    letter-spacing: 0.01em;
    padding: 14px 22px !important;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.cbvp-add-to-basket:hover,
.cbvp-add-to-basket:focus,
.woocommerce a.button.cbvp-open-options:hover,
a.button.cbvp-open-options:hover,
.woocommerce a.button.cbvp-open-options:focus,
a.button.cbvp-open-options:focus {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(23, 32, 42, 0.22) !important;
    outline: none;
}

.cbvp-add-to-basket.disabled,
.cbvp-add-to-basket:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.cbvp-add-to-basket.loading {
    opacity: 0.82;
    cursor: wait;
}

.cbvp-add-to-basket.added {
    background:
        linear-gradient(rgba(24, 132, 80, 0.10), rgba(24, 132, 80, 0.10)) padding-box,
        linear-gradient(90deg, #000000 0 20%, #ff0000 20% 40%, #188450 40% 60%, #ffcc00 60% 80%, #1800ad 80% 100%) border-box !important;
    color: #0c5d37 !important;
}

@media (max-width: 680px) {
    .cbvp-modal__dialog {
        width: 100%;
        height: 100%;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }

    .cbvp-modal__content {
        max-height: calc(100vh - 18px);
        padding: 24px 18px 32px;
    }

    .cbvp-modal__close {
        top: 28px;
        right: 18px;
    }

    .cbvp-product__header {
        grid-template-columns: 96px 1fr;
        gap: 16px;
        padding-right: 52px;
    }

    .cbvp-product__image {
        width: 96px;
        height: 96px;
        border-radius: 18px;
    }

    .cbvp-cart-row {
        display: grid;
        grid-template-columns: 88px 1fr;
        width: 100%;
    }

    .cbvp-add-to-basket {
        width: 100%;
    }
}
