/* =====================================================
   RR Finish Swatches — Frontend Styles
   ===================================================== */

:root {
    --rr-primary:     #800020;
    --rr-gold:        #D9B382;
    --rr-text:        #1A1A1A;
    --rr-radius:      6px;
    --rr-swatch-size: 48px;
}

/* Ascunde selectul nativ — păstrat pentru WC compatibility */
.rr-fs-hidden-select {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
}

/* =====================================================
   Swatches container — pagina de produs
   ===================================================== */
.rr-fs-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.rr-fs-swatch {
    position: relative;
    width: var(--rr-swatch-size);
    height: var(--rr-swatch-size);
    border-radius: var(--rr-radius);
    border: 2px solid #e0e0e0;
    overflow: visible;
    cursor: pointer;
    background: none;
    padding: 0;
    transition: border-color .18s, transform .15s, box-shadow .18s;
    outline: none;
    flex-shrink: 0;
}

.rr-fs-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--rr-radius) - 2px);
    display: block;
    pointer-events: none;
}

/* Label text pentru termeni fără imagine */
.rr-fs-swatch--no-img {
    background: #f5f5f5;
    min-width: var(--rr-swatch-size);
    width: auto;
    padding: 0 10px;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    color: #333;
    letter-spacing: .3px;
}

.rr-fs-swatch__label {
    pointer-events: none;
    white-space: nowrap;
}

/* Hover */
.rr-fs-swatch:hover {
    border-color: var(--rr-primary);
    transform: scale(1.08);
    box-shadow: 0 2px 10px rgba(128,0,32,.18);
    z-index: 2;
}

/* Selected */
.rr-fs-swatch--selected {
    border-color: var(--rr-primary);
    box-shadow: 0 0 0 3px rgba(128,0,32,.20);
}

.rr-fs-swatch--selected::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: var(--rr-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/10px no-repeat;
    border-radius: 50%;
    border: 2px solid #fff;
    z-index: 3;
}

/* Disabled (variantă indisponibilă) */
.rr-fs-swatch.disabled,
.rr-fs-swatch[disabled] {
    opacity: .35;
    cursor: not-allowed;
    transform: none !important;
    pointer-events: none;
}

/* ---- Tooltip ---- */
.rr-fs-swatch__tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--rr-text);
    color: #fff;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 100;
}

.rr-fs-swatch__tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--rr-text);
}

.rr-fs-swatch:hover .rr-fs-swatch__tooltip {
    opacity: 1;
}

/* =====================================================
   Integrare RR Product Filters — swatch mic în filtru
   ===================================================== */
.rr-fs-filter-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0,0,0,.1);
    vertical-align: middle;
    margin-right: 6px;
    flex-shrink: 0;
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 480px) {
    :root {
        --rr-swatch-size: 42px;
    }
}
