.ctg-wa-shortcode,
.ctg-wa-shortcode *,
.ctg-wa-modal,
.ctg-wa-modal * {
    box-sizing: border-box;
}

.ctg-wa-shortcode {
    display: inline-block;
    max-width: 100%;
}

.ctg-wa-buy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 46px;
    padding: 0.7rem 1.7rem;
    border: 0 !important;
    border-radius: 0 !important;
    background: #023398;
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none !important;
    outline: none !important;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.ctg-wa-buy-button:hover,
.ctg-wa-buy-button:focus {
    color: #fff;
    filter: none;
    text-decoration: none;
}

.ctg-wa-buy-button:active {
    transform: translateY(1px);
}

.ctg-wa-buy-button svg,
.ctg-wa-submit svg,
.ctg-wa-modal svg {
    display: block;
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.ctg-wa-buy-button__icon {
    display: inline-flex;
    font-size: 1.28rem;
}

.ctg-wa-buy-button--icon-right .ctg-wa-buy-button__icon {
    order: 2;
}

.ctg-wa-buy-button--icon-right .ctg-wa-buy-button__text {
    order: 1;
}

.ctg-wa-modal[hidden] {
    display: none !important;
}

.ctg-wa-modal {
    position: fixed;
    inset: 0;
    z-index: 100090;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #050505;
    font-family: inherit;
}

.ctg-wa-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
}

.ctg-wa-modal__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(92vw, 560px);
    max-height: min(92vh, 820px);
    overflow: hidden;
    border: 1px solid #cfcfcf;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

.ctg-wa-modal__header {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
    align-items: center;
    gap: 0.75rem;
    min-height: 72px;
    padding: 0.95rem 1.45rem;
    border-bottom: 1px solid #d7d7d7;
}

.ctg-wa-modal__cart {
    justify-self: center;
    color: #000;
    font-size: 1.55rem;
}

.ctg-wa-modal__title {
    min-width: 0;
    text-align: center;
    color: #050505;
    font-family: 'Barlow', sans-serif;
    font-size: clamp(1.35rem, 3vw, 1.65rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0;
}

.ctg-wa-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #050505;
    font-size: 1.8rem;
    cursor: pointer;
}

.ctg-wa-modal__close:hover,
.ctg-wa-modal__close:focus {
    background: #f1f1f1;
    color: #050505;
}

.ctg-wa-modal__body {
    display: block;
    min-height: 0;
    overflow-y: auto;
    padding: 1.55rem 2rem 1.7rem;
}

.ctg-wa-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    font-family: 'Barlow', sans-serif;
    font-weight: 400;
}

.ctg-wa-form,
.ctg-wa-form *:not(svg):not(path) {
    font-family: 'Barlow', sans-serif;
    font-weight: 400;
}

.ctg-wa-products-title {
    display: block;
    margin-bottom: 0.25rem;
    color: #050505;
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.1;
}

.ctg-wa-options {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-top: 0;
    border-top: 0;
}

.ctg-wa-option {
    position: relative;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 0.85rem;
    min-height: 92px;
    padding: 0.78rem 1rem;
    border: 3px solid #0b3f97;
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.ctg-wa-option.is-selected {
    border-color: #0b3f97;
    background: #fff;
}

.ctg-wa-option__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ctg-wa-option__image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 64px;
    overflow: hidden;
    border: 1px solid #e4e4e4;
    border-radius: 4px;
    background: #f7f7f7;
}

.ctg-wa-option__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ctg-wa-option__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 0.22rem;
    min-width: 0;
}

.ctg-wa-option__name {
    grid-column: 1 / -1;
    display: block;
    color: #050505;
    font-size: clamp(0.98rem, 2.4vw, 1.12rem);
    font-weight: 700 !important;
    line-height: 1.15;
    letter-spacing: 0;
}

.ctg-wa-option__desc {
    grid-column: 1 / -1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #5b5f66;
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.3;
}

.ctg-wa-option__radio {
    position: relative;
    width: 28px;
    height: 28px;
    border: 6px solid #0b3f97;
    border-radius: 50%;
    background: #fff;
}

.ctg-wa-option.is-selected .ctg-wa-option__radio {
    border-color: #0b3f97;
}

