.ecpg-widget {
    --ecpg-gradient-start: #06437a;
    --ecpg-gradient-end: #f05858;

    --ecpg-arc-start: #123961;
    --ecpg-arc-end: #f05858;

    width: 100%;
    box-sizing: border-box;
}

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

.ecpg-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 54px;
    width: 100%;
}

.ecpg-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    appearance: none;
    text-align: left;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
}

.ecpg-card:hover,
.ecpg-card:focus {
    background: transparent;
    outline: none;
}

.ecpg-card-image-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 150px;
    max-width: 100%;
    margin-bottom: 14px;
    border-radius: 50%;
    background-color: #f0f1f4;

    /* Важно: картинка теперь может выходить за края круга */
    overflow: visible;
}

/* Градиентная дуга поверх изображения */
.ecpg-card-image-box::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    z-index: 5;
    pointer-events: none;

    background: conic-gradient(
        from 170deg,
        var(--ecpg-arc-start, #123961) 0deg,
        var(--ecpg-arc-start, #123961) 70deg,
        var(--ecpg-arc-end, #f05858) 130deg,
        transparent 132deg,
        transparent 360deg
    );

    -webkit-mask:
        radial-gradient(
            farthest-side,
            transparent calc(100% - 8px),
            #000 calc(100% - 7px)
        );

    mask:
        radial-gradient(
            farthest-side,
            transparent calc(100% - 8px),
            #000 calc(100% - 7px)
        );
}

.ecpg-card-image {
    position: relative;
    z-index: 2;
    display: block;

    /* Картинка выходит за края круга */
    width: 118%;
    height: 118%;
    max-width: none;
    max-height: none;

    object-fit: contain;
    transition: transform 0.35s ease;
}

.ecpg-card:hover .ecpg-card-image {
    transform: scale(1.06);
}

.ecpg-card-subtitle {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 400;
    color: #6f7782;
}

.ecpg-card-title {
    display: block;
    font-size: 18px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1c2530;
}

/* Empty message in Elementor editor */
.ecpg-empty {
    padding: 18px 20px;
    border: 1px dashed #c7ccd3;
    border-radius: 10px;
    background: #f8f9fb;
    color: #333;
    font-size: 14px;
}

/* Modal */
.ecpg-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.ecpg-modal.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ecpg-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(4, 18, 35, 0.88);

    opacity: 0;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);

    transition:
        opacity 0.45s ease,
        backdrop-filter 0.45s ease,
        -webkit-backdrop-filter 0.45s ease;
}

