/**
 * Size/Color Swatches for Product Variants
 * Modern, visual variant selection
 */

.variant-section {
    margin-bottom: 1.5rem;
}

.variant-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
    font-size: 0.95rem;
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Color Swatches */
.variant-option.color-swatch {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.variant-option.color-swatch.selected {
    border-color: #146eb4;
    box-shadow: 0 0 0 3px rgba(20, 110, 180, 0.2);
}

.variant-option.color-swatch::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.variant-option.color-swatch.selected::after {
    width: 20px;
    height: 20px;
}

.variant-option.color-swatch.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
    position: relative;
}

.variant-option.color-swatch.out-of-stock::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #dc3545;
    transform: rotate(45deg);
    z-index: 1;
}

/* Size Swatches */
.variant-option.size-swatch {
    min-width: 50px;
    height: 50px;
    padding: 0 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.variant-option.size-swatch:hover {
    border-color: #146eb4;
    background: rgba(20, 110, 180, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.variant-option.size-swatch.selected {
    border-color: #146eb4;
    background: #146eb4;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(20, 110, 180, 0.2);
}

.variant-option.size-swatch.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
    background: #f8f9fa;
}

/* Text/Button Swatches (default) */
.variant-option.text-swatch {
    padding: 10px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: #374151;
    text-align: center;
    min-width: 80px;
}

.variant-option.text-swatch:hover {
    border-color: #146eb4;
    background: rgba(20, 110, 180, 0.05);
}

.variant-option.text-swatch.selected {
    border-color: #146eb4;
    background: rgba(20, 110, 180, 0.1);
    color: #146eb4;
}

.variant-option.text-swatch.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Variant tooltip */
.variant-option[data-tooltip] {
    position: relative;
}

.variant-option[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    margin-bottom: 8px;
    z-index: 1000;
}

.variant-option[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: 3px;
    z-index: 1000;
}

/* Variant price display */
.variant-price {
    font-size: 0.85rem;
    color: #6c757d;
    margin-left: 0.5rem;
}

.variant-option.selected .variant-price {
    color: inherit;
    font-weight: 600;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .variant-option.color-swatch {
        width: 45px;
        height: 45px;
    }
    
    .variant-option.size-swatch {
        min-width: 45px;
        height: 45px;
        padding: 0 12px;
        font-size: 0.85rem;
    }
    
    .variant-options {
        gap: 0.5rem;
    }
}

/* Loading state */
.variant-option.loading {
    opacity: 0.6;
    pointer-events: none;
}