.ctg-wa-form__title {
    display: none;
    margin-top: 0.1rem;
    text-align: center;
    color: #050505;
    font-size: clamp(1.25rem, 3vw, 1.8rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: 0;
}

.ctg-wa-field {
    display: flex;
    flex-direction: column;
    gap: 0;
    color: #050505;
}

.ctg-wa-field__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ctg-wa-field__label span {
    color: #f41414;
}

.ctg-wa-field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.ctg-wa-field__icon {
    position: absolute;
    left: 1rem;
    z-index: 1;
    display: inline-flex;
    color: #050505;
    font-size: 1.18rem;
    pointer-events: none;
}

.ctg-wa-field input,
.ctg-wa-field select {
    width: 100%;
    min-height: 52px;
    padding: 0.72rem 0.9rem 0.72rem 3.25rem;
    border: 1px solid #9b9b9b;
    border-radius: 9px;
    background: #f8f9fc;
    color: #202124;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: none;
    outline: none;
}

.ctg-wa-field select {
    appearance: auto;
}

.ctg-wa-field input::placeholder {
    color: #8b8e94;
    opacity: 1;
}

.ctg-wa-field select:invalid {
    color: #8b8e94;
}

.ctg-wa-field input:focus,
.ctg-wa-field select:focus {
    border-color: #0784c8;
    box-shadow: 0 0 0 3px rgba(7, 132, 200, 0.14);
}

.ctg-wa-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.ctg-wa-terms {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 0.55rem;
    margin-top: 0.35rem;
    color: #050505;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
}

.ctg-wa-terms input {
    width: 18px;
    height: 18px;
    margin: 0.02rem 0 0;
    accent-color: #0784c8;
}

.ctg-wa-terms a {
    color: #087cc2;
    text-decoration: underline;
}

.ctg-wa-form__status {
    display: none;
    min-height: 1.25rem;
    color: #050505;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

.ctg-wa-form__status:not(:empty) {
    display: block;
}

.ctg-wa-form__status[data-type="error"] {
    color: #b42318;
}

.ctg-wa-form__status[data-type="success"] {
    color: #087a2e;
}

.ctg-wa-submit {
    display: inline-grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-items: center;
    align-self: center;
    gap: 0.5rem;
    min-height: 46px;
    min-width: 0;
    margin-top: 0.35rem;
    padding: 0.5rem 2rem;
    border: 0 !important;
    border-radius: 0 !important;
    background: #023398 !important;
    background-image: none !important;
    color: #fff !important;
    font-family: 'Barlow', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.05;
    cursor: pointer;
    box-shadow: none !important;
    outline: none !important;
}

.ctg-wa-submit:hover,
.ctg-wa-submit:focus {
    background: #023398 !important;
    color: #fff !important;
    filter: brightness(1.04);
}

.ctg-wa-submit:disabled {
    cursor: wait;
    opacity: 0.72;
}

.ctg-wa-submit__icon {
    justify-self: center;
    display: inline-flex;
    font-size: 1.05rem;
}

.ctg-wa-submit__text {
    min-width: 0;
    text-align: center;
}

.ctg-wa-modal-open {
    overflow: hidden !important;
}

@media (max-width: 640px) {
    .ctg-wa-modal {
        align-items: center;
        padding: 0.55rem;
    }

    .ctg-wa-modal__panel {
        width: min(100%, 520px);
        max-height: 94vh;
        border-radius: 16px;
    }

    .ctg-wa-modal__header {
        grid-template-columns: 2.25rem minmax(0, 1fr) 2.25rem;
        min-height: 66px;
        padding: 0.75rem 1rem;
    }

    .ctg-wa-modal__body {
        padding: 1.2rem 1rem 1.25rem;
    }

    .ctg-wa-options {
        padding-top: 0.75rem;
    }

    .ctg-wa-option {
        grid-template-columns: 62px minmax(0, 1fr) 26px;
        gap: 0.7rem;
        min-height: 82px;
        padding: 0.65rem 0.75rem;
        border-width: 3px;
    }

    .ctg-wa-option__image {
        width: 62px;
        height: 56px;
    }

    .ctg-wa-option__content {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .ctg-wa-option__radio {
        width: 26px;
        height: 26px;
    }

    .ctg-wa-field-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .ctg-wa-field input,
    .ctg-wa-field select {
        min-height: 50px;
        border-radius: 9px;
        font-size: 1rem;
    }

    .ctg-wa-submit {
        min-height: 44px;
    }
}
