/* ========================================
   APPLE-INSPIRED VARIATIONS SWATCHES
   Enhanced Design with Smooth Animations
   ======================================== */

/* ========================================
   SHIPPING SELECTOR - iOS PILL STYLE
   Elegant Toggle with Dynamic Colors
   ======================================== */

/* Container wrapper */
#shipping-methods {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0 !important;
    margin: 20px auto !important;
    padding: 4px !important;
    background: rgba(120, 120, 128, 0.12) !important;
    border-radius: 10px !important;
    max-width: fit-content !important;
    position: relative !important;
}

/* Hide actual radio */
.codplugin-shipping-input {
    opacity: 0 !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* Option container */
.codplugin-shipping-option {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Label as Pill Segment */
.codplugin-shipping-label {
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 10px 20px !important;
    min-height: auto !important;
    min-width: 120px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    color: #333 !important;
    box-shadow: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: visible !important;
    margin: 0 !important;
}

/* Icon before text */
.codplugin-shipping-label::before {
    content: '🏠' !important;
    position: relative !important;
    display: inline-block !important;
    font-size: 16px !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    transition: transform 0.2s ease !important;
}

/* Different icons */
.codplugin-shipping-option:nth-child(1) .codplugin-shipping-label::before {
    content: '🏠' !important;
}

.codplugin-shipping-option:nth-child(2) .codplugin-shipping-label::before {
    content: '🏢' !important;
}

.codplugin-shipping-option:nth-child(3) .codplugin-shipping-label::before {
    content: '📦' !important;
}

.codplugin-shipping-option:nth-child(4) .codplugin-shipping-label::before {
    content: '🚀' !important;
}

/* No checkmark indicator - clean design */
.codplugin-shipping-label::after {
    display: none !important;
}

/* Text styling */
.codplugin-shipping-label,
.codplugin-shipping-label *,
.codplugin-shipping-label span,
.codplugin-shipping-label bdi {
    color: #666 !important;
    font-weight: 500 !important;
}

/* Hover Effect */
.codplugin-shipping-label:hover {
    color: #333 !important;
}

.codplugin-shipping-label:hover::before {
    transform: scale(1.1) !important;
}

/* SELECTED STATE - White pill with shadow */
.codplugin-shipping-input:checked+.codplugin-shipping-label {
    background: #fff !important;
    border: none !important;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.08) !important;
    color: #000 !important;
    font-weight: 600 !important;
    z-index: 2 !important;
}

/* Selected icon */
.codplugin-shipping-input:checked+.codplugin-shipping-label::before {
    content: '🏠' !important;
    position: relative !important;
    display: inline-block !important;
    font-size: 16px !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: scale(1.1) !important;
    z-index: auto !important;
}

/* Keep different icons for selected */
.codplugin-shipping-option:nth-child(1) .codplugin-shipping-input:checked+.codplugin-shipping-label::before {
    content: '🏠' !important;
}

.codplugin-shipping-option:nth-child(2) .codplugin-shipping-input:checked+.codplugin-shipping-label::before {
    content: '🏢' !important;
}

.codplugin-shipping-option:nth-child(3) .codplugin-shipping-input:checked+.codplugin-shipping-label::before {
    content: '📦' !important;
}

.codplugin-shipping-option:nth-child(4) .codplugin-shipping-input:checked+.codplugin-shipping-label::before {
    content: '🚀' !important;
}

/* Selected text color - dark */
.codplugin-shipping-input:checked+.codplugin-shipping-label,
.codplugin-shipping-input:checked+.codplugin-shipping-label *,
.codplugin-shipping-input:checked+.codplugin-shipping-label span,
.codplugin-shipping-input:checked+.codplugin-shipping-label bdi {
    color: #000 !important;
    font-weight: 600 !important;
}

/* RTL Support */
.rtl #shipping-methods {
    direction: rtl !important;
}

/* Preset 2 specific - same style */
.codform-preset-2 #shipping-methods {
    background: rgba(120, 120, 128, 0.12) !important;
    border-radius: 10px !important;
    padding: 4px !important;
}

.codform-preset-2 .codplugin-shipping-input:checked+.codplugin-shipping-label::before {
    content: '🏠' !important;
    position: relative !important;
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    z-index: auto !important;
}

.codform-preset-2 .codplugin-shipping-input:checked+.codplugin-shipping-label {
    color: #000 !important;
    background: #fff !important;
}

/* Mobile responsive */
@media (max-width: 480px) {
    #shipping-methods {
        padding: 3px !important;
    }

    .codplugin-shipping-label {
        padding: 8px 14px !important;
        font-size: 11px !important;
        min-width: 90px !important;
        gap: 4px !important;
    }

    .codplugin-shipping-label::before {
        font-size: 14px !important;
    }
}

/* ========================================
   END SHIPPING SELECTOR
   ======================================== */

/* ========================================
   CRITICAL FIX FOR COLOR SWATCHES DISPLAY
   ======================================== */

