/* Modernized Variation Swatches for CartFlows Variation Swatches plugin */

/* Main swatch container - better spacing */
.cfvsw-swatches-container {
    grid-gap: 12px;
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Base style for swatches */
.cfvsw-swatches-option {
    border-radius: 8px !important;
    border: 1.5px solid #e0e0e0 !important;
    background-color: #ffffff !important;
    transition: all 0.3s ease !important;
    padding: 2px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

/* Inner swatch label styling */
.cfvsw-label-option {
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #444 !important;
}

/* Hover state */
.cfvsw-swatches-option:not(.cfvsw-swatches-disabled):hover {
    border-color: #26222f !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(38, 34, 47, 0.15) !important;
}

/* Selected state */
.cfvsw-selected-swatch {
    border-color: #26222f !important;
    background-color: #26222f !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(38, 34, 47, 0.2) !important;
}

/* Selected state inner text color */
.cfvsw-selected-swatch .cfvsw-swatch-inner {
    color: #ffffff !important;
}

/* Adjusting the label above swatches if needed */
.variations label {
    font-weight: 600 !important;
    color: #26222f !important;
    margin-bottom: 5px !important;
    display: inline-block !important;
}

/* Selected label highlight (text next to variation title) */
.cfvsw-selected-label {
    color: #26222f !important;
    font-weight: 700 !important;
}

/* Styling for out-of-stock/disabled variations */
.cfvsw-swatches-option.cfvsw-swatches-disabled {
    cursor: not-allowed !important;
    background-color: #f9f9f9 !important;
    border-color: #e0e0e0 !important;
    opacity: 0.6 !important;
    box-shadow: none !important;
    position: relative !important;
    overflow: hidden !important;
}

.cfvsw-swatches-option.cfvsw-swatches-disabled .cfvsw-swatch-inner {
    color: #999 !important;
}

/* Diagonal Strike-out Line */
.cfvsw-swatches-option.cfvsw-swatches-disabled::after {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: -10% !important;
    width: 120% !important;
    height: 1.5px !important;
    background-color: #999 !important;
    transform: rotate(-35deg) !important;
    transform-origin: center !important;
    z-index: 10 !important;
    pointer-events: none !important;
}


/* Hide default plugin blur overlay to use our custom style */
.cfvsw-swatches-blur-disable::before {
    display: none !important;
}

/* Mobile Gallery Horizontal Scroll */
@media (max-width: 768px) {

    /* Container for thumbnails */
    .flex-control-nav.flex-control-thumbs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
        padding-bottom: 10px !important;
        /* Space for scrollbar if visible */
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    /* Hide scrollbar for a cleaner look but keep functionality */
    .flex-control-nav.flex-control-thumbs::-webkit-scrollbar {
        height: 4px;
    }

    .flex-control-nav.flex-control-thumbs::-webkit-scrollbar-thumb {
        background: #e0e0e0;
        border-radius: 10px;
    }

    /* Individual thumbnail items */
    .flex-control-nav.flex-control-thumbs li {
        flex: 0 0 70px !important;
        /* Fixed width for items */
        margin-right: 10px !important;
        margin-bottom: 0 !important;
        float: none !important;
        clear: none !important;
        scroll-snap-align: start !important;
    }

    /* Ensure images fit well */
    .flex-control-nav.flex-control-thumbs li img {
        width: 100% !important;
        height: auto !important;
        border-radius: 4px !important;
        border: 1px solid #eee !important;
    }

    /* Active thumbnail highlight */
    .flex-control-nav.flex-control-thumbs li img.flex-active {
        border-color: #26222f !important;
        box-shadow: 0 0 0 1px #26222f !important;
    }
}