.productmerge-matrix {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.productmerge-matrix__label {
    font-weight: 400;
    font-size: 16px;
    color: #666666;
    margin-bottom: 10px;
}

.productmerge-matrix__row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.productmerge-matrix__values-wrapper {
    position: relative;
}

.productmerge-matrix__swiper {
    overflow: hidden;
    padding: 0 16px 0 2px;
}

.productmerge-matrix__values {
    display: flex;
    align-items: center;
}

.productmerge-matrix__swiper .swiper-slide {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.productmerge-matrix__value {
    background: transparent;
    border-radius: 0;
    border: 1px solid transparent;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    box-sizing: border-box;
}

.productmerge-matrix__value:hover {
    border-color: var(--theme-primary, #247cff);
    transform: none;
}

.productmerge-matrix__value.active,
.productmerge-matrix__value.is-selected {
    border-color: var(--theme-primary, #7b2cbf);
    background-color: #ffffff;
    box-shadow: none;
    border-radius: 4px;
}

.productmerge-matrix__value.is-out-of-stock,
.productmerge-matrix__value.is-missing,
.productmerge-matrix__value.is-value-out {
    opacity: 0.4;
}

.productmerge-matrix__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: 0;
    background: #ffffff;
}

.productmerge-matrix__text {
    padding: 8px;
    text-align: center;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.3;
    max-width: 100%;
    display: block;
}

.productmerge-matrix__values-wrapper .productmerge-matrix__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    width: 22px;
    height: 22px;
    min-width: 22px;
    max-width: 22px;
    border: none !important;
    border-radius: 0;
    top: 50% !important;
    bottom: auto !important;
    z-index: 12;
    background: transparent !important;
    transition: opacity 0.2s ease;
    box-shadow: none !important;
    outline: 0;
    opacity: 1;
    cursor: pointer;
    user-select: none;
    margin: 0;
    transform: translateY(-50%) !important;
    left: auto;
}

.productmerge-matrix__values-wrapper .productmerge-matrix__nav:hover {
    opacity: 0.65;
}

.productmerge-matrix__values-wrapper .productmerge-matrix__nav:active {
    background: transparent;
}

.productmerge-matrix__values-wrapper .productmerge-matrix__nav::after {
    display: none;
}

.productmerge-matrix__values-wrapper .productmerge-matrix__nav::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-top: 2px solid #8b909a;
    border-right: 2px solid #8b909a;
    background: none;
}

.productmerge-matrix__values-wrapper .productmerge-matrix__nav.swiper-button-disabled::before,
.productmerge-matrix__values-wrapper .productmerge-matrix__nav.is-disabled::before {
    border-color: #c2c5cd;
}

.productmerge-matrix__values-wrapper .productmerge-matrix__prev {
    left: -16px !important;
    right: auto !important;
}

.productmerge-matrix__values-wrapper .productmerge-matrix__prev::before {
    transform: rotate(-135deg);
}

.productmerge-matrix__values-wrapper .productmerge-matrix__next {
    right: -16px !important;
    left: auto !important;
}

.productmerge-matrix__values-wrapper .productmerge-matrix__next::before {
    transform: rotate(45deg);
}

.productmerge-matrix__values-wrapper .productmerge-matrix__nav.swiper-button-disabled,
.productmerge-matrix__values-wrapper .productmerge-matrix__nav.is-disabled {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
}

.productmerge-matrix__hover-preview {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 220px;
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    transform-origin: top center;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 20;
}

.productmerge-matrix__hover-preview.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.productmerge-matrix__hover-preview.is-visible::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -18px;
    height: 18px;
    background: transparent;
}

.productmerge-matrix__hover-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(20, 25, 38, 0.24);
    padding: 6px;
    cursor: pointer;
}

.productmerge-matrix__hover-image {
    width: 100%;
    height: 286px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
}

.productmerge-matrix__hover-meta {
    padding: 10px 4px 4px;
}

.productmerge-matrix__hover-price {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #1f2430;
}

.productmerge-matrix__hover-sizes {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
    color: #5d6678;
}

.productmerge-matrix__hover-sizes-title {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #2f3645;
}

.productmerge-matrix__hover-sizes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.productmerge-matrix__hover-size-chip {
    appearance: none;
    -webkit-appearance: none;
    min-width: 28px;
    padding: 3px 9px;
    border-radius: 4px;
    border: 1px solid #d7dde8;
    background: #f7f9fc;
    color: #2b3342;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    box-sizing: border-box;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.productmerge-matrix__hover-size-chip:hover {
    border-color: #8aa8d8;
    background: #eef4ff;
}

.productmerge-matrix__hover-size-chip:focus {
    outline: 0;
    border-color: #6a8ec7;
    background: #e7f0ff;
}

.productmerge-matrix__hover-preview::after {
    content: '';
    position: absolute;
    left: 50%;
    top: -8px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 3px;
    transform: translateX(-50%) rotate(45deg);
    box-shadow: 0 -10px 20px rgba(20, 25, 38, 0.14);
}

.productmerge-matrix__more-btn {
    margin-top: 8px;
    font-size: 14px;
    cursor: pointer;
    color: var(--theme-primary, #1e1e1e);
    background: none;
    border: none;
    padding: 0;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .productmerge-matrix__swiper {
        padding: 0 10px 0 2px;
    }

    .productmerge-matrix__values-wrapper .productmerge-matrix__nav {
        width: 20px;
        height: 20px;
        min-width: 20px;
        max-width: 20px;
    }

    .productmerge-matrix__value {
        width: 42px;
        height: 42px;
        border-radius: 0;
    }

    .productmerge-matrix__image {
        border-radius: 3px;
    }

    .productmerge-matrix__values-wrapper .productmerge-matrix__prev {
        left: -10px !important;
        right: auto !important;
    }

    .productmerge-matrix__values-wrapper .productmerge-matrix__next {
        right: -10px !important;
        left: auto !important;
    }

    .productmerge-matrix__hover-preview {
        display: none;
    }
}