/* Force color display for color type swatches */
.cfvsw-swatches-option[data-slug*="color"],
.cfvsw-swatches-option[data-slug*="colour"],
.cfvsw-swatches-option[data-type="color"],
.cfvsw-swatches-option[data-attribute_type="color"],
.cfvsw-swatches-option[data-attribute_type="colour"],
.cfvsw-swatches-option[data-attribute_type="Color"],
.cfvsw-swatches-option[data-attribute_type="Colour"] {
    background: var(--swatch-color, #f5f5f7) !important;
    border: 3px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04) !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Ensure color swatches show actual colors */
.cfvsw-swatches-option[data-slug*="color"]::before,
.cfvsw-swatches-option[data-slug*="colour"]::before,
.cfvsw-swatches-option[data-type="color"]::before,
.cfvsw-swatches-option[data-attribute_type="color"]::before,
.cfvsw-swatches-option[data-attribute_type="colour"]::before,
.cfvsw-swatches-option[data-attribute_type="Color"]::before,
.cfvsw-swatches-option[data-attribute_type="Colour"]::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: var(--swatch-color, #f5f5f7) !important;
    z-index: 1 !important;
}

/* Specific color values for common colors */
.cfvsw-swatches-option[data-slug*="red"],
.cfvsw-swatches-option[data-slug*="أحمر"] {
    --swatch-color: #ff0000 !important;
}

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

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

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

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

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

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

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

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

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

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

/* Override any plugin styles that hide color swatches */
.cfvsw-swatches-option[data-slug*="color"] .cfvsw-swatch-inner,
.cfvsw-swatches-option[data-slug*="colour"] .cfvsw-swatch-inner,
.cfvsw-swatches-option[data-type="color"] .cfvsw-swatch-inner,
.cfvsw-swatches-option[data-attribute_type="color"] .cfvsw-swatch-inner,
.cfvsw-swatches-option[data-attribute_type="colour"] .cfvsw-swatch-inner,
.cfvsw-swatches-option[data-attribute_type="Color"] .cfvsw-swatch-inner,
.cfvsw-swatches-option[data-attribute_type="Colour"] .cfvsw-swatch-inner {
    color: transparent !important;
    background: transparent !important;
    z-index: 2 !important;
    position: relative !important;
}

/* Force color display for WooCommerce variation swatches */
.variations .value .cfvsw-swatches-option[data-slug*="color"],
.variations .value .cfvsw-swatches-option[data-slug*="colour"],
.variations .value .cfvsw-swatches-option[data-type="color"],
.variations .value .cfvsw-swatches-option[data-attribute_type="color"],
.variations .value .cfvsw-swatches-option[data-attribute_type="colour"],
.variations .value .cfvsw-swatches-option[data-attribute_type="Color"],
.variations .value .cfvsw-swatches-option[data-attribute_type="Colour"] {
    background: var(--swatch-color, #f5f5f7) !important;
    border: 3px solid rgba(255, 255, 255, 0.9) !important;
}

/* Ensure color swatches are visible in all contexts */
.cfvsw-swatches-container .cfvsw-swatches-option[data-slug*="color"],
.cfvsw-swatches-container .cfvsw-swatches-option[data-slug*="colour"],
.cfvsw-swatches-container .cfvsw-swatches-option[data-type="color"],
.cfvsw-swatches-container .cfvsw-swatches-option[data-attribute_type="color"],
.cfvsw-swatches-container .cfvsw-swatches-option[data-attribute_type="colour"],
.cfvsw-swatches-container .cfvsw-swatches-option[data-attribute_type="Color"],
.cfvsw-swatches-container .cfvsw-swatches-option[data-attribute_type="Colour"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: var(--swatch-color, #f5f5f7) !important;
}

/* ========================================
   LIST DROPDOWN STYLING
   ======================================== */

/* Select dropdown styling for List display method */
.cfvsw-swatches-container select,
.cfvsw-swatches-container .cfvsw-swatch-select,
select[name*="attribute_"],
select[id*="pa_"],
select[id*="attribute_"] {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    min-height: 50px !important;
    width: 100% !important;
    max-width: 300px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
    padding-right: 40px !important;
}

/* Hover state for select dropdowns */
.cfvsw-swatches-container select:hover,
.cfvsw-swatches-container .cfvsw-swatch-select:hover,
select[name*="attribute_"]:hover,
select[id*="pa_"]:hover,
select[id*="attribute_"]:hover {
    border-color: var(--primary-color, #007AFF) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px) !important;
}

/* Focus state for select dropdowns */
.cfvsw-swatches-container select:focus,
.cfvsw-swatches-container .cfvsw-swatch-select:focus,
select[name*="attribute_"]:focus,
select[id*="pa_"]:focus,
select[id*="attribute_"]:focus {
    outline: none !important;
    border-color: var(--primary-color, #007AFF) !important;
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--primary-color, #007AFF) 20%, transparent),
        0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Dropdown options styling */
.cfvsw-swatches-container select option,
.cfvsw-swatches-container .cfvsw-swatch-select option,
select[name*="attribute_"] option,
select[id*="pa_"] option,
select[id*="attribute_"] option {
    background: rgba(255, 255, 255, 0.98) !important;
    color: #333 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 12px 16px !important;
    border: none !important;
    cursor: pointer !important;
}

/* Selected option styling */
.cfvsw-swatches-container select option:checked,
.cfvsw-swatches-container .cfvsw-swatch-select option:checked,
select[name*="attribute_"] option:checked,
select[id*="pa_"] option:checked,
select[id*="attribute_"] option:checked {
    background: linear-gradient(135deg, var(--primary-color, #007AFF) 0%, var(--secondary-color, #5856D6) 100%) !important;
    color: white !important;
    font-weight: 600 !important;
}

/* Hover state for dropdown options */
.cfvsw-swatches-container select option:hover,
.cfvsw-swatches-container .cfvsw-swatch-select option:hover,
select[name*="attribute_"] option:hover,
select[id*="pa_"] option:hover,
select[id*="attribute_"] option:hover {
    background: color-mix(in srgb, var(--primary-color, #007AFF) 10%, transparent) !important;
    color: #333 !important;
}

/* Disabled state for select dropdowns */
.cfvsw-swatches-container select:disabled,
.cfvsw-swatches-container .cfvsw-swatch-select:disabled,
select[name*="attribute_"]:disabled,
select[id*="pa_"]:disabled,
select[id*="attribute_"]:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

/* RTL Support for select dropdowns */
.rtl .cfvsw-swatches-container select,
.rtl .cfvsw-swatches-container .cfvsw-swatch-select,
.rtl select[name*="attribute_"],
.rtl select[id*="pa_"],
.rtl select[id*="attribute_"] {
    background-position: left 12px center !important;
    padding-left: 40px !important;
    padding-right: 16px !important;
}

/* Mobile responsive for select dropdowns */
@media (max-width: 768px) {

    .cfvsw-swatches-container select,
    .cfvsw-swatches-container .cfvsw-swatch-select,
    select[name*="attribute_"],
    select[id*="pa_"],
    select[id*="attribute_"] {
        font-size: 13px !important;
        padding: 10px 14px !important;
        padding-right: 35px !important;
        min-height: 45px !important;
        background-size: 14px !important;
        background-position: right 10px center !important;
    }

    .rtl .cfvsw-swatches-container select,
    .rtl .cfvsw-swatches-container .cfvsw-swatch-select,
    .rtl select[name*="attribute_"],
    .rtl select[id*="pa_"],
    .rtl select[id*="attribute_"] {
        padding-left: 35px !important;
        padding-right: 14px !important;
        background-position: left 10px center !important;
    }
}

@media (max-width: 480px) {

    .cfvsw-swatches-container select,
    .cfvsw-swatches-container .cfvsw-swatch-select,
    select[name*="attribute_"],
    select[id*="pa_"],
    select[id*="attribute_"] {
        font-size: 12px !important;
        padding: 8px 12px !important;
        padding-right: 30px !important;
        min-height: 40px !important;
        background-size: 12px !important;
        background-position: right 8px center !important;
    }

    .rtl .cfvsw-swatches-container select,
    .rtl .cfvsw-swatches-container .cfvsw-swatch-select,
    .rtl select[name*="attribute_"],
    .rtl select[id*="pa_"],
    .rtl select[id*="attribute_"] {
        padding-left: 30px !important;
        padding-right: 12px !important;
        background-position: left 8px center !important;
    }
}

/* Main container styling - Compact */
.cfvsw-swatches-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 16px 12px 12px 12px !important;
    margin: 10px 0 !important;
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.04) !important;
    position: relative !important;
    overflow: visible !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
}

/* Subtle gradient border at top */
.cfvsw-swatches-container::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 2px !important;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--primary-color, #007AFF) 25%,
            var(--secondary-color, #5856D6) 75%,
            transparent 100%) !important;
    opacity: 0.4 !important;
}

/* Individual swatch styling - Compact */
.cfvsw-swatches-option {
    position: relative !important;
    min-width: 70px !important;
    min-height: 70px !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid rgba(0, 0, 0, 0.08) !important;
    cursor: pointer !important;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #1d1d1f !important;
    text-align: center !important;
    padding: 12px !important;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.04) !important;
    transform-origin: center center !important;
    will-change: transform, box-shadow, border-color !important;
    user-select: none !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* Enhanced hover effects - Compact */
.cfvsw-swatches-option:hover {
    transform: translateY(-4px) scale(1.08) !important;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.15),
        0 6px 16px rgba(0, 0, 0, 0.1) !important;
    border-color: color-mix(in srgb, var(--primary-color, #007AFF) 50%, transparent) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
}

/* Selected state with dynamic gradient - Compact */
.cfvsw-swatches-option.cfvsw-selected-swatch {
    background: linear-gradient(135deg, var(--primary-color, #007AFF) 0%, var(--secondary-color, #5856D6) 100%) !important;
    border-color: var(--primary-color, #007AFF) !important;
    color: white !important;
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow:
        0 10px 28px color-mix(in srgb, var(--primary-color, #007AFF) 40%, transparent),
        0 5px 15px color-mix(in srgb, var(--primary-color, #007AFF) 25%, transparent) !important;
    animation: swatchSelectEnhanced 0.8s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

/* Selection indicator with checkmark - Compact */
.cfvsw-swatches-option.cfvsw-selected-swatch::before {
    content: '✓' !important;
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 22px !important;
    height: 22px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: bold !important;
    color: var(--primary-color, #007AFF) !important;
    animation: checkmarkAppearEnhanced 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* Inner swatch content - Compact */
.cfvsw-swatch-inner {
    font-weight: 600 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    transition: all 0.3s ease !important;
    letter-spacing: -0.01em !important;
}

/* Enhanced ripple effect */
.cfvsw-swatches-option::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 0 !important;
    height: 0 !important;
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--primary-color, #007AFF) 25%, transparent) !important;
    transform: translate(-50%, -50%) !important;
    transition: width 0.8s, height 0.8s !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

.cfvsw-swatches-option:active::after {
    width: 150px !important;
    height: 150px !important;
}

/* Continuous pulse animation for selected swatch */
.cfvsw-swatches-option.cfvsw-selected-swatch {
    animation: swatchPulseEnhanced 3s ease-in-out infinite !important;
}

/* Enhanced keyframe animations */
@keyframes swatchSelectEnhanced {
    0% {
        transform: translateY(0) scale(1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    }

    40% {
        transform: translateY(-6px) scale(1.1);
        box-shadow: 0 12px 32px color-mix(in srgb, var(--primary-color, #007AFF) 50%, transparent);
    }

    100% {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 6px 20px color-mix(in srgb, var(--primary-color, #007AFF) 35%, transparent);
    }
}

@keyframes checkmarkAppearEnhanced {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.2) rotate(-90deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes swatchPulseEnhanced {

    0%,
    100% {
        box-shadow: 0 6px 20px color-mix(in srgb, var(--primary-color, #007AFF) 35%, transparent);
    }

    50% {
        box-shadow: 0 6px 20px color-mix(in srgb, var(--primary-color, #007AFF) 60%, transparent);
    }
}

/* Color swatches specific styling */
.cfvsw-swatches-option[data-slug*="color"],
.cfvsw-swatches-option[data-slug*="colour"] {
    background: var(--swatch-color, #f5f5f7) !important;
    border: 3px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.cfvsw-swatches-option[data-slug*="color"]:hover,
.cfvsw-swatches-option[data-slug*="colour"]:hover {
    border-color: color-mix(in srgb, var(--primary-color, #007AFF) 60%, transparent) !important;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-6px) scale(1.08) !important;
}

.cfvsw-swatches-option[data-slug*="color"].cfvsw-selected-swatch,
.cfvsw-swatches-option[data-slug*="colour"].cfvsw-selected-swatch {
    border-color: var(--primary-color, #007AFF) !important;
    box-shadow:
        0 12px 36px color-mix(in srgb, var(--primary-color, #007AFF) 40%, transparent),
        0 6px 20px color-mix(in srgb, var(--primary-color, #007AFF) 20%, transparent) !important;
}

/* Size swatches specific styling - Compact */
.cfvsw-swatches-option[data-slug*="size"] {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(248, 248, 250, 0.95) 100%) !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    letter-spacing: -0.02em !important;
}

/* Responsive design - Compact */
@media (max-width: 768px) {
    .cfvsw-swatches-container {
        padding: 12px !important;
        gap: 10px !important;
        border-radius: 14px !important;
        margin: 8px 0 !important;
        justify-content: center !important;
        position: relative !important;
    }

    .cfvsw-swatches-option {
        min-width: 65px !important;
        min-height: 65px !important;
        border-radius: 14px !important;
        font-size: 12px !important;
        padding: 10px !important;
        flex: 0 0 auto !important;
    }

    .cfvsw-swatches-option:hover {
        transform: translateY(-1px) scale(1.02) !important;
    }

    .cfvsw-swatches-option.cfvsw-selected-swatch::before {
        width: 14px !important;
        height: 14px !important;
        font-size: 9px !important;
        top: 3px !important;
        right: 3px !important;
    }

    /* Mobile compact for many swatches */
    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+4)) {
        gap: 6px !important;
        padding: 8px !important;
    }

    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+4)) .cfvsw-swatches-option {
        min-width: 45px !important;
        min-height: 45px !important;
        font-size: 10px !important;
        padding: 4px !important;
    }

    /* Reset button mobile adjustments */
    .reset_variations {
        left: 6px !important;
        top: 6px !important;
        padding: 6px 10px !important;
        font-size: 11px !important;
        display: block !important;
        visibility: visible !important;
    }

    .rtl .reset_variations {
        right: 190px !important;
        left: auto !important;
    }

    /* Horizontal layout for better UX */
    .cfvsw-swatches-option {
        flex: 0 0 auto !important;
        margin-bottom: 0 !important;
    }
}

@media (max-width: 480px) {
    .cfvsw-swatches-container {
        padding: 14px 10px 10px 10px !important;
        gap: 10px !important;
        border-radius: 16px !important;
        justify-content: center !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        position: relative !important;
    }

    .cfvsw-swatches-option {
        min-width: 60px !important;
        min-height: 60px !important;
        border-radius: 12px !important;
        font-size: 12px !important;
        padding: 8px !important;
        width: auto !important;
        max-width: none !important;
        flex: 0 0 auto !important;
        margin-bottom: 0 !important;
    }

    .cfvsw-swatches-option.cfvsw-selected-swatch::before {
        width: 16px !important;
        height: 16px !important;
        font-size: 10px !important;
        top: 4px !important;
        right: 4px !important;
    }

    /* Reset button mobile adjustments */
    .reset_variations {
        left: 4px !important;
        top: 4px !important;
        padding: 5px 8px !important;
        font-size: 10px !important;
        display: block !important;
        visibility: visible !important;
    }

    .rtl .reset_variations {
        right: 190px !important;
        left: auto !important;
    }
}

/* Loading state */
.cfvsw-swatches-option.loading {
    pointer-events: none !important;
    opacity: 0.7 !important;
    animation: swatchLoadingEnhanced 2s ease-in-out infinite !important;
}

@keyframes swatchLoadingEnhanced {

    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.08);
    }
}

/* Accessibility improvements */
.cfvsw-swatches-option:focus {
    outline: 3px solid var(--primary-color, #007AFF) !important;
    outline-offset: 3px !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.cfvsw-swatches-option:focus-visible {
    outline: 3px solid var(--primary-color, #007AFF) !important;
    outline-offset: 3px !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cfvsw-swatches-option {
        border-width: 3px !important;
        border-color: #000 !important;
    }

    .cfvsw-swatches-option.cfvsw-selected-swatch {
        border-color: #000 !important;
        background: #000 !important;
        color: #fff !important;
    }

    .cfvsw-swatches-option.cfvsw-selected-swatch::before {
        background: #fff !important;
        color: #000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .cfvsw-swatches-option,
    .cfvsw-swatches-option:hover,
    .cfvsw-swatches-option.cfvsw-selected-swatch {
        transition: none !important;
        animation: none !important;
    }

    .cfvsw-swatches-option::after {
        display: none !important;
    }

    .cfvsw-swatches-option.cfvsw-selected-swatch::before {
        animation: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .cfvsw-swatches-container {
        background: rgba(28, 28, 30, 0.85) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }

    .cfvsw-swatches-option {
        background: rgba(44, 44, 46, 0.95) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
        color: #fff !important;
    }

    .cfvsw-swatches-option:hover {
        background: rgba(58, 58, 60, 0.98) !important;
        border-color: color-mix(in srgb, var(--primary-color, #007AFF) 40%, transparent) !important;
    }

    .cfvsw-swatches-option[data-slug*="size"] {
        background: linear-gradient(135deg,
                rgba(44, 44, 46, 0.95) 0%,
                rgba(58, 58, 60, 0.95) 100%) !important;
    }
}

/* Print styles */
@media print {
    .cfvsw-swatches-container {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .cfvsw-swatches-option {
        background: white !important;
        border: 1px solid #ccc !important;
        color: black !important;
        box-shadow: none !important;
    }

    .cfvsw-swatches-option.cfvsw-selected-swatch {
        background: #f0f0f0 !important;
        border-color: #007AFF !important;
        color: black !important;
    }
}

/* ========================================
   DYNAMIC SHIPPING METHODS STYLING
   Premium Card-Based Design with Animations
   Colors from settings-toggle (CSS variables)
   ======================================== */

/* Shipping Section Title */
.shipping-preset2-title,
#codplugin-preset2-shipping>div:first-child,
[class*="shipping"]>.title,
.codform-preset-2 .shipping-preset2-title {
    font-size: 1.2em !important;
    font-weight: 700 !important;
    text-align: center !important;
    color: var(--primary-color, #007AFF) !important;
    margin-bottom: 16px !important;
    display: block !important;
    position: relative !important;
}

/* Shipping Methods Container - HORIZONTAL Layout */
#shipping-methods {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin: 16px auto !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Shipping Option Container - Side by Side */
.codplugin-shipping-option {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    flex: 1 1 0 !important;
    min-width: 100px !important;
    max-width: 150px !important;
}

/* Hide actual radio button */
.codplugin-shipping-input {
    opacity: 0 !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* Label as Card - Premium Design with Dynamic Colors */
/* Uses CSS variables from settings-toggle */
.codplugin-shipping-label {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px 12px 12px !important;
    min-height: 90px !important;
    width: 100% !important;
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(248, 250, 252, 0.95) 100%) !important;
    border: 2px solid rgba(128, 128, 128, 0.15) !important;
    border-radius: 14px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-align: center !important;
    color: #333 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    overflow: visible !important;
    margin: 0 !important;
    animation: shippingCardFloat 3s ease-in-out infinite !important;
}

/* Ensure text inside label is always visible */
.codplugin-shipping-label,
.codplugin-shipping-label * {
    color: #333 !important;
}

/* Price text styling */
.codplugin-shipping-label .shipping-price,
.codplugin-shipping-label span,
.codplugin-shipping-label small {
    color: #555 !important;
    font-weight: 500 !important;
    font-size: 11px !important;
    margin-top: 4px !important;
    display: block !important;
}

/* Shipping Icon/Emoji Display */
.codplugin-shipping-label::before {
    content: '🏠' !important;
    position: relative !important;
    display: block !important;
    font-size: 24px !important;
    margin-bottom: 6px !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
}

/* Different icons for different shipping types */
.codplugin-shipping-option:nth-child(1) .codplugin-shipping-label::before {
    content: '🏠' !important;
}

.codplugin-shipping-option:nth-child(2) .codplugin-shipping-label::before {
    content: '🏢' !important;
}

.codplugin-shipping-option:nth-child(3) .codplugin-shipping-label::before {
    content: '📦' !important;
}

.codplugin-shipping-option:nth-child(4) .codplugin-shipping-label::before {
    content: '🚀' !important;
}

/* Selection indicator - Checkmark with Dynamic Color */
.codplugin-shipping-label::after {
    content: '' !important;
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--primary-color, #007AFF) 10%, transparent) !important;
    border: 2px solid color-mix(in srgb, var(--primary-color, #007AFF) 30%, transparent) !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Hover Effect - Uses CSS variable directly */
.codplugin-shipping-label:hover {
    border-color: var(--primary-color, #007AFF) !important;
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.06) !important;
    animation: none !important;
}

.codplugin-shipping-label:hover::before {
    transform: scale(1.15) rotate(5deg) !important;
}

/* Active/Click Effect */
.codplugin-shipping-label:active {
    transform: translateY(-1px) scale(0.98) !important;
    transition: all 0.1s ease !important;
}

/* Selected State - Uses CSS variable for border */
.codplugin-shipping-input:checked+.codplugin-shipping-label {
    background: linear-gradient(145deg, rgba(255, 255, 255, 1) 0%, rgba(245, 247, 250, 1) 100%) !important;
    border-color: var(--primary-color, #007AFF) !important;
    border-width: 2.5px !important;
    transform: translateY(-3px) scale(1.04) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    animation: selectedPulse 2s ease-in-out infinite !important;
}

/* Text color in selected state - must be dark for visibility */
.codplugin-shipping-input:checked+.codplugin-shipping-label,
.codplugin-shipping-input:checked+.codplugin-shipping-label * {
    color: #333 !important;
}

.codplugin-shipping-input:checked+.codplugin-shipping-label::before {
    transform: scale(1.12) !important;
}

/* Selected Checkmark with Dynamic Color */
.codplugin-shipping-input:checked+.codplugin-shipping-label::after {
    content: '✓' !important;
    background: var(--primary-color, #007AFF) !important;
    border-color: var(--primary-color, #007AFF) !important;
    color: white !important;
    font-size: 11px !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    animation: checkmarkBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Floating Animation for Cards */
@keyframes shippingCardFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-2px);
    }
}

/* Selected Card Pulse Animation */
@keyframes selectedPulse {

    0%,
    100% {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    50% {
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    }
}

/* Checkmark animation */
@keyframes checkmarkBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Focus State */
.codplugin-shipping-input:focus+.codplugin-shipping-label {
    outline: none !important;
    border-color: var(--primary-color, #007AFF) !important;
    box-shadow:
        0 0 0 4px color-mix(in srgb, var(--primary-color, #007AFF) 15%, transparent),
        0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* ========================================
   PRESET 2 SPECIFIC STYLES
   ======================================== */

.codform-preset-2 #codplugin-preset2-shipping {
    margin-top: 24px !important;
    padding: 20px !important;
    background: rgba(248, 250, 252, 0.6) !important;
    border-radius: 20px !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.codform-preset-2 #shipping-methods {
    justify-content: center !important;
    gap: 16px !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

.codform-preset-2 .codplugin-shipping-option {
    flex: 0 1 140px !important;
}

.codform-preset-2 .codplugin-shipping-label {
    min-height: 110px !important;
    padding: 24px 16px !important;
}

/* ========================================
   PRESET 1 SPECIFIC STYLES
   ======================================== */

.codform-preset-1 #shipping-methods {
    justify-content: center !important;
    gap: 14px !important;
    margin: 16px auto !important;
}

.codform-preset-1 .codplugin-shipping-label {
    min-height: 100px !important;
}

/* ========================================
   RTL SUPPORT
   ======================================== */

.rtl #shipping-methods {
    margin-left: 0 !important;
    margin-right: 0 !important;
    direction: rtl !important;
}

.rtl .codplugin-shipping-label {
    text-align: center !important;
}

.rtl .codplugin-shipping-label::after {
    right: auto !important;
    left: 10px !important;
}

/* ========================================
   RESPONSIVE DESIGN - Always Horizontal
   ======================================== */

@media (max-width: 768px) {
    #shipping-methods {
        gap: 10px !important;
        padding: 0 !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
    }

    .codplugin-shipping-option {
        flex: 1 1 0 !important;
        min-width: 80px !important;
        max-width: 130px !important;
    }

    .codplugin-shipping-label {
        min-height: 80px !important;
        padding: 12px 8px 10px !important;
        border-radius: 12px !important;
        font-size: 11px !important;
    }

    .codplugin-shipping-label::before {
        font-size: 20px !important;
        margin-bottom: 4px !important;
    }

    .codplugin-shipping-label::after {
        width: 16px !important;
        height: 16px !important;
        top: 6px !important;
        right: 6px !important;
        font-size: 9px !important;
    }

    .rtl .codplugin-shipping-label::after {
        right: auto !important;
        left: 6px !important;
    }

    .codplugin-shipping-label:hover {
        transform: translateY(-2px) scale(1.01) !important;
    }

    .codplugin-shipping-input:checked+.codplugin-shipping-label {
        transform: translateY(-2px) scale(1.02) !important;
    }
}

@media (max-width: 480px) {
    #shipping-methods {
        gap: 8px !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
    }

    .codplugin-shipping-option {
        flex: 1 1 0 !important;
        min-width: 70px !important;
        max-width: 110px !important;
    }

    .codplugin-shipping-label {
        min-height: 70px !important;
        padding: 10px 6px 8px !important;
        border-radius: 10px !important;
        font-size: 10px !important;
    }

    .codplugin-shipping-label::before {
        font-size: 18px !important;
        margin-bottom: 3px !important;
    }

    .codplugin-shipping-label::after {
        width: 14px !important;
        height: 14px !important;
        top: 4px !important;
        right: 4px !important;
        font-size: 8px !important;
    }

    .rtl .codplugin-shipping-label::after {
        right: auto !important;
        left: 4px !important;
    }
}

/* ========================================
   MOBILE RESPONSIVE FIXES
   Enhanced Mobile Layout with Better Flex Wrap
   ======================================== */

@media (max-width: 768px) {
    .cfvsw-swatches-container {
        padding: 16px 12px 12px 12px !important;
        gap: 8px !important;
        border-radius: 14px !important;
        justify-content: center !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        position: relative !important;
        align-items: flex-start !important;
        min-height: 80px !important;
    }

    .cfvsw-swatches-option {
        min-width: 55px !important;
        min-height: 55px !important;
        border-radius: 10px !important;
        font-size: 11px !important;
        padding: 6px !important;
        width: auto !important;
        max-width: none !important;
        flex: 0 0 auto !important;
        margin-bottom: 0 !important;
        margin-right: 4px !important;
        margin-left: 4px !important;
    }

    .cfvsw-swatches-option:hover {
        transform: translateY(-2px) scale(1.05) !important;
    }

    .cfvsw-swatches-option.cfvsw-selected-swatch::before {
        width: 14px !important;
        height: 14px !important;
        font-size: 9px !important;
        top: 3px !important;
        right: 3px !important;
    }

    /* Enhanced flex wrap for better mobile layout */
    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+4)) {
        gap: 6px !important;
        padding: 12px 10px 10px 10px !important;
        justify-content: flex-start !important;
    }

    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+4)) .cfvsw-swatches-option {
        min-width: 45px !important;
        min-height: 45px !important;
        font-size: 10px !important;
        padding: 4px !important;
        margin-right: 3px !important;
        margin-left: 3px !important;
    }

    /* Reset button mobile adjustments - Fixed positioning */
    .reset_variations {
        position: absolute !important;
        left: 8px !important;
        top: 8px !important;
        padding: 6px 10px !important;
        font-size: 11px !important;
        display: block !important;
        visibility: visible !important;
        z-index: 15 !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border: 2px solid rgba(0, 0, 0, 0.1) !important;
        border-radius: 8px !important;
        color: #555 !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        line-height: 1.3 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        white-space: nowrap !important;
        transform: none !important;
    }

    /* RTL Support for reset button - Fixed positioning */
    .rtl .reset_variations {
        left: auto !important;
        right: 8px !important;
        top: 8px !important;
    }

    /* Horizontal layout for better UX */
    .cfvsw-swatches-option {
        flex: 0 0 auto !important;
        margin-bottom: 0 !important;
    }
}

@media (max-width: 480px) {
    .cfvsw-swatches-container {
        padding: 14px 10px 10px 10px !important;
        gap: 6px !important;
        border-radius: 12px !important;
        justify-content: flex-start !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        position: relative !important;
        align-items: flex-start !important;
        min-height: 70px !important;
    }

    .cfvsw-swatches-option {
        min-width: 50px !important;
        min-height: 50px !important;
        border-radius: 8px !important;
        font-size: 10px !important;
        padding: 5px !important;
        width: auto !important;
        max-width: none !important;
        flex: 0 0 auto !important;
        margin-bottom: 0 !important;
        margin-right: 3px !important;
        margin-left: 3px !important;
    }

    .cfvsw-swatches-option.cfvsw-selected-swatch::before {
        width: 12px !important;
        height: 12px !important;
        font-size: 8px !important;
        top: 2px !important;
        right: 2px !important;
    }

    /* Enhanced flex wrap for small screens */
    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+3)) {
        gap: 4px !important;
        padding: 10px 8px 8px 8px !important;
        justify-content: flex-start !important;
    }

    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+3)) .cfvsw-swatches-option {
        min-width: 40px !important;
        min-height: 40px !important;
        font-size: 9px !important;
        padding: 3px !important;
        margin-right: 2px !important;
        margin-left: 2px !important;
    }

    /* Reset button mobile adjustments - Fixed positioning */
    .reset_variations {
        position: absolute !important;
        left: 6px !important;
        top: 6px !important;
        padding: 5px 8px !important;
        font-size: 10px !important;
        display: block !important;
        visibility: visible !important;
        z-index: 15 !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border: 2px solid rgba(0, 0, 0, 0.1) !important;
        border-radius: 6px !important;
        color: #555 !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        line-height: 1.2 !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
        white-space: nowrap !important;
        transform: none !important;
    }

    /* RTL Support for reset button - Fixed positioning */
    .rtl .reset_variations {
        left: auto !important;
        right: 6px !important;
        top: 6px !important;
    }
}

/* ========================================
   ENHANCED FLEX WRAP LAYOUT
   Better handling of multiple variations
   ======================================== */

/* Smart Layout for Variations Swatches */
.cfvsw-swatches-container {
    /* Enhanced flex layout */
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    text-align: center !important;
    width: 100% !important;
    gap: 8px !important;
    position: relative !important;
    min-height: 80px !important;
    box-sizing: border-box !important;
}

/* Ensure all swatches are centered regardless of count */
.cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(-n+2)) {
    justify-content: center !important;
}

.cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+3)) {
    justify-content: flex-start !important;
}

/* Force center alignment for all swatch groups */
.cfvsw-swatches-container>* {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

/* Ensure reset button is always visible */
.reset_variations {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Override any potential hiding */
.reset_variations[style*="display: none"],
.reset_variations[style*="visibility: hidden"] {
    display: block !important;
    visibility: visible !important;
}

/* Reset button positioning - Fixed for all screen sizes */
.reset_variations {
    position: absolute !important;
    left: 8px !important;
    top: 8px !important;
    transform: none !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #555 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    z-index: 10 !important;
    line-height: 1.3 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    white-space: nowrap !important;
    display: block !important;
    visibility: visible !important;
}

.reset_variations:hover {
    background: rgba(255, 255, 255, 1) !important;
    border-color: var(--primary-color, #007AFF) !important;
    color: var(--primary-color, #007AFF) !important;
    transform: scale(1.08) !important;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--primary-color, #007AFF) 20%, transparent) !important;
}

/* RTL Support for reset button - Fixed positioning */
.rtl .reset_variations {
    left: auto !important;
    right: 8px !important;
    top: 8px !important;
}

/* Ensure swatches don't stretch unnecessarily */
.cfvsw-swatches-option {
    flex: 0 0 auto !important;
    max-width: none !important;
    margin: 2px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* Compact layout for many swatches */
.cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+5)) {
    gap: 6px !important;
    padding: 10px !important;
    justify-content: flex-start !important;
}

.cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+5)) .cfvsw-swatches-option {
    min-width: 50px !important;
    min-height: 50px !important;
    font-size: 11px !important;
    padding: 6px !important;
    border-radius: 10px !important;
    margin: 1px !important;
    flex: 0 0 auto !important;
}

/* Ultra compact for very many swatches */
.cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+8)) {
    gap: 4px !important;
    padding: 8px !important;
    justify-content: flex-start !important;
}

.cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+8)) .cfvsw-swatches-option {
    min-width: 45px !important;
    min-height: 45px !important;
    font-size: 10px !important;
    padding: 4px !important;
    border-radius: 8px !important;
    margin: 1px !important;
    flex: 0 0 auto !important;
}

/* Extra compact for very many swatches on mobile */
@media (max-width: 480px) {
    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+6)) {
        gap: 3px !important;
        padding: 8px 6px 6px 6px !important;
        justify-content: flex-start !important;
    }

    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+6)) .cfvsw-swatches-option {
        min-width: 35px !important;
        min-height: 35px !important;
        font-size: 8px !important;
        padding: 2px !important;
        border-radius: 6px !important;
        margin: 1px !important;
    }
}

/* ========================================
   REMOVE OLD CONFLICTING STYLES
   ======================================== */

/* Remove old RTL positioning that causes issues */
.rtl .reset_variations {
    right: 8px !important;
    left: auto !important;
}

/* Remove any conflicting media query rules */
@media (max-width: 768px) {
    .rtl .reset_variations {
        right: 8px !important;
        left: auto !important;
    }
}

@media (max-width: 480px) {
    .rtl .reset_variations {
        right: 6px !important;
        left: auto !important;
    }
}

/* ========================================
   ADDITIONAL DROPDOWN FIXES
   ======================================== */

/* Force visibility for all dropdown elements */
.cfvsw-swatches-container select,
.cfvsw-swatches-container .cfvsw-swatch-select,
select[name*="attribute_"],
select[id*="pa_"],
select[id*="attribute_"] {
    /* Force visibility */
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    /* Ensure proper height */
    height: auto !important;
    min-height: 50px !important;
    /* Force text color */
    color: #333 !important;
    /* Remove any transparent backgrounds */
    background-color: rgba(255, 255, 255, 0.95) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
    padding-right: 40px !important;
}

/* Override any plugin styles that might hide dropdowns */
.cfvsw-swatches-container select[style*="display: none"],
.cfvsw-swatches-container select[style*="visibility: hidden"],
.cfvsw-swatches-container select[style*="opacity: 0"],
select[name*="attribute_"][style*="display: none"],
select[name*="attribute_"][style*="visibility: hidden"],
select[name*="attribute_"][style*="opacity: 0"],
select[id*="pa_"][style*="display: none"],
select[id*="pa_"][style*="visibility: hidden"],
select[id*="pa_"][style*="opacity: 0"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure dropdown options are visible */
.cfvsw-swatches-container select option,
.cfvsw-swatches-container .cfvsw-swatch-select option,
select[name*="attribute_"] option,
select[id*="pa_"] option,
select[id*="attribute_"] option {
    /* Force visibility */
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    /* Ensure proper colors */
    background-color: rgba(255, 255, 255, 0.98) !important;
    color: #333 !important;
    /* Remove any transparent backgrounds */
    background-image: none !important;
}

/* Override any plugin styles for options */
.cfvsw-swatches-container select option[style*="display: none"],
.cfvsw-swatches-container select option[style*="visibility: hidden"],
.cfvsw-swatches-container select option[style*="opacity: 0"],
select[name*="attribute_"] option[style*="display: none"],
select[name*="attribute_"] option[style*="visibility: hidden"],
select[name*="attribute_"] option[style*="opacity: 0"],
select[id*="pa_"] option[style*="display: none"],
select[id*="pa_"] option[style*="visibility: hidden"],
select[id*="pa_"] option[style*="opacity: 0"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Fix for WooCommerce variation dropdowns */
.variations select,
.variations .value select,
table.variations select {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #333 !important;
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    min-height: 50px !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.variations select option,
.variations .value select option,
table.variations select option {
    background: rgba(255, 255, 255, 0.98) !important;
    color: #333 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* ========================================
   FLEX WRAP ENHANCEMENTS
   Better responsive layout for variations
   ======================================== */

/* Base container improvements */
.cfvsw-swatches-container {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding: 16px !important;
    position: relative !important;
    min-height: 80px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Smart layout based on number of options */
.cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(-n+2)) {
    justify-content: center !important;
}

.cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(3)) {
    justify-content: center !important;
}

.cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+4)) {
    justify-content: flex-start !important;
}

/* Responsive breakpoints for better layout */
@media (min-width: 481px) and (max-width: 768px) {
    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+4)) {
        justify-content: center !important;
    }

    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+6)) {
        justify-content: flex-start !important;
    }
}

@media (min-width: 769px) {
    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+5)) {
        justify-content: flex-start !important;
    }

    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(-n+4)) {
        justify-content: center !important;
    }
}

/* Individual swatch improvements */
.cfvsw-swatches-option {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 60px !important;
    min-height: 60px !important;
    margin: 2px !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* Compact sizing for many options */
.cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+5)) .cfvsw-swatches-option {
    min-width: 50px !important;
    min-height: 50px !important;
    font-size: 11px !important;
    padding: 6px !important;
    margin: 1px !important;
}

.cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+8)) .cfvsw-swatches-option {
    min-width: 45px !important;
    min-height: 45px !important;
    font-size: 10px !important;
    padding: 4px !important;
    margin: 1px !important;
}

/* Ultra compact for very many options */
.cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+10)) .cfvsw-swatches-option {
    min-width: 40px !important;
    min-height: 40px !important;
    font-size: 9px !important;
    padding: 3px !important;
    margin: 1px !important;
}

/* Mobile specific improvements */
@media (max-width: 480px) {
    .cfvsw-swatches-container {
        gap: 4px !important;
        padding: 12px 8px 8px 8px !important;
        min-height: 70px !important;
    }

    .cfvsw-swatches-option {
        min-width: 50px !important;
        min-height: 50px !important;
        margin: 1px !important;
    }

    /* Smart mobile layout */
    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(-n+3)) {
        justify-content: center !important;
    }

    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+4)) {
        justify-content: flex-start !important;
    }

    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+4)) .cfvsw-swatches-option {
        min-width: 40px !important;
        min-height: 40px !important;
        font-size: 9px !important;
        padding: 3px !important;
    }

    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+6)) .cfvsw-swatches-option {
        min-width: 35px !important;
        min-height: 35px !important;
        font-size: 8px !important;
        padding: 2px !important;
    }
}

/* Tablet improvements */
@media (min-width: 481px) and (max-width: 768px) {
    .cfvsw-swatches-container {
        gap: 6px !important;
        padding: 14px 10px 10px 10px !important;
        min-height: 75px !important;
    }

    .cfvsw-swatches-option {
        min-width: 55px !important;
        min-height: 55px !important;
        margin: 1px !important;
    }

    .cfvsw-swatches-container:has(.cfvsw-swatches-option:nth-child(n+4)) .cfvsw-swatches-option {
        min-width: 45px !important;
        min-height: 45px !important;
        font-size: 10px !important;
        padding: 4px !important;
    }
}

/* Desktop improvements */
@media (min-width: 769px) {
    .cfvsw-swatches-container {
        gap: 8px !important;
        padding: 16px !important;
        min-height: 80px !important;
    }

    .cfvsw-swatches-option {
        min-width: 60px !important;
        min-height: 60px !important;
        margin: 2px !important;
    }
}

/* ========================================
   RESET BUTTON FINAL FIXES
   ======================================== */

/* Ensure reset button is always properly positioned */
.reset_variations {
    position: absolute !important;
    z-index: 20 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #555 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    line-height: 1.3 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    white-space: nowrap !important;
    display: block !important;
    visibility: visible !important;
    transform: none !important;
}

/* LTR positioning */
.reset_variations {
    left: 8px !important;
    top: 8px !important;
    right: auto !important;
}

/* RTL positioning */
.rtl .reset_variations {
    left: auto !important;
    right: 8px !important;
    top: 8px !important;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .reset_variations {
        left: 6px !important;
        top: 6px !important;
        padding: 5px 8px !important;
        font-size: 10px !important;
        border-radius: 6px !important;
        line-height: 1.2 !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
    }

    .rtl .reset_variations {
        left: auto !important;
        right: 6px !important;
        top: 6px !important;
    }
}

/* Hover effects */
.reset_variations:hover {
    background: rgba(255, 255, 255, 1) !important;
    border-color: var(--primary-color, #007AFF) !important;
    color: var(--primary-color, #007AFF) !important;
    transform: scale(1.08) !important;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--primary-color, #007AFF) 20%, transparent) !important;
}

/* Focus accessibility */
.reset_variations:focus {
    outline: 3px solid var(--primary-color, #007AFF) !important;
    outline-offset: 2px !important;
}

/* ========================================
   FINAL MOBILE MICRO SIZE FOR RESET BUTTON
   يقلّص زر الإزالة على الهاتف ليصبح أيقونة صغيرة جداً
   ======================================== */
@media (max-width: 768px) {

    .variations .reset_variations,
    .woocommerce .variations .reset_variations,
    .single-product .reset_variations {
        position: absolute !important;
        top: 6px !important;
        left: 6px !important;
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 999px !important;
        font-size: 0 !important;
        /* إخفاء النص */
        white-space: nowrap !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
    }

    .variations .reset_variations::before,
    .woocommerce .variations .reset_variations::before,
    .single-product .reset_variations::before {
        content: '×' !important;
        font-size: 16px !important;
        line-height: 1 !important;
        color: #666 !important;
    }

    .rtl .variations .reset_variations,
    .rtl .woocommerce .variations .reset_variations,
    .rtl .single-product .reset_variations {
        left: auto !important;
        right: 6px !important;
    }
}

/* ========================================
   CRITICAL FIX: HIDE DUPLICATE DROPDOWN
   When woo-variation-swatches plugin is active
   ======================================== */

/* Hide select when swatches are present - for Emran Ahmed's plugin */
.woo-variation-items-wrapper select,
.woo-variation-items-wrapper .woo-variation-raw-select,
td.value.woo-variation-items-wrapper>select:first-child,
.variations td.value select.woo-variation-raw-select {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
}

/* Ensure swatches are visible */
.variable-items-wrapper,
ul.variable-items-wrapper {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ========================================
   CRITICAL FIX: PAGE LAYOUT CENTERING
   Fix the white space issue on desktops
   ======================================== */

/* Center the page container */
#page {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100% !important;
}

/* Fix mobile menu overflow */
#mobilemenu {
    display: none !important;
}

body:not(.mobile-menu-active) #mobilemenu {
    display: none !important;
}

/* Only show mobile menu when active */
body.mobile-menu-active #mobilemenu {
    display: block !important;
    left: 0 !important;
    right: auto !important;
}

/* RTL mobile menu */
body.rtl.mobile-menu-active #mobilemenu,
html[dir="rtl"] body.mobile-menu-active #mobilemenu {
    left: auto !important;
    right: 0 !important;
}

/* Prevent horizontal overflow */
html,
body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.site-content,
.content-area,
#content,
.woocommerce,
.single-product .woocommerce {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* Fix footer alignment */
.site-footer,
footer,
.footer-main,
.footer-bottom {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* ========================================
   ADDITIONAL FIX FOR SWATCHES DISPLAY
   ======================================== */

/* Hide the duplicate "تحديد أحد الخيارات" dropdown */
.variations_form .variations td.value>select:first-of-type {
    display: none !important;
}

/* Show only when there are no swatches */
.variations_form .variations td.value:not(.woo-variation-items-wrapper)>select {
    display: block !important;
}

/* ========================================
   CRITICAL FIX: SINGLE PRODUCT PAGE FULL WIDTH
   Make product page match home page layout
   ======================================== */

/* Full width for single product page */
body.single-product {
    overflow-x: hidden !important;
}

body.single-product #page {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

body.single-product .site-content,
body.single-product .content-area,
body.single-product #content {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Fix footer to be full width on product page */
body.single-product .site-footer,
body.single-product footer,
body.single-product .footer-main,
body.single-product .footer-bottom {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Fix floating button position */
body.single-product .sticky-atc-bar,
body.single-product .sticky-add-to-cart,
body.single-product [class*="sticky-atc"],
body.single-product .floating-btn,
body.single-product .codplugin-sticky-btn {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
}

/* Ensure the product content is centered properly */
body.single-product .type-product,
body.single-product .product {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Fix main container width */
body.single-product .main,
body.single-product .site-main {
    width: 100% !important;
    max-width: 100% !important;
}