/**
 * Force Colors Immediate - PROTECT COLOR SWATCHES
 * إجبار الألوان فوراً - حماية السواتشات الملونة
 */

/* ========================================
   IMMEDIATE COLOR PROTECTION
   ======================================== */

/* Force color swatches to be visible and colored immediately */
.cfvsw-swatches-option[data-type="color"],
.cfvsw-swatches-option[data-type="colour"],
.cfvsw-swatches-option.color-swatch-active,
.cfvsw-swatches-option[data-attribute_type="color"],
.cfvsw-swatches-option[data-attribute_type="colour"] {
    /* Force display */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    
    /* Force background properties */
    background-image: none !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: scroll !important;
    background-clip: border-box !important;
    background-origin: padding-box !important;
    
    /* Force positioning */
    position: relative !important;
    z-index: 999 !important;
    float: none !important;
    clear: none !important;
    
    /* Force sizing */
    box-sizing: border-box !important;
    min-width: 60px !important;
    min-height: 60px !important;
    
    /* Force borders and shadows */
    border: 3px solid rgba(255, 255, 255, 0.9) !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    
    /* Force text */
    color: transparent !important;
    text-align: center !important;
    line-height: 1 !important;
    
    /* Force transitions */
    transition: all 0.3s ease !important;
}

/* Force inner content to be transparent */
.cfvsw-swatches-option[data-type="color"] .cfvsw-swatch-inner,
.cfvsw-swatches-option[data-type="colour"] .cfvsw-swatch-inner,
.cfvsw-swatches-option.color-swatch-active .cfvsw-swatch-inner {
    color: transparent !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: -9999px !important;
    overflow: hidden !important;
}

/* ========================================
   SPECIFIC COLOR FORCING
   ======================================== */

/* Red - أحمر */
.cfvsw-swatches-option[data-slug*="red"],
.cfvsw-swatches-option[data-slug*="أحمر"],
.cfvsw-swatches-option[data-value*="red"],
.cfvsw-swatches-option[data-value*="أحمر"] {
    background-color: #ff0000 !important;
    background: #ff0000 !important;
}

/* Blue - أزرق */
.cfvsw-swatches-option[data-slug*="blue"],
.cfvsw-swatches-option[data-slug*="أزرق"],
.cfvsw-swatches-option[data-slug*="الازرق"],
.cfvsw-swatches-option[data-value*="blue"],
.cfvsw-swatches-option[data-value*="أزرق"],
.cfvsw-swatches-option[data-value*="الازرق"] {
    background-color: #0000ff !important;
    background: #0000ff !important;
}

/* Green - أخضر */
.cfvsw-swatches-option[data-slug*="green"],
.cfvsw-swatches-option[data-slug*="أخضر"],
.cfvsw-swatches-option[data-slug*="اخضر"],
.cfvsw-swatches-option[data-value*="green"],
.cfvsw-swatches-option[data-value*="أخضر"],
.cfvsw-swatches-option[data-value*="اخضر"] {
    background-color: #00ff00 !important;
    background: #00ff00 !important;
}

/* Yellow - أصفر */
.cfvsw-swatches-option[data-slug*="yellow"],
.cfvsw-swatches-option[data-slug*="أصفر"],
.cfvsw-swatches-option[data-value*="yellow"],
.cfvsw-swatches-option[data-value*="أصفر"] {
    background-color: #ffff00 !important;
    background: #ffff00 !important;
}

/* Purple - بنفسجي */
.cfvsw-swatches-option[data-slug*="purple"],
.cfvsw-swatches-option[data-slug*="بنفسجي"],
.cfvsw-swatches-option[data-slug*="بنفسج"],
.cfvsw-swatches-option[data-value*="purple"],
.cfvsw-swatches-option[data-value*="بنفسجي"],
.cfvsw-swatches-option[data-value*="بنفسج"] {
    background-color: #800080 !important;
    background: #800080 !important;
}

/* Orange - برتقالي */
.cfvsw-swatches-option[data-slug*="orange"],
.cfvsw-swatches-option[data-slug*="برتقالي"],
.cfvsw-swatches-option[data-value*="orange"],
.cfvsw-swatches-option[data-value*="برتقالي"] {
    background-color: #ffa500 !important;
    background: #ffa500 !important;
}

/* Pink - وردي */
.cfvsw-swatches-option[data-slug*="pink"],
.cfvsw-swatches-option[data-slug*="وردي"],
.cfvsw-swatches-option[data-value*="pink"],
.cfvsw-swatches-option[data-value*="وردي"] {
    background-color: #ffc0cb !important;
    background: #ffc0cb !important;
}

/* Brown - بني */
.cfvsw-swatches-option[data-slug*="brown"],
.cfvsw-swatches-option[data-slug*="بني"],
.cfvsw-swatches-option[data-value*="brown"],
.cfvsw-swatches-option[data-value*="بني"] {
    background-color: #a52a2a !important;
    background: #a52a2a !important;
}

/* Black - أسود */
.cfvsw-swatches-option[data-slug*="black"],
.cfvsw-swatches-option[data-slug*="أسود"],
.cfvsw-swatches-option[data-value*="black"],
.cfvsw-swatches-option[data-value*="أسود"] {
    background-color: #000000 !important;
    background: #000000 !important;
}

