/* استایل پایه افزونه Woolements */

.woolements-attributes {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
}

.woolements-attributes--grouped {
    background: #fff;
    border-left: 4px solid #0073aa;
}

.woolements-attributes--empty {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.woolements-attributes-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woolements-attribute-item {
    display: flex;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.woolements-attribute-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.woolements-attribute-label {
    font-weight: bold;
    margin-left: 8px;
    min-width: 120px;
}

.woolements-attribute-value {
    color: #333;
}

.woolements-attributes--grouped .woolements-attribute-item {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 3px;
    border-bottom: none;
    margin-bottom: 5px;
}

/* Advanced Add to Cart widget wrapper defaults */
.woolements-advanced-add-to-cart-widget {
    border: 1px solid transparent; /* overridden by Elementor controls */
    border-radius: 4px; /* overridden by Elementor controls */
}

/* Quantity field button positioning */

/* Stronger, more specific rules to override other widget CSS when needed */
.woolements-advanced-add-to-cart-widget .woolements-quantity-wrapper.woolements-quantity-buttons-sides {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    max-width: 150px !important;
}

.woolements-advanced-add-to-cart-widget .woolements-quantity-wrapper.woolements-quantity-buttons-stacked {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: none !important;
    min-width: 0 !important;
}

/* Attribute-based selectors for stronger frontend targeting */
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="stacked"] .woolements-quantity-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: none !important;
    min-width: 0 !important;
}

.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="sides"] .woolements-quantity-wrapper {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
}


.woolements-advanced-add-to-cart-widget .woolements-quantity-wrapper .woolements-quantity-button {
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.woolements-advanced-add-to-cart-widget .woolements-quantity-wrapper.woolements-quantity-buttons-stacked .woolements-quantity-button {
    width: 100% !important;
}

.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="stacked"] .woolements-quantity-wrapper .woolements-quantity-button {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure order: increase (top), input (middle), decrease (bottom) when stacked */
.woolements-advanced-add-to-cart-widget .woolements-quantity-wrapper.woolements-quantity-buttons-stacked .quantity-increase { order: 1 !important; }
.woolements-advanced-add-to-cart-widget .woolements-quantity-wrapper.woolements-quantity-buttons-stacked .woolements-quantity-input { order: 2 !important; }
.woolements-advanced-add-to-cart-widget .woolements-quantity-wrapper.woolements-quantity-buttons-stacked .quantity-decrease { order: 3 !important; }

/* Ensure correct ordering for attribute-driven stacked layout */
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="stacked"] .woolements-quantity-wrapper .quantity-increase { order: 1 !important; }
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="stacked"] .woolements-quantity-wrapper .woolements-quantity-input { order: 2 !important; }
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="stacked"] .woolements-quantity-wrapper .quantity-decrease { order: 3 !important; }

/* Ensure sides ordering (decrease left, increase right) when using attribute */
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="sides"] .woolements-quantity-wrapper .quantity-decrease { order: 1 !important; }
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="sides"] .woolements-quantity-wrapper .woolements-quantity-input { order: 2 !important; }
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="sides"] .woolements-quantity-wrapper .quantity-increase { order: 3 !important; }

/* Ensure decrease is left and increase is right in sides layout, with consistent spacing */
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="sides"] .woolements-quantity-wrapper {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
}
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="sides"] .woolements-quantity-wrapper > .quantity-decrease {
    order: 1 !important;
    margin-right: 8px !important;
}
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="sides"] .woolements-quantity-wrapper > .woolements-quantity-input {
    order: 2 !important;
}
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="sides"] .woolements-quantity-wrapper > .quantity-increase {
    order: 3 !important;
    margin-left: 8px !important;
}

/* If the user selected increase-left instead, swap orders for sides */
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="sides"][data-quantity-buttons-order="increase-left"] .woolements-quantity-wrapper > .quantity-increase {
    order: 1 !important;
    margin-right: 8px !important;
}
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="sides"][data-quantity-buttons-order="increase-left"] .woolements-quantity-wrapper > .woolements-quantity-input {
    order: 2 !important;
}
.woolements-advanced-add-to-cart-widget[data-quantity-buttons-position="sides"][data-quantity-buttons-order="increase-left"] .woolements-quantity-wrapper > .quantity-decrease {
    order: 3 !important;
    margin-left: 8px !important;
}

/* Tooltip for quantity limit reached */
.woolements-limit-tooltip {
    position: absolute;
    background: rgba(217,83,79,0.95); /* bootstrap danger-ish */
    color: #fff;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 13px;
    z-index: 99999;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    pointer-events: none;
}
/* small arrow */
.woolements-limit-tooltip:after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: rgba(217,83,79,0.95) transparent transparent transparent;
}
