/* Frontend Swatches Styling */

/* Override WooCommerce & Elementor variations table styling */
.variations_form table.variations,
.variations_form table.variations tbody,
.variations_form table.variations tr,
.variations_form table.variations th,
.variations_form table.variations td {
    background-color: transparent !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.variations_form table.variations {
    margin-bottom: 1.5em !important;
    width: 100% !important;
}

/* Align labels (like "Warna") perfectly to the left and clear padding */
.variations_form table.variations th.label,
.variations_form table.variations td.label {
    padding-left: 0 !important;
    padding-right: 20px !important; /* Distance between label and swatches */
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    font-weight: 600;
    color: #1a202c;
    width: 90px !important; /* Compact label column width */
    text-align: left !important;
    vertical-align: middle !important;
}

.variations_form table.variations td.value {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    text-align: left !important;
    vertical-align: middle !important;
}

.sali-hidden-select select {
    display: none !important;
}

.sali-swatches-container {
    margin-bottom: 0;
    width: 100%;
}

.sali-swatches-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Swatch Item styling */
.sali-swatch-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    background-color: transparent;
    padding: 4px 10px;
    min-height: 36px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box;
    outline: none;
}

/* Has image thumbnail */
.sali-swatch-has-media {
    padding: 2px 10px 2px 2px;
}

/* Swatch Thumbnail Image */
.sali-swatch-img {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 3px;
    margin-right: 8px;
    background-color: transparent;
    border: 1px solid #edf2f7;
    transition: transform 0.2s ease;
}

/* Color circle preview */
.sali-swatch-color-preview {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    display: inline-block;
    flex-shrink: 0;
}

.sali-swatch-text {
    line-height: 1.2;
}

/* Hover State */
.sali-swatch-item:hover:not(.sali-disabled):not(.sali-selected) {
    border-color: #ee4d2d;
    color: #ee4d2d;
}

.sali-swatch-item:hover .sali-swatch-img {
    transform: scale(1.02);
}

/* Selected State */
.sali-swatch-item.sali-selected {
    border-color: #ee4d2d;
    color: #ee4d2d;
    font-weight: 500;
}

/* Disabled / Out of Stock State */
.sali-swatch-item.sali-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background-color: transparent;
    border-color: #e2e8f0;
    border-style: dashed;
    color: #cbd5e0;
}

.sali-swatch-item.sali-disabled .sali-swatch-img {
    filter: grayscale(100%);
    opacity: 0.5;
}

.sali-swatch-item.sali-disabled::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 1px;
    background-color: #cbd5e0;
    transform: rotate(-15deg);
    pointer-events: none;
}

/* Hide WooCommerce reset variations ("Clear") link entirely */
.variations_form a.reset_variations {
    display: none !important;
}


