.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;
    border-radius: 999px;
    background: #079b3c;
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
    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: #092517;
    font-family: inherit;
}

.ctg-wa-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.68);
}

.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 #e2e4df;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 22px 52px rgba(9, 37, 23, 0.18);
}

.ctg-wa-modal__header {
    display: grid;
    grid-template-columns: 1.65rem minmax(0, 1fr) 2rem;
    align-items: center;
    gap: var(--ctg-wa-modal-header-gap, 0.9rem);
    min-height: 64px;
    margin: var(--ctg-wa-modal-header-margin, 0);
    padding: var(--ctg-wa-modal-header-padding, 1rem 1.35rem);
    border-bottom: 1px solid #edf0ea;
    border-bottom-color: var(--ctg-wa-modal-header-border-color, #edf0ea);
    background: var(--ctg-wa-modal-header-bg, transparent);
}

.ctg-wa-modal__header--no-icon {
    grid-template-columns: minmax(0, 1fr) 2rem;
}

.ctg-wa-modal__cart {
    justify-self: start;
    color: var(--ctg-wa-modal-icon-color, #86c538);
    font-size: var(--ctg-wa-modal-icon-size, 1.25rem);
}

.ctg-wa-modal__title {
    min-width: 0;
    text-align: left;
    color: var(--ctg-wa-modal-title-color, #092517);
    font-size: var(--ctg-wa-modal-title-size, clamp(1.15rem, 2.4vw, 1.45rem));
    font-weight: var(--ctg-wa-modal-title-weight, 700);
    line-height: 1.15;
    letter-spacing: 0;
}

.ctg-wa-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #092517;
    font-size: 1.35rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ctg-wa-modal__close:hover,
.ctg-wa-modal__close:focus {
    background: #f1f4ee;
    color: #092517;
}

.ctg-wa-modal__body {
    display: block;
    min-height: 0;
    overflow-y: auto;
    padding: 1.35rem 1.7rem 1.55rem;
}

.ctg-wa-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ctg-wa-products-title {
    display: block;
    margin-bottom: 0.1rem;
    color: #092517;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.1;
}

.ctg-wa-options {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-top: 0;
    border-top: 0;
}

.ctg-wa-option {
    position: relative;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 0.9rem;
    min-height: 86px;
    padding: 0.72rem 0.9rem;
    border: 1px solid #e1e6dc;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.ctg-wa-option.is-selected {
    border-color: #86c538;
    background: #fbfdf8;
    box-shadow: 0 0 0 1px rgba(134, 197, 56, 0.18);
}

.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: 68px;
    height: 58px;
    overflow: hidden;
    border: 1px solid #edf0ea;
    border-radius: 8px;
    background: #f7f8f5;
}

.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: #092517;
    font-size: clamp(0.95rem, 2.1vw, 1.05rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
}

.ctg-wa-option__price {
    display: block;
    color: #6d7270;
    font-size: clamp(0.92rem, 2vw, 1rem);
    font-weight: 500;
    line-height: 1.15;
}

.ctg-wa-option__price del {
    color: #60646c;
    font-size: 0.78em;
    font-weight: 500;
}

.ctg-wa-option__price ins {
    background: transparent;
    text-decoration: none;
}

.ctg-wa-option__save {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-self: start;
    min-height: 28px;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    background: #86c538;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.ctg-wa-option.is-selected .ctg-wa-option__save {
    background: #86c538;
}

.ctg-wa-option__radio {
    position: relative;
    width: 18px;
    height: 18px;
    border: 1.5px solid #9da59d;
    border-radius: 50%;
    background: #fff;
}

.ctg-wa-option.is-selected .ctg-wa-option__radio {
    border-color: #86c538;
}

.ctg-wa-option.is-selected .ctg-wa-option__radio::after {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #86c538;
    content: "";
}

.ctg-wa-summary {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 0.25rem;
    padding: 0.95rem 1.1rem;
    border-radius: 8px;
    background: #f6f7f4;
}

.ctg-wa-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #092517;
    font-size: clamp(0.95rem, 2.1vw, 1.05rem);
    font-weight: 600;
    line-height: 1.2;
}

.ctg-wa-summary__row strong {
    white-space: nowrap;
}

.ctg-wa-summary__line {
    display: block;
    height: 1px;
    background: #dde3d7;
}

.ctg-wa-summary__row--total {
    font-size: clamp(1rem, 2.2vw, 1.08rem);
}

.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: #092517;
}

.ctg-wa-dynamic-fields {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.75rem;
}

.ctg-wa-dynamic-fields .ctg-wa-field {
    grid-column: span 12;
}

.ctg-wa-dynamic-fields .ctg-wa-field--width-50 {
    grid-column: span 6;
}

.ctg-wa-dynamic-fields .ctg-wa-field--width-33 {
    grid-column: span 4;
}

.ctg-wa-dynamic-fields .ctg-wa-field--width-25 {
    grid-column: span 3;
}

.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: #86c538;
    font-size: 1rem;
    pointer-events: none;
}

.ctg-wa-field input,
.ctg-wa-field select,
.ctg-wa-field textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.68rem 0.9rem 0.68rem 2.85rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #f0f1ef;
    color: #111;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.2;
    box-shadow: none;
    outline: none;
}

.ctg-wa-field textarea {
    min-height: 96px;
    resize: vertical;
}

.ctg-wa-field--textarea .ctg-wa-field__icon {
    top: 1rem;
}