/* White - أبيض */
.cfvsw-swatches-option[data-slug*="white"],
.cfvsw-swatches-option[data-slug*="أبيض"],
.cfvsw-swatches-option[data-value*="white"],
.cfvsw-swatches-option[data-value*="أبيض"] {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border-color: #ddd !important;
}

/* Gray - رمادي */
.cfvsw-swatches-option[data-slug*="gray"],
.cfvsw-swatches-option[data-slug*="grey"],
.cfvsw-swatches-option[data-slug*="رمادي"],
.cfvsw-swatches-option[data-value*="gray"],
.cfvsw-swatches-option[data-value*="grey"],
.cfvsw-swatches-option[data-value*="رمادي"] {
    background-color: #808080 !important;
    background: #808080 !important;
}

/* ========================================
   HOVER AND SELECTION STATES
   ======================================== */

/* Hover effects */
.cfvsw-swatches-option[data-type="color"]:hover,
.cfvsw-swatches-option[data-type="colour"]:hover,
.cfvsw-swatches-option.color-swatch-active:hover {
    transform: translateY(-4px) scale(1.05) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15) !important;
    border-color: rgba(0, 122, 255, 0.5) !important;
}

/* Selected state */
.cfvsw-swatches-option[data-type="color"].cfvsw-selected-swatch,
.cfvsw-swatches-option[data-type="colour"].cfvsw-selected-swatch,
.cfvsw-swatches-option.color-swatch-active.cfvsw-selected-swatch {
    border-color: #007AFF !important;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* ========================================
   CONTAINER STYLING
   ======================================== */

/* Container styling */
.cfvsw-swatches-container.has-color-swatches {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin: 20px 0 !important;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .cfvsw-swatches-option[data-type="color"],
    .cfvsw-swatches-option[data-type="colour"],
    .cfvsw-swatches-option.color-swatch-active {
        min-width: 60px !important;
        min-height: 60px !important;
        border-radius: 12px !important;
        margin: 4px !important;
    }
    
    .cfvsw-swatches-option[data-type="color"]:hover,
    .cfvsw-swatches-option[data-type="colour"]:hover,
    .cfvsw-swatches-option.color-swatch-active:hover {
        transform: translateY(-2px) scale(1.03) !important;
    }
}

@media (max-width: 480px) {
    .cfvsw-swatches-option[data-type="color"],
    .cfvsw-swatches-option[data-type="colour"],
    .cfvsw-swatches-option.color-swatch-active {
        min-width: 50px !important;
        min-height: 50px !important;
        border-radius: 10px !important;
        margin: 3px !important;
    }
}

/* ========================================
   OVERRIDE ANY CONFLICTING STYLES
   ======================================== */

/* Override any styles that might interfere */
.cfvsw-swatches-option[data-type="color"],
.cfvsw-swatches-option[data-type="colour"],
.cfvsw-swatches-option.color-swatch-active {
    /* Force these properties to override any conflicting styles */
    background-attachment: scroll !important;
    background-clip: border-box !important;
    background-origin: padding-box !important;
    background-position-x: 0 !important;
    background-position-y: 0 !important;
    background-size: auto !important;
    
    /* Ensure proper display */
    box-sizing: border-box !important;
    float: none !important;
    clear: none !important;
    position: relative !important;
    z-index: 999 !important;
    
    /* Force text properties */
    text-decoration: none !important;
    text-transform: none !important;
    text-shadow: none !important;
    font-weight: normal !important;
    font-style: normal !important;
    font-variant: normal !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    white-space: normal !important;
}

/* ========================================
   PROTECTION FROM SWATCHES.JS
   ======================================== */

/* Override any inline styles that swatches.js might add */
.cfvsw-swatches-option[style*="background-color"] {
    background-color: var(--swatch-color, inherit) !important;
    background: var(--swatch-color, inherit) !important;
}

.cfvsw-swatches-option[style*="background-image"] {
    background-image: none !important;
    background-color: var(--swatch-color, inherit) !important;
    background: var(--swatch-color, inherit) !important;
}

/* Force override any swatches.js styling */
.cfvsw-swatches-option[style*="display"] {
    display: block !important;
}

.cfvsw-swatches-option[style*="visibility"] {
    visibility: visible !important;
}

.cfvsw-swatches-option[style*="opacity"] {
    opacity: 1 !important;
}

/* ========================================
   MAXIMUM PRIORITY OVERRIDES
   ======================================== */

/* Use maximum specificity to override everything */
body .cfvsw-swatches-option[data-type="color"],
body .cfvsw-swatches-option[data-type="colour"],
body .cfvsw-swatches-option.color-swatch-active {
    /* These rules have maximum priority */
    background: var(--swatch-color, inherit) !important;
    background-color: var(--swatch-color, inherit) !important;
    background-image: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 999 !important;
}

/* Override any !important rules from other sources */
body .cfvsw-swatches-option[data-type="color"] *,
body .cfvsw-swatches-option[data-type="colour"] *,
body .cfvsw-swatches-option.color-swatch-active * {
    background-image: none !important;
    background-repeat: no-repeat !important;
}

