/**
 * Billiard Configurator Frontend Swatch Styles
 *
 * @package BilliardConfigurator
 */

/* Swatch Picker Container */
.bc-swatch-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.bc-swatch-picker--felt-colors .bc-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.bc-swatch-picker--base-finishes .bc-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Individual Swatch */
.bc-swatch {
    border-radius: 50%;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bc-swatch:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Active Swatch */
.bc-swatch--active {
    border-color: #333;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333, 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Disabled Swatch */
.bc-swatch--disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.bc-swatch--disabled:hover {
    transform: none;
}

/* Swatch Tooltip */
.bc-swatch[title] {
    position: relative;
}

.bc-swatch::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 10;
    margin-bottom: 5px;
}

.bc-swatch::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    margin-bottom: -5px;
    z-index: 10;
}

.bc-swatch:hover::after,
.bc-swatch:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Swatch Label (for finishes) */
.bc-swatch-label {
    display: block;
    text-align: center;
    font-size: 11px;
    margin-top: 4px;
    color: #666;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Swatch with Label Container */
.bc-swatch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Section Labels */
.bc-swatch-section {
    margin-bottom: 20px;
}

.bc-swatch-section-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

/* Hide the original WooCommerce selects when swatches are present */
.bc-hidden-select {
    display: none !important;
    position: absolute !important;
    visibility: hidden !important;
}

/* Cart swatch preview */
.bc-cart-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 5px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Installation Options */
.bc-installation-picker {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.bc-installation-picker .bc-installation-label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

.bc-installation-option {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.bc-installation-option:hover {
    border-color: #999;
}

.bc-installation-option input[type="radio"] {
    margin-right: 12px;
}

.bc-installation-option.selected {
    border-color: #333;
    background: #f5f5f5;
}

.bc-installation-option-name {
    flex: 1;
    font-weight: 500;
}

.bc-installation-option-price {
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .bc-swatch-picker {
        gap: 6px;
    }

    .bc-swatch-picker--felt-colors .bc-swatch {
        width: 28px;
        height: 28px;
    }

    .bc-swatch-picker--base-finishes .bc-swatch {
        width: 36px;
        height: 36px;
    }

    .bc-swatch::after {
        font-size: 11px;
        padding: 3px 6px;
    }
}