.ecpg-modal.is-active .ecpg-modal-overlay {
    opacity: 1;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.ecpg-modal-window {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    width: min(1040px, 100%);
    max-height: calc(100vh - 64px);
    border-radius: 48px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.34);

    opacity: 0;
    transform: translateY(34px) scale(0.94);
    filter: blur(8px);

    transition:
        opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.52s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

.ecpg-modal.is-active .ecpg-modal-window {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.ecpg-modal-close {
    position: absolute;
    top: 24px;
    right: 28px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #222831;
    font-size: 34px;
    line-height: 1;
    font-weight: 200;
    cursor: pointer;
    appearance: none;
    box-shadow: none;
    transition: opacity 0.2s ease;
}

.ecpg-modal-close:hover,
.ecpg-modal-close:focus {
    background: transparent;
    color: #222831;
    opacity: 0.6;
    outline: none;
}

.ecpg-modal-left {
    position: relative;
    min-height: 560px;
    padding: 58px 48px 52px;
    background: linear-gradient(
        63deg,
        var(--ecpg-gradient-start) 0%,
        var(--ecpg-gradient-end) 100%
    );
    color: #ffffff;
    overflow: hidden;
}

.ecpg-modal-left::after {
    content: "";
    position: absolute;
    left: -150px;
    bottom: -170px;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.ecpg-modal-left-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ecpg-modal-subtitle {
    margin-bottom: 4px;
    font-size: 31px;
    line-height: 1.05;
    font-weight: 300;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.ecpg-modal-title {
    font-size: 44px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: #ffffff;
}

.ecpg-modal-image-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 36px;
}

.ecpg-modal-image {
    display: block;
    width: 100%;
    max-width: 520px;
    max-height: 360px;
    object-fit: contain;
    filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.28));
}

.ecpg-modal-right {
    max-height: calc(100vh - 64px);
    padding: 96px 48px 56px 42px;
    overflow-y: auto;
    background: #ffffff;
    color: #222a33;
}

.ecpg-modal-right h1,
.ecpg-modal-right h2,
.ecpg-modal-right h3,
.ecpg-modal-right h4,
.ecpg-modal-right h5,
.ecpg-modal-right h6 {
    margin-top: 0;
    margin-bottom: 18px;
    color: #2a3038;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
}

.ecpg-modal-right h3 {
    font-size: 21px;
}

.ecpg-modal-right h1:not(:first-child),
.ecpg-modal-right h2:not(:first-child),
.ecpg-modal-right h3:not(:first-child),
.ecpg-modal-right h4:not(:first-child),
.ecpg-modal-right h5:not(:first-child),
.ecpg-modal-right h6:not(:first-child) {
    margin-top: 34px;
}

.ecpg-modal-right p {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.55;
    color: #404956;
}

.ecpg-modal-right table {
    width: 100%;
    margin: 0 0 22px;
    border-collapse: collapse;
    border: 0;
}

.ecpg-modal-right table tbody,
.ecpg-modal-right table tr,
.ecpg-modal-right table td,
.ecpg-modal-right table th {
    border: 0;
}

.ecpg-modal-right table tr {
    border-bottom: 1px dashed #d9dde3;
}

.ecpg-modal-right table td,
.ecpg-modal-right table th {
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.3;
    vertical-align: top;
    color: #39414d;
    background: transparent;
}

.ecpg-modal-right table td:last-child,
.ecpg-modal-right table th:last-child {
    text-align: right;
    color: #222a33;
    font-weight: 500;
    white-space: nowrap;
    padding-left: 18px;
}

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

/* Tablet */
@media (max-width: 1024px) {
    .ecpg-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 36px;
    }

    .ecpg-modal-window {
        grid-template-columns: 1fr;
        border-radius: 32px;
    }

    .ecpg-modal-left {
        min-height: auto;
        padding: 44px 32px 36px;
    }

    .ecpg-modal-image-wrap {
        margin-top: 24px;
    }

    .ecpg-modal-image {
        max-height: 260px;
    }

    .ecpg-modal-right {
        max-height: none;
        padding: 42px 32px 44px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .ecpg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }

    .ecpg-card-image-box {
        width: 130px;
        height: 130px;
    }

    .ecpg-card-subtitle {
        font-size: 12px;
    }

    .ecpg-card-title {
        font-size: 16px;
    }

    .ecpg-modal {
        padding: 14px;
    }

    .ecpg-modal-window {
        max-height: calc(100vh - 28px);
        border-radius: 24px;
        overflow-y: auto;
    }

    .ecpg-modal-left {
        padding: 34px 24px 28px;
    }

    .ecpg-modal-subtitle {
        font-size: 24px;
    }

    .ecpg-modal-title {
        font-size: 36px;
    }

    .ecpg-modal-image {
        max-height: 220px;
    }

    .ecpg-modal-right {
        padding: 34px 24px 36px;
    }

    .ecpg-modal-close {
        top: 16px;
        right: 18px;
        color: #ffffff;
    }

    .ecpg-modal-close:hover,
    .ecpg-modal-close:focus {
        color: #ffffff;
    }

    .ecpg-modal-right table td,
    .ecpg-modal-right table th {
        display: block;
        width: 100%;
        text-align: left;
    }

    .ecpg-modal-right table td:last-child,
    .ecpg-modal-right table th:last-child {
        text-align: left;
        white-space: normal;
        padding-left: 0;
        padding-top: 0;
    }
}
img.ecpg-card-image {
    margin-top: -20%;
    margin-left: 32%;
    width: 132%;
    max-width: 122%;
}

.ecpg-card:hover .ecpg-card-image {
    transform: none!important;
}
.ecpg-modal-left {
    transform: translateX(-28px);
    opacity: 0;
    transition:
        opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s,
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s;
}

.ecpg-modal-right {
    transform: translateX(28px);
    opacity: 0;
    transition:
        opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.12s,
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.12s;
}

.ecpg-modal.is-active .ecpg-modal-left,
.ecpg-modal.is-active .ecpg-modal-right {
    opacity: 1;
    transform: translateX(0);
}

.ecpg-modal-image {
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    transition:
        opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.18s,
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.18s,
        filter 0.35s ease;
}

