/**
 * Storedash Variation Swatches
 * Clean, minimal, beautiful
 *
 * @package Storedash_Checkout
 * @since 3.3.0
 */

.storedash-variation-swatches,
.storedash-variation-swatches-inline {
    width: 100%;
}

/* Override WooCommerce default variation styles */
.storedash-add-to-cart-wrapper table.variations,
.storedash-add-to-cart-wrapper form.variations_form,
.storedash-add-to-cart-wrapper .variations {
    display: none !important;
}

/* Variation Attribute Section */
.variation-attribute {
    margin-bottom: 24px;
}

.variation-attribute:last-child {
    margin-bottom: 0;
}

/* Label */
.variation-label {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.selected-value {
    font-weight: 400;
    color: #E65500;
}

/* Swatches Container */
.storedash-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Swatch Options */
.swatch-option {
    min-width: 44px;
    min-height: 44px;
    padding: 0; /* Reset browser default button padding */
    margin: 0; /* Reset browser default button margin */
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-sizing: border-box; /* Ensure padding is included in width/height */
}

/* Hover State */
.swatch-option:hover:not(.disabled):not(.selected) {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-2px);
    /* Box shadow removed - controlled via Elementor widget settings */
}

/* Selected State */
.swatch-option.selected {
    background: #E65500;
    border-color: #E65500;
    color: #ffffff;
    font-weight: 600;
    /* Box shadow removed - controlled via Elementor widget settings */
}

/* Disabled State */
.swatch-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    position: relative;
}

.swatch-option.disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #d1d5db;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Shape Variations */
.storedash-variation-swatches[data-swatch-shape="circle"] .swatch-option,
.storedash-variation-swatches-inline[data-swatch-shape="circle"] .swatch-option {
    border-radius: 50%;
    min-width: 48px;
    min-height: 48px;
    /* Padding removed - controlled via Elementor widget settings */
}

.storedash-variation-swatches[data-swatch-shape="square"] .swatch-option,
.storedash-variation-swatches-inline[data-swatch-shape="square"] .swatch-option {
    border-radius: 4px;
}

/* Color Type Swatches */
.storedash-variation-swatches[data-swatch-type="color"] .swatch-option,
.storedash-variation-swatches-inline[data-swatch-type="color"] .swatch-option {
    min-width: 40px;
    min-height: 40px;
    /* Padding removed - controlled via Elementor widget settings */
    border-width: 2px;
}

.storedash-variation-swatches[data-swatch-type="color"] .swatch-option.selected,
.storedash-variation-swatches-inline[data-swatch-type="color"] .swatch-option.selected {
    border-width: 3px;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #E65500;
}

/* Image Type Swatches */
.storedash-variation-swatches[data-swatch-type="image"] .swatch-option,
.storedash-variation-swatches-inline[data-swatch-type="image"] .swatch-option {
    /* Padding removed - controlled via Elementor widget settings */
    min-width: 60px;
    min-height: 60px;
}

.storedash-variation-swatches[data-swatch-type="image"] .swatch-option img,
.storedash-variation-swatches-inline[data-swatch-type="image"] .swatch-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.storedash-variation-swatches[data-swatch-type="image"] .swatch-option.selected,
.storedash-variation-swatches-inline[data-swatch-type="image"] .swatch-option.selected {
    border-width: 2px;
}

/* Out of Stock Badge */
.swatch-option .out-of-stock-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 3px;
    text-transform: uppercase;
    line-height: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .swatch-option {
        min-width: 40px;
        min-height: 40px;
        /* Padding removed - controlled via Elementor widget settings */
        font-size: 13px;
    }

    .storedash-swatches {
        gap: 6px;
    }

    .variation-label {
        font-size: 13px;
    }
}

/* Performance */
.swatch-option {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

