/**
 * Custom Fields Styles for Osmani Theme
 * Styles for color swatches, size selection, and unavailable variations
 */

/* Color Swatches */
.osmani-color-swatch {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 5px;
    cursor: pointer;
    border: 2px solid #ddd;
    position: relative;
    transition: all 0.3s ease;
    background-size: cover;
    background-position: center;
}

.osmani-color-swatch:hover {
    border-color: #333;
    transform: scale(1.1);
}

.osmani-color-swatch.selected {
    border-color: #f7a659;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(247, 166, 89, 0.3);
}

.osmani-color-swatch.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.osmani-color-swatch.unavailable::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 30px;
    background: #999;
    transform: translate(-50%, -50%) rotate(45deg);
    pointer-events: none;
}

.osmani-color-swatch.unavailable::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 30px;
    background: #999;
    transform: translate(-50%, -50%) rotate(-45deg);
    pointer-events: none;
}

/* Size Selection */
.osmani-size-option {
    display: inline-block;
    padding: 8px 16px;
    margin: 5px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    min-width: 60px;
    text-align: center;
}

.osmani-size-option:hover {
    border-color: #333;
    background: #f9f9f9;
}

.osmani-size-option.selected {
    border-color: #f7a659;
    background: rgba(247, 166, 89, 0.1);
    color: #f7a659;
}

.osmani-size-option.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
}

.osmani-size-option.unavailable:hover {
    border-color: #ddd;
    background: #f5f5f5;
}

/* Custom Fields Container */
.osmani-custom-fields-container {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.osmani-custom-fields-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.osmani-custom-field-group {
    margin-bottom: 20px;
}

.osmani-custom-field-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #555;
}

/* Loading States */
.osmani-custom-fields-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.osmani-custom-fields-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #f7a659;
    border-radius: 50%;
    animation: osmani-spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes osmani-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .osmani-color-swatch {
        width: 35px;
        height: 35px;
        margin: 3px;
    }
    
    .osmani-size-option {
        padding: 6px 12px;
        margin: 3px;
        font-size: 14px;
    }
    
    .osmani-custom-fields-container {
        margin: 15px 0;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .osmani-color-swatch {
        width: 30px;
        height: 30px;
        margin: 2px;
    }
    
    .osmani-size-option {
        padding: 5px 10px;
        margin: 2px;
        font-size: 13px;
        min-width: 50px;
    }
}