/* =============================================
   FSP Variation Swatches — Frontend CSS
   Estilos dos swatches exibidos na página
   do produto.
   ============================================= */

/* O select original é escondido via JS apenas quando o tipo não é select */

/* Container dos swatches */
.fsp-swatches-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

/* ── BOTÃO (label) ── */
.fsp-swatch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    border: 1.5px solid #ddd;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: var(--font-weight-normal);
    color: #333;
    background: #fff;
    cursor: pointer;
    transition: var(--transition-base);
    user-select: none;
}

.fsp-swatch-btn:hover {
    border-color: var(--c1);
    color: var(--c1);
}

.fsp-swatch-btn.active {
    border-color: var(--c1);
    color: var(--c1);
    font-weight: var(--font-weight-semibold)
}

.fsp-swatch-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* ── BOLINHA DE COR ── */
.fsp-swatch-color {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    position: relative;
    flex-shrink: 0;
}

.fsp-swatch-color:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.fsp-swatch-color.active {
    border-color: #e91e8c;
    box-shadow: 0 0 0 3px rgba(233, 30, 140, 0.2);
}

.fsp-swatch-color.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Tooltip com nome da cor */
.fsp-swatch-color::after {
    content: attr(data-name);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #fff;
    font-size: 0.72rem;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.fsp-swatch-color:hover::after {
    opacity: 1;
}

/* ── IMAGEM ── */
.fsp-swatch-image {
    width: 48px;
    height: 48px;
    border-radius: 7px;
    border: 2.5px solid transparent;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.fsp-swatch-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fsp-swatch-image:hover {
    border-color: #e91e8c;
}

.fsp-swatch-image.active {
    border-color: #e91e8c;
    box-shadow: 0 0 0 3px rgba(233, 30, 140, 0.2);
}

.fsp-swatch-image.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── SELECT estilizado ── */
.fsp-swatch-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 10px 36px 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    min-width: 180px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.fsp-swatch-select:hover {
    border-color: #e91e8c;
}

.fsp-swatch-select:focus {
    outline: none;
    border-color: #e91e8c;
    box-shadow: 0 0 0 3px rgba(233, 30, 140, 0.1);
}
