/* * ADIBNQC CART BUY NOW - FIXED STYLES */

/* 1. HIDE LOGIC (Works with Elementor Toggle) */
body .adibnqc-qty-show-no form.cart .quantity,
body .adibnqc-qty-show-no form.cart .adibnqc-qty-btn {
    display: none;
}

/* 2. WRAPPER LAYOUT */
body .adibnqc-single-buttons-wrapper form.cart {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping */
    align-items: center;
    gap: 0;
    width: 100%;
    
    /* Variables from Elementor */
    --adibnqc-qty-gap: 15px; 
    --adibnqc-btn-gap: 10px; 
}

/* 3. QUANTITY BOX (Flex Layout: Btn - Input - Btn) */
/* Using high specificity to control layout without !important */
body form.cart .adibnqc-iso-qty {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    box-sizing: border-box;
    flex: 0 0 auto;
    
    /* Gap Control */
    margin: 0;
    margin-right: var(--adibnqc-qty-gap);
    margin-bottom: 0;
    
    padding: 0;
    overflow: hidden;
    
    /* Dimensions */
    height: 48px; 
    width: 140px; 
    max-width: 100%;
}

/* 4. QUANTITY INPUT (Middle) */
body form.cart .adibnqc-iso-qty input.qty {
    flex-grow: 1; /* Fills the middle space */
    width: auto; 
    max-width: none;
    min-width: 0;
    
    text-align: center; 
    border: none;
    background: transparent; 
    margin: 0; 
    padding: 0;
    height: 100%; 
    min-height: 0;
    
    color: #1f2937; 
    font-weight: 700;
    appearance: textfield;
    box-shadow: none;
    outline: none;
}
/* Hide Spinners */
body form.cart .adibnqc-iso-qty input.qty::-webkit-outer-spin-button,
body form.cart .adibnqc-iso-qty input.qty::-webkit-inner-spin-button { 
    -webkit-appearance: none; margin: 0; 
}

/* 5. PLUS/MINUS BUTTONS (Edges) */
body .adibnqc-qty-btn {
    width: 40px; /* Fixed width */
    flex: 0 0 40px; /* Prevent shrinking */
    height: 100%; 
    
    background: transparent;
    border: none; 
    cursor: pointer; 
    display: flex;
    align-items: center; 
    justify-content: center; 
    padding: 0;
    margin: 0;
    
    color: #6b7280; 
    font-size: 18px; 
    line-height: 1;
    border-radius: 0;
    box-shadow: none;
}
body .adibnqc-qty-btn:hover { 
    color: #111; 
    background-color: rgba(0,0,0,0.03); 
}

/* 6. BUTTON ROW (ATC + BN) */
body .adibnqc-btn-row {
    display: flex;
    align-items: center;
    /* Apply Gap Variable */
    gap: var(--adibnqc-btn-gap);
    flex: 1 1 auto; 
    width: auto;
    min-width: 200px;
}

/* 7. ACTION BUTTONS (Reset for Padding Control) */
/* Specific selector to override theme defaults */
body form.cart button.single_add_to_cart_button,
body form.cart button.adibnqc-single-buy-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    
    /* Reset styles to allow Elementor Padding to work */
    height: auto; 
    min-height: 0; 
    line-height: 1.2;
    width: auto;
    
    box-sizing: border-box;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    
    /* Base padding if not set */
    padding: 15px 30px; 
}

/* --- RESPONSIVE LOGIC --- */

@media (max-width: 767px) {
    
    /* SCENARIO 1: Elementor Qty Width 100% (Mobile) */
    body .adibnqc-single-buttons-wrapper form.cart .adibnqc-iso-qty[style*="width: 100%"],
    body .adibnqc-single-buttons-wrapper form.cart .adibnqc-iso-qty[style*="width:100%"] {
        margin-right: 0;
        margin-bottom: 15px; 
        flex: 0 0 100%;
    }

    /* SCENARIO 2: Full Width Buttons Toggle ON */
    body .adibnqc-atc-full-yes .adibnqc-btn-row {
        width: 100%; 
        flex: 0 0 100%;
    }
    
    body .adibnqc-atc-full-yes .adibnqc-iso-qty {
        margin-bottom: 15px; 
        margin-right: auto; 
    }

    /* 50% - 50% Buttons on Mobile */
    body .adibnqc-atc-full-yes button.single_add_to_cart_button,
    body .adibnqc-atc-full-yes button.adibnqc-single-buy-now {
        width: 50%;
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (min-width: 768px) {
    /* Desktop: Auto width */
    body .adibnqc-atc-full-yes button.single_add_to_cart_button { flex: 1 1 auto; width: auto; }
    body .adibnqc-bn-full-yes button.adibnqc-single-buy-now { flex: 1 1 auto; width: auto; }
}