/* ─── Попап-оверлей ─────────────────────────────────────────────── */

.mcg-variation-popup {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: #fbfaf8;
    z-index: 1;
    flex-direction: column;
    padding: 13px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.2s ease;
}


.mcg-variation-popup[data-product-id="8884"] {
    background: rgba(255, 255, 255, 1);
}

/* Шаг 1: display:flex — появляется в DOM */
.mcg-variation-popup.is-visible {
    display: flex;
}

/* Шаг 2: opacity:1 — анимация появления */
.mcg-variation-popup.is-open {
    opacity: 1;
}

/* Полоска сверху — как у оригинального .wvs-archive-variations-wrapper.visible:before */
.mcg-variation-popup::before {
    content: "";
    display: block;
    height: 3px;
    width: 100%;
    background-color: #CB9F73;
    border-radius: 3px;
    flex-shrink: 0;
    margin-bottom: 8px;
    top: 0;
    position: absolute;
    left: 0;
    right: 0;
}

/* ─── Кнопка закрытия ───────────────────────────────────────────── */

.mcg-popup__close {
    align-self: flex-end;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    width: auto;
    text-align: right;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.mcg-popup__close img {
    width: 25px !important;
    height: 25px !important;
    margin: 0 !important;
    display: block;
}

/* ─── Заголовок ─────────────────────────────────────────────────── */

.mcg-popup__title {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.4;
    color: #000;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.mcg-popup__title span {
    color: #000;
}

/* ─── Атрибут ───────────────────────────────────────────────────── */

.mcg-popup__attribute {
    margin-bottom: 4px;
    flex-shrink: 0;
}

.mcg-popup__attr-label {
    font-size: 15px;
    font-weight: 400;
    color: #8C8C8C;
    line-height: 1.5;
    margin: 6px 0 8px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.mcg-popup__attr-selected {
    color: #000;
    font-weight: 500;
    font-size: 14px;
}

/* ─── Список сватчей ────────────────────────────────────────────── */

.mcg-popup__swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mcg-popup__swatches:before {
    content: none !important;
}

/* ─── Сватч: общий ──────────────────────────────────────────────── */

.mcg-popup__swatch {
    cursor: pointer;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    transition: border-color 0.15s, opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mcg-popup__swatch.is-selected {
    border: 1px solid #000 !important;
}

.mcg-popup__swatch.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ─── Сватч: color ──────────────────────────────────────────────── */

.mcg-popup__swatch--color {
    width: 26px;
    height: 26px;
    border-radius: 50% !important;
    padding: 2px;
}

.mcg-popup__swatch--color .mcg-popup__swatch-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
}

/* ─── Сватч: image ──────────────────────────────────────────────── */

.mcg-popup__swatch--image {
    width: 48px;
    height: 41px;
    border-radius: 0;
    overflow: hidden;
    padding: 0;
}

.mcg-popup__swatch--image .mcg-popup__swatch-inner {
    width: 100%;
    height: 100%;
    /*display: flex;
    align-items: center;
    justify-content: center;*/
    overflow: hidden;
}

div[data-attribute="attribute_pa_znak-zodiaka"] .mcg-popup__swatch-inner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mcg-popup__swatch--image img {
    width: 46px;
    height: auto;
    object-fit: cover;
    margin: 0 !important;
}

div[data-attribute="attribute_pa_znak-zodiaka"] .mcg-popup__swatch-inner img {
    width: 27px;
}


/* ─── Сватч: button ─────────────────────────────────────────────── */

.mcg-popup__swatch--button {
    min-width: 46px;
    height: 36px;
    padding: 0 6px;
    border-radius: 2px;
}

.mcg-popup__swatch--button .mcg-popup__swatch-inner {
    font-size: 14px;
    line-height: 100%;
    font-weight: 500;
    color: #111;
    white-space: nowrap;
}

.mcg-popup__swatch--button.is-selected .mcg-popup__swatch-inner {
    color: #000;
}

/* ─── Кнопка "Add to cart" в лупе ──────────────────────────────── */
/* (Совместима с существующими стилями .add_to_cart_button) */

.add_to_cart_button[data-action="open-popup"].opened {
    opacity: 0;
}

/* ─── Статус сообщение ──────────────────────────────────────────── */

.mcg-popup__status {
    font-size: 11px;
    line-height: 1.4;
    min-height: 16px;
    margin-top: auto;
    padding-top: 6px;
    flex-shrink: 0;
}

.mcg-popup__status.is-success {
    color: #2e7d32;
}

.mcg-popup__status.is-error {
    color: #f43643;
}

/* ─── Родительская карточка когда попап открыт ──────────────────── */

.recommendations-card.mcg-popup-active > a,
.recommendations-card.mcg-popup-active .add_to_cart_button {
    /* Кнопку скрываем через opacity, чтобы сохранить место */
    pointer-events: none;
}

.mcg-popup__size-guide--link {
    font-size: 12px;
    text-decoration: underline;
    color: #636363FF;
    line-height: 1.5;
    font-weight: 400;
}


/* ─── Мобильная адаптация ───────────────────────────────────────── */

@media screen and (max-width: 768px) {

    .mcg-variation-popup {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        min-height: 220px;
        max-height: 70vh;
        overflow-y: auto;
        padding: 16px 20px 24px;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
        z-index: 11;
    }



    /* Затемнение фона на мобильном */
    .mcg-popup-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 10;
    }

    .mcg-popup-overlay.is-visible {
        display: block;
    }

    /*.mcg-popup__title {
        font-size: 16px;
    }

    .mcg-popup__swatch--button {
        height: 28px;
        min-width: 36px;
    }

    .mcg-popup__swatch--button .mcg-popup__swatch-inner {
        font-size: 12px;
    }

    .mcg-popup__swatch--color,
    .mcg-popup__swatch--image {
        width: 36px;
        height: 36px;
    }*/
}
