/* Bijan Variation Swatches - Frontend Styles */

/* Force table cell to display block ONLY for cells with swatches */
.variations td:has(.bvs-swatches) {
    display: block !important;
    width: 100% !important;
}

/* Attribute Label - Match Bijan theme style */
.bvs-swatches ~ label,
label:has(+ .bvs-swatches),
.variations td:has(.bvs-swatches) label {
    display: block !important;
    width: 100% !important;
    border-bottom: none !important;
    font-size: 16px !important;
    color: #FF9800 !important;
}

/* Add colon after label */
.bvs-swatches ~ label::after,
label:has(+ .bvs-swatches)::after,
.variations td:has(.bvs-swatches) label::after {
    content: ':';
}

.bvs-swatches {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
    clear: both !important;
    width: 100% !important;
}

.bvs-item {
    cursor: pointer;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.25s ease;
    position: relative;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Light orange ring for available items only */
.bvs-item:not(.disabled) {
    box-shadow: 0 0 0 3px rgba(255,152,0,0.2);
}

.bvs-item:hover:not(.disabled):not(.selected) {
    border-color: #FF9800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,152,0,0.25);
}

.bvs-item.selected {
    border-color: #FF9800;
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(255,152,0,0.2);
    background: #fff8f0;
}

.bvs-item.disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    position: relative;
    filter: grayscale(100%) !important;
    pointer-events: none !important;
    background: #f5f5f5 !important;
    border-color: #ddd !important;
    box-shadow: none !important;
}

.bvs-item.disabled::before {
    content: '';
    position: absolute;
    top: 0;
     /* Allow tooltip to be visible outside box */
     overflow: visible;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    z-index: 5;
    border-radius: 4px;
}

.bvs-item.disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 8%;
    right: 8%;
    height: 2px;
    background: #e57373 !important; /* strong visible diagonal line */
    transform: translateY(-50%) rotate(-20deg);
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Label Type */
.bvs-label .bvs-item {
    padding: 10px 18px;
    text-align: center;
}

.bvs-label .bvs-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.bvs-label .bvs-item.selected .bvs-label {
    color: #FF9800;
    font-weight: 600;
}

/* Image Type */
.bvs-image .bvs-item {
    width: 60px;
    height: 60px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bvs-image img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 3px;
    object-fit: cover;
}

/* Color Type */
.bvs-color .bvs-item {
    width: 40px;
    height: 40px;
    padding: 4px;
    border-radius: 50%;
}

.bvs-color .bvs-color {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

/* Tooltip */
.bvs-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
    line-height: 1.4;
}

.bvs-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0,0,0,0.9);
}

.bvs-item:hover:not(.disabled) .bvs-tooltip {
    opacity: 1;
}

/* Hidden Select */
.bvs-hidden-select {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

/* Integration with Bijan Theme */
.variations .bvs-swatches {
    margin-top: 8px;
}

.variations tr .bvs-swatches {
    margin: 0;
}

/* RTL Support */
[dir="rtl"] .bvs-swatches {
    direction: rtl;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .bvs-swatches {
        gap: 8px;
        margin: 12px 0;
    }
    
    .bvs-label .bvs-item {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .bvs-image .bvs-item {
        width: 50px;
        height: 50px;
    }
    
    .bvs-color .bvs-item {
        width: 36px;
        height: 36px;
    }
    
    .bvs-tooltip {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* Remove animation on click - no need for it */

