/* Main Wrapper */
.elementor-variation-swatches-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Row (Label + Swatches) */
.evs-attribute-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.evs-attribute-label {
    font-weight: bold;
}

/* Container for Swatches */
.evs-swatches-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* Swatch Base */
.evs-swatch {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* Image Mode */
.evs-swatch.evs-type-image {
    flex-direction: column;
}

.evs-swatch.evs-type-image img {
    object-fit: cover;
    display: block;
    border: 1px solid #ddd;
    /* Default border */
}

/* Selected State (Image) */
.evs-swatch.evs-type-image.selected img {
    border-color: #000;
    /* Default selected color */
}

/* Label below image */
.evs-swatch-label {
    margin-top: 5px;
    font-size: 12px;
    text-align: center;
}

/* Button Mode */
.evs-swatch.evs-type-button {
    border: 1px solid #ccc;
    background: #f9f9f9;
    padding: 5px 10px;
    font-size: 14px;
}

.evs-swatch.evs-type-button:hover {
    background: #eee;
}

.evs-swatch.evs-type-button.selected {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Disabled State Base */
.evs-swatch.disabled {
    cursor: not-allowed;
}

/* Behavior: Blur (Default) */
.evs-oos-behavior-blur .evs-swatch.disabled {
    opacity: 0.4;
    filter: grayscale(100%);
    pointer-events: none;
    /* Prevent clicking */
}

/* Behavior: Hide */
.evs-oos-behavior-hide .evs-swatch.disabled {
    display: none !important;
}

/* Add to Cart Section */
.evs-add-to-cart-section {
    margin-top: 25px;
}

.variations_button {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Quantity Input Styling */
.quantity {
    display: inline-flex;
}

.quantity input.qty {
    max-width: 60px;
    padding: 10px;
    text-align: center;
    border: 1px solid #ccc;
}

/* Add to Cart Button Base */
.single_add_to_cart_button {
    cursor: pointer;
    padding: 10px 20px;
    background: #333;
    color: #fff;
    border: none;
    transition: all 0.2s;
}

.single_add_to_cart_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Native Selects - Hidden by default but functional */
.evs-hidden-select {
    visibility: hidden;
    position: absolute;
    z-index: -1;
    opacity: 0;
    width: 1px;
    height: 1px;
}

/* =========================================
   Alignment Helpers (Elementor Controls)
   ========================================= */

/* LEFT (Default) */
.elementor-align-left .elementor-variation-swatches-wrapper {
    align-items: flex-start;
}

.elementor-align-left .evs-attribute-row {
    align-items: flex-start;
}

.elementor-align-left .evs-swatches-container {
    justify-content: flex-start;
}

.elementor-align-left .evs-attribute-label {
    text-align: left;
}

/* CENTER */
.elementor-align-center .elementor-variation-swatches-wrapper {
    align-items: center;
}

.elementor-align-center .evs-attribute-row {
    align-items: center;
}

.elementor-align-center .evs-swatches-container {
    justify-content: center;
}

.elementor-align-center .evs-attribute-label {
    text-align: center;
}

/* RIGHT */
.elementor-align-right .elementor-variation-swatches-wrapper {
    align-items: flex-end;
}

.elementor-align-right .evs-attribute-row {
    align-items: flex-end;
}

.elementor-align-right .evs-swatches-container {
    justify-content: flex-end;
}

.elementor-align-right .evs-attribute-label {
    text-align: right;
}

/* JUSTIFY */
.elementor-align-justify .elementor-variation-swatches-wrapper {
    align-items: stretch;
}

.elementor-align-justify .evs-attribute-row {
    align-items: stretch;
}

.elementor-align-justify .evs-swatches-container {
    justify-content: flex-start;
    /* Swatches usually flow, justify might look weird if space-between */
}

.elementor-align-justify .evs-attribute-label {
    text-align: justify;
}

/* Add to Cart Section Alignment */
.elementor-align-left .evs-add-to-cart-section,
.elementor-align-left .variations_button {
    justify-content: flex-start;
}

.elementor-align-center .evs-add-to-cart-section,
.elementor-align-center .variations_button {
    justify-content: center;
}

.elementor-align-right .evs-add-to-cart-section,
.elementor-align-right .variations_button {
    justify-content: flex-end;
}

.elementor-align-justify .evs-add-to-cart-section,
.elementor-align-justify .variations_button {
    justify-content: space-between;
}