/**
 * استایل‌های Variation Swatches
 *
 * @package GigiShops
 */

/* Container */
.gigishops-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

/* Base Swatch */
.swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
    position: relative;
}

.swatch:hover {
    border-color: #9333ea;
    transform: scale(1.05);
}

.swatch.selected {
    border-color: #9333ea;
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.2);
}

/* Color Swatch */
.swatch-color {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.swatch-color.selected::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Image Swatch */
.swatch-image {
    width: 50px;
    height: 50px;
    padding: 4px;
    border-radius: 8px;
    background: white;
}

.swatch-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Button Swatch */
.swatch-button {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    color: #374151;
    min-width: 50px;
}

.swatch-button:hover {
    background: #f3e8ff;
}

.swatch-button.selected {
    background: #9333ea;
    color: white;
    border-color: #9333ea;
}

/* Out of Stock */
.swatch.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
}

.swatch.out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
    transform: rotate(-45deg);
}

/* Tooltip */
.swatch[title] {
    position: relative;
}

.swatch[title]::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #1f2937;
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    margin-bottom: 6px;
}

.swatch[title]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.swatch[title]:hover::before,
.swatch[title]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Size Variations */
.gigishops-swatches.size-small .swatch-color {
    width: 30px;
    height: 30px;
}

.gigishops-swatches.size-large .swatch-color {
    width: 50px;
    height: 50px;
}

/* Shape Variations */
.gigishops-swatches.shape-square .swatch-color {
    border-radius: 4px;
}

.gigishops-swatches.shape-rounded .swatch-color {
    border-radius: 8px;
}

/* Label */
.variation-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Selected Value Display */
.selected-value {
    font-weight: 400;
    color: #9333ea;
    margin-right: 4px;
}

/* Clear Selection */
.reset_variations {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset_variations:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .swatch-color {
        width: 35px;
        height: 35px;
    }
    
    .swatch-button {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .swatch-image {
        width: 45px;
        height: 45px;
    }
}


