/**
 * File Name: quotation.css
 * Location: /assets/css/
 * Version: 3.4
 * Author: shakourdm
 * Description:
 * - Overrides theme wrapper styles to remove background rectangles.
 * - Fits WhatsApp button to text length across all screen sizes.
 * - Centers quantity selector and WhatsApp button on mobile screens.
 */

/* ==========================================================================
   1. REMOVE BACKGROUND RECTANGLE & WRAPPER BOX (ALL DEVICES)
   ========================================================================== */

form.cart.wc-quotation-form,
.single-product form.cart.wc-quotation-form,
.wc-quotation-form {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 15px !important;
    margin-bottom: 25px !important;
    outline: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
}

.wc-quotation-form *,
.wc-quotation-form::before,
.wc-quotation-form::after {
    box-shadow: none !important;
}

/* ==========================================================================
   2. WHATSAPP QUOTATION BUTTON STYLING (CONTENT-FIT & ROUND CORNERS)
   ========================================================================== */
.wc-quotation-form .wc-quotation-btn,
button.wc-quotation-btn {
    display: inline-flex !important;
    width: auto !important;           /* Fits naturally to text length */
    max-width: none !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    background-color: #25D366 !important; /* WhatsApp Green */
    color: #FFFFFF !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    border-radius: 50px !important;   /* Round pill shape */
    border: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3) !important;
    transition: background-color 0.25s ease, transform 0.25s ease !important;
    white-space: nowrap !important;
}

.wc-quotation-form .wc-quotation-btn:hover:not(:disabled) {
    background-color: #128C7E !important; /* Darker WhatsApp Teal */
    color: #FFFFFF !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 14px rgba(18, 140, 126, 0.4) !important;
}

.wc-quotation-form .wc-quotation-btn:active:not(:disabled) {
    transform: translateY(0) !important;
}

.wc-quotation-form .wc-quotation-btn:disabled {
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* WhatsApp Icon SVG Styling */
.wc-quotation-btn svg {
    width: 20px !important;
    height: 20px !important;
    fill: #FFFFFF !important;
    flex-shrink: 0 !important;
}

.wc-quotation-btn:disabled svg {
    fill: #666666 !important;
}

.wc-quotation-msg {
    margin-bottom: 12px !important;
    font-weight: 600 !important;
    color: #0073aa !important;
}

/* ==========================================================================
   3. DASHBOARD TABLE & FEEDBACK MESSAGES
   ========================================================================== */
.wc-quotation-dashboard table.wc-quotation-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 20px !important;
}

.wc-quotation-dashboard table.wc-quotation-table th,
.wc-quotation-dashboard table.wc-quotation-table td {
    border: 1px solid #ddd !important;
    padding: 8px !important;
}

.wc-quotation-dashboard table.wc-quotation-table th {
    background: #f1f1f1 !important;
    text-align: left !important;
}

#quotation-response p {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    margin: 10px 0;
    font-weight: 500;
}

#quotation-response p.show {
    opacity: 1;
}

.success { color: #4caf50 !important; }
.error { color: #f44336 !important; }
.loading {
    color: #0073aa !important;
    display: flex !important;
    align-items: center !important;
}

.loading::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid #0073aa;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   4. MOBILE RESPONSIVENESS (CENTERED LAYOUT & TEXT-SIZED BUTTON)
   ========================================================================== */
@media screen and (max-width: 768px) {
    form.cart.wc-quotation-form,
    .wc-quotation-form {
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
    }

    /* Center Quantity Selector on Mobile */
    .wc-quotation-form .quantity,
    .single-product .wc-quotation-form .quantity {
        display: inline-flex !important;
        justify-content: center !important;
        align-items: center !important;
        float: none !important;
        margin: 0 auto 15px auto !important;
        text-align: center !important;
    }

    .wc-quotation-form .quantity input {
        text-align: center !important;
        margin: 0 auto !important;
    }

    /* Centered WhatsApp Button scaled strictly to text width */
    .wc-quotation-form .wc-quotation-btn,
    button.wc-quotation-btn {
        width: auto !important;       /* Keeps button size hugging the text */
        display: inline-flex !important;
        margin: 0 auto !important;
    }
}