:root {
    --icm-bg: rgba(10, 12, 16, 0.55);
    --icm-panel: #ffffff;
    --icm-text: #969696;
    --icm-muted: #9a9ea5;
    --icm-accent: #dc145a;
    --icm-radius: 14px;
}

.icm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--icm-bg);
    backdrop-filter: blur(6px);
    padding: 24px;
    opacity: 0;
    transition: opacity .2s ease;
}

.icm-overlay.is-open {
    display: flex;
}

.icm-overlay.is-visible {
    opacity: 1;
}

.icm-dialog {
    position: relative;
    width: 100%;
    max-width: 920px;
    background: var(--icm-panel);
    border-radius: var(--icm-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 0;
    transform: scale(.96);
    transition: transform .2s ease;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.icm-overlay.is-visible .icm-dialog {
    transform: scale(1);
}

.icm-stage {
    position: relative;
    overflow: hidden;
    border-radius: var(--icm-radius) var(--icm-radius) 0 0;
    background: #fff;
}

.icm-track {
    display: flex;
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    height: 100%;
}

.icm-slide {
    position: relative;
    flex: 0 0 100%;
    max-width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.icm-slide img {
    display: block;
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    background: #000;
}

.icm-link-btn {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--icm-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    transition: transform .15s ease, background .15s ease;
}

.icm-link-btn:hover {
    background: #1ea0dc;
    transform: translateX(-50%) translateY(-2px);
}

.icm-link-btn--with-caption {
    bottom: 46px;
}

.icm-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--icm-text);
    background: linear-gradient(to top, rgba(0, 0, 0, .65), transparent);
}

.icm-close {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--icm-panel);
    color: var(--icm-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
    transition: background .15s ease, transform .15s ease;
}

.icm-close:hover {
    background: var(--icm-accent);
    transform: rotate(90deg);
}

.icm-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(20, 22, 27, 0.7);
    color: var(--icm-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease;
}

.icm-nav:hover {
    background: var(--icm-accent);
}

.icm-nav--prev {
    left: 14px;
}

.icm-nav--next {
    right: 14px;
}

.icm-nav[disabled] {
    opacity: .3;
    cursor: default;
    pointer-events: none;
}

.icm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
}

.icm-dots {
    display: flex;
    gap: 8px;
}

.icm-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #3a3d44;
    cursor: pointer;
    padding: 0;
    transition: background .15s ease, transform .15s ease;
}

.icm-dot.is-active {
    background: var(--icm-accent);
    transform: scale(1.25);
}

.icm-counter {
    font-size: 13px;
    color: var(--icm-muted);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
    .icm-overlay {
        padding: 12px;
    }

    .icm-dialog {
        max-height: 85vh;
        border-radius: var(--icm-radius);
    }

    .icm-stage {
        border-radius: var(--icm-radius) var(--icm-radius) 0 0;
    }

    .icm-slide img {
        max-height: 55vh;
    }

    .icm-close {
        top: 10px;
        right: 10px;
    }

    .icm-nav--prev {
        left: 6px;
    }

    .icm-nav--next {
        right: 6px;
    }
}