/**
 * Mini Cart Quantity Controls Styles
 *
 * Styles for the quantity +/- buttons in mini cart and cart page.
 * RTL support included for Hebrew/Arabic.
 */

/* ==========================================================================
   Quantity Wrapper
   ========================================================================== */

.minicart-quantity-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

/* RTL support */
[dir="rtl"] .minicart-quantity-wrapper,
.rtl .minicart-quantity-wrapper {
    align-items: flex-end;
}

/* ==========================================================================
   Quantity Controls Container
   ========================================================================== */

.minicart-quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    border: none;
    border-radius: 100px;
    background: #fff;
    overflow: hidden;
}

/* ==========================================================================
   Quantity Buttons
   ========================================================================== */

.minicart-quantity-controls .minicart-qty-btn {
    margin: 0;
    padding: 0;
    position: absolute;
    top: 0;
    height: 100%;
    border: none;
    border-radius: 0;
    width: 25px;
    background: none;
    color: #000;
    font-family: 'Assistant';
    font-size: 24px;
    line-height: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    outline: none !important;
    box-shadow: none;
}

.minicart-quantity-controls .minicart-qty-btn.minicart-qty-minus {
    left: 0;
    align-items: flex-start;
}

.minicart-quantity-controls .minicart-qty-btn:hover, 
.minicart-quantity-controls .minicart-qty-btn:active, 
.minicart-quantity-controls .minicart-qty-btn:focus {
    background: none;
    color: #000;

}

.minicart-quantity-controls .minicart-qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    color: #000;
}

.minicart-quantity-controls .minicart-qty-btn span {
    font: inherit !important;
}

/* ==========================================================================
   Quantity Input
   ========================================================================== */

   .minicart-quantity-controls .minicart-qty-input {
    min-width: 85px;
    height: 36px;
    padding: 4px 25px;
    margin: 0;
    border: 1px solid #666;
    border-radius: 100px;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    -moz-appearance: textfield;    
}

.minicart-quantity-controls .minicart-qty-input::-webkit-outer-spin-button,
.minicart-quantity-controls .minicart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.minicart-quantity-controls .minicart-qty-input:focus {
    outline: none;
    background: #fff;
}

/* ==========================================================================
   Item Price
   ========================================================================== */

.minicart-item-price {
    font-size: 13px;
    color: #666;
}

.minicart-item-price .woocommerce-Price-amount {
    font-weight: 500;
    color: #333;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.minicart-quantity-updating {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.minicart-quantity-updating::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid #ccc;
    border-top-color: #0d712a;
    border-radius: 50%;
    animation: minicart-qty-spin 0.6s linear infinite;
}

@keyframes minicart-qty-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Error Message
   ========================================================================== */

.minicart-qty-error {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    padding: 4px 8px;
    background: #ff4444;
    color: #fff;
    font-size: 11px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 10;
    animation: minicart-error-fade-in 0.2s ease;
}

[dir="rtl"] .minicart-qty-error,
.rtl .minicart-qty-error {
    left: auto;
    right: 0;
    text-align: right;
}

@keyframes minicart-error-fade-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Color Minimum Warning
   ========================================================================== */

.minicart-color-warning {
    padding: 10px 15px;
    margin: 10px 0;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
    font-size: 13px;
    line-height: 1.4;
}

[dir="rtl"] .minicart-color-warning,
.rtl .minicart-color-warning {
    border-left: none;
    border-right: 4px solid #ffc107;
    text-align: right;
}

/* ==========================================================================
   Elementor Mini Cart Overrides
   ========================================================================== */

/* Override Elementor's default quantity display */
.elementor-menu-cart__product .elementor-menu-cart__product-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
}

/* Hide the default quantity display only when our controls are present */
.minicart-quantity-wrapper + .quantity {
    display: none;
}

/* Product item layout adjustments */
.elementor-menu-cart__product {
    position: relative;
}

.elementor-menu-cart__product .minicart-quantity-wrapper {
    position: relative;
}

/* ==========================================================================
   WooCommerce Cart Page Styles
   ========================================================================== */

/* Apply styles to cart page quantity inputs as well */
.woocommerce-cart-form .quantity {
    display: flex;
    align-items: center;
}

.woocommerce-cart-form .quantity .qty {
    width: 60px;
    text-align: center;
}

/* Hide +/- buttons for non-clothing products on cart page */
.non-clothing-qty-wrapper .minus,
.non-clothing-qty-wrapper .plus,
.non-clothing-qty-wrapper .qty-btn,
.non-clothing-qty-wrapper .quantity-btn,
.non-clothing-qty-wrapper .qty_button,
.non-clothing-qty-wrapper .quantity__button,
.non-clothing-qty-wrapper .quantity-button,
.non-clothing-qty-wrapper .qty-minus,
.non-clothing-qty-wrapper .qty-plus,
.non-clothing-qty-wrapper .quantity .button,
.non-clothing-qty-wrapper button.minus,
.non-clothing-qty-wrapper button.plus,
.non-clothing-qty-wrapper input.minus,
.non-clothing-qty-wrapper input.plus,
.non-clothing-qty-wrapper .quantity button:not([name="update_cart"]) {
    display: none !important;
    visibility: hidden !important;
}

.non-clothing-qty-wrapper .quantity {
    justify-content: center;
    pointer-events: none !important;
}

/* Block all interactions on the wrapper */
.non-clothing-qty-wrapper {
    position: relative;
}

.non-clothing-qty-wrapper .quantity * {
    pointer-events: none !important;
}

/* Make input readonly-like for non-clothing products */
.non-clothing-qty-wrapper .qty,
.non-clothing-qty-wrapper input[type="number"],
.non-clothing-qty-wrapper input.input-text {
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    appearance: none !important;
    pointer-events: none !important;
    background-color: #f5f5f5 !important;
    cursor: default !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.non-clothing-qty-wrapper .qty::-webkit-outer-spin-button,
.non-clothing-qty-wrapper .qty::-webkit-inner-spin-button,
.non-clothing-qty-wrapper input[type="number"]::-webkit-outer-spin-button,
.non-clothing-qty-wrapper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
    display: none !important;
}

.elementor-widget-woocommerce-menu-cart .minicart-item-price:has(.woocommerce-Price-amount) {
    display: none;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 767px) {
    .minicart-qty-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .minicart-qty-input {
        width: 50px;
        height: 32px;
        font-size: 15px;
    }

    .minicart-qty-error {
        font-size: 10px;
        padding: 3px 6px;
    }

    .minicart-color-warning {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* ==========================================================================
   Dark Mode Support (if applicable)
   ========================================================================== */

/* Dark mode styles removed - keeping white background design */

/* ==========================================================================
   Accessibility
   ========================================================================== */

.minicart-qty-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 1px;
}

.minicart-qty-input:focus {
    outline: 2px solid #007cba;
    outline-offset: -2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 783px) {
    .admin-bar header[data-elementor-type="header"] .elementor-widget-woocommerce-menu-cart .elementor-menu-cart__container {
        top: -3px;
        min-height: calc(100vh - 32px);
    }
}


@media (min-width: 787px) {
    header[data-elementor-type="header"] .elementor-widget-woocommerce-menu-cart .elementor-menu-cart__container {
        top: -35px;
    }
}