.ctg-wa-field--no-icon input,
.ctg-wa-field--no-icon select,
.ctg-wa-field--no-icon textarea {
    padding-left: 0.9rem;
}

.ctg-wa-field select {
    appearance: auto;
}

.ctg-wa-field input::placeholder {
    color: #9b9b9b;
    opacity: 1;
}

.ctg-wa-field textarea::placeholder {
    color: #9b9b9b;
    opacity: 1;
}

.ctg-wa-field select:invalid {
    color: #9b9b9b;
}

.ctg-wa-field input:focus,
.ctg-wa-field select:focus,
.ctg-wa-field textarea:focus {
    border-color: #86c538;
    box-shadow: 0 0 0 3px rgba(134, 197, 56, 0.16);
}

.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: #4e5651;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.25;
    cursor: pointer;
}

.ctg-wa-terms input {
    width: 18px;
    height: 18px;
    margin: 0.02rem 0 0;
    accent-color: #86c538;
}

.ctg-wa-terms a {
    color: #5ebc0a;
    text-decoration: underline;
}

.ctg-wa-form__status {
    display: none;
    min-height: 1.25rem;
    color: #092517;
    font-size: 0.9rem;
    font-weight: 500;
    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: #5ebc0a;
}

.ctg-wa-submit {
    display: inline-grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-items: center;
    justify-content: var(--ctg-wa-submit-content-align, center);
    align-self: var(--ctg-wa-submit-align, center);
    gap: var(--ctg-wa-submit-gap, 0.65rem);
    min-height: var(--ctg-wa-submit-height, 52px);
    min-width: min(100%, 300px);
    margin: var(--ctg-wa-submit-margin, 0.35rem 0 0);
    padding: var(--ctg-wa-submit-padding, 0.78rem 1.45rem);
    border: 0;
    border-radius: var(--ctg-wa-submit-radius, 999px);
    background: var(--ctg-wa-submit-bg, #86c538);
    color: var(--ctg-wa-submit-color, #fff);
    font: inherit;
    font-family: var(--ctg-wa-submit-font-family, inherit);
    font-size: var(--ctg-wa-submit-font-size, clamp(0.98rem, 2.4vw, 1.08rem));
    font-style: var(--ctg-wa-submit-font-style, normal);
    font-weight: var(--ctg-wa-submit-font-weight, 700);
    line-height: var(--ctg-wa-submit-line-height, 1.05);
    letter-spacing: var(--ctg-wa-submit-letter-spacing, 0);
    text-transform: var(--ctg-wa-submit-text-transform, none);
    cursor: pointer;
    box-shadow: none;
}

.ctg-wa-submit:hover,
.ctg-wa-submit:focus {
    background: var(--ctg-wa-submit-hover-bg, var(--ctg-wa-submit-bg, #86c538));
    color: var(--ctg-wa-submit-hover-color, var(--ctg-wa-submit-color, #fff));
    filter: none;
}

.ctg-wa-submit:active {
    background: var(--ctg-wa-submit-active-bg, var(--ctg-wa-submit-hover-bg, var(--ctg-wa-submit-bg, #86c538)));
    color: var(--ctg-wa-submit-active-color, var(--ctg-wa-submit-hover-color, var(--ctg-wa-submit-color, #fff)));
    transform: translateY(1px);
}

.ctg-wa-submit:disabled {
    cursor: wait;
    opacity: 0.72;
}

.ctg-wa-submit__icon {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--ctg-wa-submit-icon-size, 1.3rem);
}

.ctg-wa-submit__text {
    min-width: 0;
    text-align: center;
}

.ctg-wa-submit--icon-right .ctg-wa-submit__icon {
    order: 2;
}

.ctg-wa-submit--icon-right .ctg-wa-submit__text {
    order: 1;
}

.ctg-wa-submit--no-icon {
    grid-template-columns: minmax(0, 1fr);
}

.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: 8px;
    }

    .ctg-wa-modal__header {
        grid-template-columns: 1.45rem minmax(0, 1fr) 2rem;
        min-height: 60px;
        padding: var(--ctg-wa-modal-header-padding, 0.75rem 1rem);
    }

    .ctg-wa-modal__header--no-icon {
        grid-template-columns: minmax(0, 1fr) 2rem;
    }

    .ctg-wa-modal__body {
        padding: 1.2rem 1rem 1.25rem;
    }

    .ctg-wa-options {
        padding-top: 0.35rem;
    }

    .ctg-wa-option {
        grid-template-columns: 58px minmax(0, 1fr) 18px;
        gap: 0.7rem;
        min-height: 76px;
        padding: 0.65rem 0.75rem;
    }

    .ctg-wa-option__image {
        width: 58px;
        height: 52px;
    }

    .ctg-wa-option__content {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .ctg-wa-option__save {
        justify-self: start;
        min-height: 32px;
        font-size: 0.86rem;
    }

    .ctg-wa-option__radio {
        width: 18px;
        height: 18px;
    }

    .ctg-wa-summary {
        padding: 1rem 1.05rem;
    }

    .ctg-wa-field-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .ctg-wa-dynamic-fields {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .ctg-wa-dynamic-fields .ctg-wa-field {
        grid-column: 1 / -1;
    }

    .ctg-wa-field input,
    .ctg-wa-field select,
    .ctg-wa-field textarea {
        min-height: 50px;
        border-radius: 8px;
        font-size: 1rem;
    }

    .ctg-wa-submit {
        min-height: var(--ctg-wa-submit-height, 56px);
    }
}
