/**
 * Product Sample Form - Color Swatches Styling
 */

.product-color-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.color-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fff;
}

.color-swatch:hover {
    border-color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-swatch-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.color-swatch-checkbox:checked + .color-swatch-color,
.color-swatch-checkbox:checked + .color-swatch-image {
    border-color: #4e8a26;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.color-swatch input[type="checkbox"]:checked ~ *,
.color-swatch input[type="radio"]:checked ~ * {
    /* Styling when parent label contains checked checkbox or radio */
}

.color-swatch:has(input[type="checkbox"]:checked),
.color-swatch:has(input[type="radio"]:checked) {
    border-color: #4e8a26;
    background-color: #f9f9f9;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.color-swatch-image,
.color-swatch-color {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.color-swatch-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.color-swatch-color {
    /* Solid color background set via inline style */
}

.color-swatch-label {
    font-size: 13px;
    text-align: center;
    color: #333;
    line-height: 1.3;
    word-break: break-word;
    transition: all 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-color-swatches {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .color-swatch {
        padding: 8px;
    }

    .color-swatch-image,
    .color-swatch-color {
        width: 50px;
        height: 50px;
    }

    .color-swatch-label {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .product-color-swatches {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Hide the original input field */
span[data-name="product_colors"] input[name="product_colors"],
span[data-name="product_colors"] select {
    display: none !important;
}

/* Optional: Add a visual indicator for required field */
.wpcf7-not-valid-tip {
    margin-top: 10px;
}

.question-form__note{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}
.form-flex{
    margin-bottom: 1em;
}