/**
 * Musee - Luxury Variation Swatches Pro
 * Frontend Stylesheet
 */

.musee-swatches-wrapper {
    margin: 8px 0 16px;
    display: block;
}

.musee-swatches-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ==========================================================================
   Swatch Item Base
   ========================================================================== */
.musee-swatch-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 38px;
    padding: 6px 14px;
    background-color: #ffffff;
    color: #1a1a1a;
    border: 1.5px solid #d2d6dc;
    box-sizing: border-box;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    user-select: none;
    outline: none;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.musee-swatch-item:hover:not(.musee-out-of-stock) {
    border-color: #1a1a1a;
    color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Stato Selezionato (Active)
   ========================================================================== */
.musee-swatch-item.selected {
    background-color: #1a1a1a !important;
    border-color: #1a1a1a !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18) !important;
}

.musee-swatch-item.selected .musee-text-label {
    color: #ffffff !important;
}

/* ==========================================================================
   Forme (Shapes)
   ========================================================================== */
.musee-shape-rounded-10 .musee-swatch-item {
    border-radius: 10px;
}

.musee-shape-rounded .musee-swatch-item {
    border-radius: 6px;
}

.musee-shape-pill .musee-swatch-item {
    border-radius: 24px;
    padding: 6px 16px;
}

.musee-shape-square .musee-swatch-item {
    border-radius: 0px;
}

/* ==========================================================================
   Color & Image Swatches
   ========================================================================== */
.musee-swatch-item.musee-swatch-color,
.musee-swatch-item.musee-swatch-image {
    padding: 3px;
    width: 36px;
    min-width: 36px;
    height: 36px;
}

.musee-color-preview {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    box-shadow: inset 0 0 1px rgba(0,0,0,0.2);
}

.musee-image-preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.musee-swatch-item.selected.musee-swatch-color,
.musee-swatch-item.selected.musee-swatch-image {
    border: 2px solid #1a1a1a !important;
    background-color: transparent !important;
    padding: 2px;
}

/* ==========================================================================
   GESTIONE OUT OF STOCK (CORE PRO FEATURE)
   ========================================================================== */
.musee-swatch-item.musee-out-of-stock {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    background-color: #f7fafc !important;
    border-color: #e2e8f0 !important;
    color: #a0aec0 !important;
    overflow: hidden;
}

/* Linea diagonale sbarrata */
.musee-swatch-item.musee-out-of-stock::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -20%;
    width: 140%;
    height: 1.5px;
    background-color: #e53e3e; /* Rosso elegante */
    transform: rotate(-35deg);
    pointer-events: none;
    z-index: 2;
}

/* Opzione Nascondi */
.musee-behavior-hide .musee-swatch-item.musee-out-of-stock {
    display: none !important;
}

/* ==========================================================================
   Tooltips Eleganti
   ========================================================================== */
.musee-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 99;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.musee-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: #1a1a1a transparent transparent transparent;
}

.musee-swatch-item:hover .musee-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

.musee-swatch-item.musee-out-of-stock:hover .musee-tooltip {
    background-color: #c53030;
}

.musee-swatch-item.musee-out-of-stock:hover .musee-tooltip::after {
    border-color: #c53030 transparent transparent transparent;
}

/* Animazione Feedback Clic su Esaurito */
@keyframes museeShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}
.musee-shake {
    animation: museeShake 0.35s ease-in-out;
}
