/* assets/frontend.css */

/* בוחר יחידות - סגנון טוגל מינימליסטי בעמוד מוצר */
.wcus-selector-inline {
    display: inline-flex;
    background: #f5f5f5;
    border-radius: 30px;
    padding: 3px;
    margin: 0 auto 15px;
    align-items: center;
    height: 38px;
    width: fit-content;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* מרכוז הבוחר בעמוד המוצר */
.single-product .wcus-selector-inline {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 200px;
    margin: 0 auto 15px;
}

/* אופציות יחידה */
.wcus-unit-option {
    position: relative;
    flex: 1;
}

.wcus-unit-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wcus-unit-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    background: transparent;
    border-radius: 27px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 32px;
    min-width: 50px;
    white-space: nowrap;
}

.wcus-unit-option:hover span {
    color: #333;
}

/* כפתור פעיל בעמוד מוצר - צבע בורדו */
.wcus-unit-option.active span,
.wcus-unit-option input:checked + span {
    background: linear-gradient(135deg, #3f0101 0%, #510000 100%) !important;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(114, 47, 55, 0.3);
}

/* בוחר בלופ המוצרים - דף קטגוריה */
.wcus-loop-selector {
    display: flex !important;
    background: #f5f5f5;
    border-radius: 25px;
    padding: 2px;
    margin: 10px auto 12px !important;
    align-items: center;
    height: 32px;
    justify-content: center;
    width: fit-content;
    max-width: 160px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
    clear: both;
}

.wcus-loop-option {
    flex: 1;
    padding: 5px 14px;
    background: transparent;
    border: none;
    border-radius: 40px  !important;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 28px !important;
    min-width: 20px  !important;
min-height:28px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
}

.wcus-loop-option:hover {
    color: #333;
}

/* כפתור פעיל - צבע בורדו כהה */
.wcus-loop-option.active {
   background: linear-gradient(135deg, #3f0101 0%, #510000 100%) !important;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(114, 47, 55, 0.3);
}

/* מיקום מתחת למחיר */
.products .product span.price + .wcus-loop-selector {
    display: flex !important;
    margin-top: 10px !important;
}

/* מרכוז בדף קטגוריה */
.products .product .wcus-loop-selector {
    display: flex;
    margin: 8px auto;
    order: 1;
}

/* סדר תצוגה בכרטיס מוצר */
.products .product .wd-add-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* מיקום הבוחר מעל אזור הכפתורים */
.products .product .wcus-loop-selector {
    order: -1;
    margin-bottom: 10px;
}

.products .product .wd-add-btn-wrap .quantity-wrap {
    order: 1;
}

.products .product .wd-add-btn-wrap .button {
    order: 2;
    margin-top: 8px;
}

/* התאמה ל-WOODMART */
.wd-product .wd-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

/* מיקום הבוחר מיד אחרי המחיר */
.product-element-top + .wcus-loop-selector {
    margin-top: 8px !important;
}

/* או בתוך product-element-bottom */
.product-element-bottom .wcus-loop-selector {
    order: -10;
    margin: 8px auto 10px !important;
}

/* וידוא שהכמות והכפתור באים אחרי הבוחר */
.product-element-bottom .wd-add-btn-wrap {
    order: 1;
}

/* תווית יחידה במחיר */
.wcus-unit-label {
    font-size: 0.85em;
    color: #666;
    font-weight: normal;
    margin-right: 3px;
    display: inline-block;
}

/* סגנון מחיר מבצע */
.price del {
    color: #999 !important;
    text-decoration: line-through !important;
    font-size: 0.9em;
}

.price ins {
    color: #e74c3c !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

/* מחיר מבצע בעגלה */
.woocommerce-cart .cart_item .product-price del,
.woocommerce-checkout .product-name del {
    color: #999;
    text-decoration: line-through;
}

.woocommerce-cart .cart_item .product-price ins,
.woocommerce-checkout .product-name ins {
    color: #e74c3c;
    text-decoration: none;
    font-weight: bold;
}

/* מחיר מבצע במיני עגלה */
.woocommerce-mini-cart-item .quantity del {
    color: #999;
    text-decoration: line-through;
    font-size: 0.9em;
}

.woocommerce-mini-cart-item .quantity ins {
    color: #e74c3c;
    text-decoration: none;
    font-weight: bold;
}

/* הדגשת מבצע בדף מוצרים */
.products .product .price del {
    opacity: 0.7;
}


/* סגנון משופר למחיר מבצע בעמוד מוצר */
.single-product .price del {
    font-size: 1.1em;
    margin-left: 8px;
}

.single-product .price ins {
    font-size: 1.3em;
    position: relative;
}



/* טקסט מותאם */
.wcus-custom-text {
    margin: 10px auto;
    padding: 8px 12px;
    background: #f7f9fc;
    border-right: 3px solid #4a90e2;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    clear: both;
    max-width: 400px;
    text-align: center;
}

/* תצוגה בעגלה */
.woocommerce-mini-cart .quantity,
.woocommerce-cart .product-price,
.woocommerce-checkout-review-order .product-total {
    white-space: nowrap;
}

/* התאמה ל-WOODMART - עמוד מוצר */
.single-product form.cart {
    display: block !important;
}

.single-product .quantity {
    display: inline-flex !important;
    margin: 0 !important;
}

.single-product .single_add_to_cart_button {
    margin-top: 0px;
}

/* כפתורי הוספה לסל בדף קטגוריה */
.products .product .button {
    margin-top: unset !important;
}

/* התאמה למובייל */
@media (max-width: 768px) {
    .wcus-selector-inline {
        max-width: 160px;
        height: 30px;
    }
    
    .wcus-loop-selector {
        max-width: 120px;
        height: 26px;
    }
    
    .wcus-unit-option span {
        padding: 4px 10px;
        font-size: 11px;
        height: 26px;
    }
    
    .wcus-loop-option {
        padding: 3px 8px;
        font-size: 10px;
        height: 22px;
        min-width: 30px;
    }
    
    /* מחיר מבצע במובייל */
    .single-product .price ins::before {
        top: -15px;
        font-size: 8px;
        padding: 1px 4px;
    }
}

/* RTL */
[dir="rtl"] .wcus-custom-text {
    border-right: none;
    border-left: 3px solid #4a90e2;
}

[dir="rtl"] .wcus-unit-label {
    margin-right: 0;
    margin-left: 3px;
}

[dir="rtl"] .single-product .price del {
    margin-left: 0;
    margin-right: 8px;
}

[dir="rtl"] .single-product .price ins::before {
    right: auto;
    left: 0;
}

/* אנימציה חלקה */
.wcus-unit-option span,
.wcus-loop-option {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}



/* מניעת כפילויות - חזק יותר */
.wcus-loop-selector ~ .wcus-loop-selector,
.products .product .wcus-loop-selector:nth-of-type(2),
.products .product .wcus-loop-selector:nth-of-type(3) {
    display: none !important;
}

/* רק הבוחר הראשון נראה */
.products .product .wcus-loop-selector:first-of-type {
    display: flex !important;
}

/* מיקום הבוחר מתחת למחיר */
.products .product .price + .wcus-loop-selector,
.products .product .price ~ .wcus-loop-selector:first-of-type {
    margin-top: 8px !important;
    margin-bottom: 2px !important;
    display: flex !important;
}

/* בוחר שמופיע לפני הכפתורים - hooks של WOODMART */
.wd-add-btn-wrap > .wcus-loop-selector:first-child,
.wcus-loop-selector + .wd-add-btn,
.wcus-loop-selector + .quantity-wrap {
    /* הבוחר במקום הנכון - לפני הכפתורים */
}

/* הסתרת בוחר במקום לא נכון */
.wd-add-btn-wrap .wd-add-btn ~ .wcus-loop-selector,
.quantity-wrap ~ .wcus-loop-selector {
    display: none !important;
}

/* סדר תצוגה נכון בדף קטגוריה */
.products .product .price {
    margin-bottom: 2px;
    text-align: center;
}

/* מיקום הבוחר ישירות אחרי המחיר */
.products .product .wcus-loop-selector {
    order: 1;
    margin: 0 auto 10px;
    clear: both;
}

.products .product .wd-add-btn-wrap {
    order: 2;
    clear: both;
}

/* וידוא שהבוחר מופיע מיד אחרי המחיר */
.products .product .price + .wcus-loop-selector {
    margin-top: 5px;
}

/* תיקון לתצוגה של WOODMART */
.wd-product .wd-add-btn-wrap {
    margin-top: 10px;
}

/* מיקום מדויק בדף קטגוריה - מתחת למחיר, מעל הכמות */
.products .product {
    position: relative;
}

/* הסר את הבוחר מתוך אזור הכפתורים */
.wd-add-btn-wrap .wcus-loop-selector {
    display: none !important;
}

/* מיקום הבוחר אחרי המחיר */
.products .product span.price ~ .wcus-loop-selector {
    display: flex !important;
    margin: 10px auto 12px !important;
    position: relative !important;
    z-index: 10 !important;
}

/* וידוא שהכמות באה אחרי הבוחר */
.products .product .wcus-loop-selector ~ .wd-add-btn-wrap {
    margin-top: 0;
}

/* סדר ספציפי ל-WOODMART עם flexbox */
.product-wrapper,
.product-element-bottom {
    display: flex !important;
    flex-direction: column !important;
}

.product-wrapper > span.price,
.product-element-bottom > span.price {
    order: 0 !important;
}

.product-wrapper > .wcus-loop-selector,
.product-element-bottom > .wcus-loop-selector {
    order: 1 !important;
}

.product-wrapper > .wd-add-btn,
.product-element-bottom > .wd-add-btn {
    order: 2 !important;
}

.wd-product .price + .wcus-loop-selector + .wd-add-btn-wrap {
    margin-top: 5px;
}

/* העלמת בוחר כפול */
.wcus-loop-selector.hidden,
.wcus-selector-inline.hidden {
    display: none !important;
}

/* תיקון מרכוז בעמוד מוצר */
.single-product .summary form.cart {
    text-align: center;
}

.single-product .summary form.cart .quantity,
.single-product .summary form.cart .single_add_to_cart_button {
    display: inline-block;
    float: none;
}

/* עיצוב מודרני יותר */
.wcus-selector-inline,
.wcus-loop-selector {
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
}

.wcus-unit-option.active span,
.wcus-unit-option input:checked + span,
.wcus-loop-option.active {
    background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
}

/* תיקון גודל פונט לעקביות */
.wcus-unit-option span {
    font-size: 12px;
}

.wcus-loop-option {
    font-size: 11px;
}

/* הסתרת בוחר מיותר בעמוד מוצר כשיש רק אופציה אחת */
body.single-product .wcus-selector-inline:empty {
    display: none !important;
}



/* הדגשת מחיר מבצע בהזמנה */
.woocommerce-order-details .order_item del,
.woocommerce-order-received .order_item del {
    color: #999;
    text-decoration: line-through;
}

.woocommerce-order-details .order_item ins,
.woocommerce-order-received .order_item ins {
    color: #e74c3c;
    text-decoration: none;
    font-weight: bold;
}

/* סגנון מחיר מבצע בדף צ'קאוט */
.woocommerce-checkout-review-order-table .product-name del {
    color: #999;
    font-size: 0.9em;
}

.woocommerce-checkout-review-order-table .product-name ins {
    color: #e74c3c;
    font-weight: bold;
}