/* ─── Color Product Slider ─── */

.cps-wrapper {
    margin: 0 auto;
    position: relative;
}

/* Slider area: contains viewport + arrows as siblings */
.cps-slider-area {
    position: relative;
}

/* Viewport */
.cps-slider-viewport {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* default 4:3, overridden by Elementor control */
    overflow: hidden;
}

/* Slide groups (one per color variant) */
.cps-slide-group {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.cps-slide-group.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

/* Individual slides within a group */
.cps-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.35s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cps-slide.is-active {
    opacity: 1;
}

.cps-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Placeholder when no images uploaded */
.cps-slide--placeholder {
    background: #e9e9e9;
}

.cps-slide--placeholder span {
    font-size: 14px;
    color: #888;
    text-align: center;
    padding: 20px;
}

/* ─── Navigation Arrows ───
 * High-specificity selectors to beat Elementor/theme button defaults
 * (e.g. purple hover bg) without using !important, so the widget's
 * own {{WRAPPER}}-scoped selectors still work as overrides.
 */
.cps-wrapper .cps-slider-area button.cps-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: transparent;
    border: none;
    margin: 0;
    padding: 0;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    box-shadow: none;
    text-decoration: none;
    color: inherit;
}

.cps-wrapper .cps-slider-area button.cps-arrow:hover,
.cps-wrapper .cps-slider-area button.cps-arrow:focus,
.cps-wrapper .cps-slider-area button.cps-arrow:active,
.cps-wrapper .cps-slider-area button.cps-arrow:visited {
    background-color: transparent;
    opacity: 1;
    outline: none;
    box-shadow: none;
    text-decoration: none;
}

/* Inside positioning (default, overridden by Elementor selectors) */
.cps-arrow--prev {
    left: 10px;
}

.cps-arrow--next {
    right: 10px;
}

.cps-arrow svg {
    width: 28px;
    height: 28px;
    stroke: #333;
    pointer-events: none;
}

/* Hide arrows when current variant has only 1 image */
.cps-wrapper.cps-single-slide .cps-arrow {
    display: none !important;
}

/* ─── Color Swatches ─── */
.cps-swatches {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.cps-wrapper button.cps-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    cursor: pointer;
    padding: 0;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    box-sizing: border-box;
    flex-shrink: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
}

.cps-wrapper button.cps-swatch:hover {
    transform: scale(1.12);
}

.cps-swatch.is-active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #333;
}

/* Accessibility focus ring */
.cps-swatch:focus-visible {
    outline: 2px solid #0073e6;
    outline-offset: 3px;
}