.ecpg-modal.is-active .ecpg-modal-image {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.ecpg-modal-subtitle,
.ecpg-modal-title {
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.ecpg-modal-subtitle {
    transition-delay: 0.16s;
}

.ecpg-modal-title {
    transition-delay: 0.22s;
}

.ecpg-modal.is-active .ecpg-modal-subtitle,
.ecpg-modal.is-active .ecpg-modal-title {
    opacity: 1;
    transform: translateY(0);
}
.ecpg-modal-right > * {
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 0.45s ease,
        transform 0.45s ease;
}

.ecpg-modal.is-active .ecpg-modal-right > * {
    opacity: 1;
    transform: translateY(0);
}

.ecpg-modal.is-active .ecpg-modal-right > *:nth-child(1) {
    transition-delay: 0.18s;
}

.ecpg-modal.is-active .ecpg-modal-right > *:nth-child(2) {
    transition-delay: 0.24s;
}

.ecpg-modal.is-active .ecpg-modal-right > *:nth-child(3) {
    transition-delay: 0.30s;
}

.ecpg-modal.is-active .ecpg-modal-right > *:nth-child(4) {
    transition-delay: 0.36s;
}

.ecpg-modal.is-active .ecpg-modal-right > *:nth-child(5) {
    transition-delay: 0.42s;
}
@media (max-width: 767px) {
    .ecpg-modal-window {
        transform: translateY(24px) scale(0.97);
        filter: blur(4px);
    }

    .ecpg-modal-left,
    .ecpg-modal-right {
        transform: translateY(18px);
    }

    .ecpg-modal.is-active .ecpg-modal-left,
    .ecpg-modal.is-active .ecpg-modal-right {
        transform: translateY(0);
    }
}
@media (prefers-reduced-motion: reduce) {
    .ecpg-modal,
    .ecpg-modal-overlay,
    .ecpg-modal-window,
    .ecpg-modal-left,
    .ecpg-modal-right,
    .ecpg-modal-image,
    .ecpg-modal-subtitle,
    .ecpg-modal-title,
    .ecpg-modal-right > * {
        transition: none !important;
        animation: none !important;
        transform: none !important;
        filter: none !important;
    }
}
/* Smooth modal animation */
.ecpg-modal {
    display: flex;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.ecpg-modal.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ecpg-modal-overlay {
    opacity: 0;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    transition:
        opacity 0.45s ease,
        backdrop-filter 0.45s ease,
        -webkit-backdrop-filter 0.45s ease;
}

.ecpg-modal.is-active .ecpg-modal-overlay {
    opacity: 1;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.ecpg-modal-window {
    opacity: 0;
    transform: translateY(34px) scale(0.94);
    filter: blur(8px);
    transition:
        opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.52s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

.ecpg-modal.is-active .ecpg-modal-window {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.ecpg-modal-left {
    transform: translateX(-28px);
    opacity: 0;
    transition:
        opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s,
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s;
}

.ecpg-modal-right {
    transform: translateX(28px);
    opacity: 0;
    transition:
        opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.12s,
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.12s;
}

.ecpg-modal.is-active .ecpg-modal-left,
.ecpg-modal.is-active .ecpg-modal-right {
    opacity: 1;
    transform: translateX(0);
}

.ecpg-modal-subtitle,
.ecpg-modal-title {
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.ecpg-modal-subtitle {
    transition-delay: 0.16s;
}

.ecpg-modal-title {
    transition-delay: 0.22s;
}

.ecpg-modal.is-active .ecpg-modal-subtitle,
.ecpg-modal.is-active .ecpg-modal-title {
    opacity: 1;
    transform: translateY(0);
}

.ecpg-modal-image {
    transform: translateY(20px) scale(0.96);
    opacity: 0;
    transition:
        opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.18s,
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.18s,
        filter 0.35s ease;
}

.ecpg-modal.is-active .ecpg-modal-image {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.ecpg-modal-right > * {
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 0.45s ease,
        transform 0.45s ease;
}

.ecpg-modal.is-active .ecpg-modal-right > * {
    opacity: 1;
    transform: translateY(0);
}

.ecpg-modal.is-active .ecpg-modal-right > *:nth-child(1) {
    transition-delay: 0.18s;
}

.ecpg-modal.is-active .ecpg-modal-right > *:nth-child(2) {
    transition-delay: 0.24s;
}

.ecpg-modal.is-active .ecpg-modal-right > *:nth-child(3) {
    transition-delay: 0.30s;
}

.ecpg-modal.is-active .ecpg-modal-right > *:nth-child(4) {
    transition-delay: 0.36s;
}

.ecpg-modal.is-active .ecpg-modal-right > *:nth-child(5) {
    transition-delay: 0.42s;
}

@media (max-width: 767px) {
    .ecpg-modal-window {
        transform: translateY(24px) scale(0.97);
        filter: blur(4px);
    }

    .ecpg-modal-left,
    .ecpg-modal-right {
        transform: translateY(18px);
    }

    .ecpg-modal.is-active .ecpg-modal-left,
    .ecpg-modal.is-active .ecpg-modal-right {
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ecpg-modal,
    .ecpg-modal-overlay,
    .ecpg-modal-window,
    .ecpg-modal-left,
    .ecpg-modal-right,
    .ecpg-modal-image,
    .ecpg-modal-subtitle,
    .ecpg-modal-title,
    .ecpg-modal-right > * {
        transition: none !important;
        animation: none !important;
        transform: none !important;
        filter: none !important;
    }
}
