/* WooCommerce Get a Quote Pro Modern CSS */

/* --- Advanced Button Styling --- */
.wcgqp-get-quote-btn,
.wcgqp-whatsapp-btn {
    display: flex !important;
    width: 100% !important;
    align-items: center;
    justify-content: center;
    padding: 12px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    text-align: center;
    text-decoration: none !important;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border-radius: 8px !important;
    transition: all 0.2s ease-in-out !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    border: 1px solid transparent !important;
    margin: 10px 0 0 0 !important;
    outline: none !important;
    box-sizing: border-box !important;
}

/* Primary Target: Get Quote Button */
.wcgqp-get-quote-btn {
    background-color: #111827 !important;
    color: #ffffff !important;
    border-color: #111827 !important;
}

.wcgqp-get-quote-btn:hover {
    background-color: #374151 !important;
    border-color: #374151 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.wcgqp-get-quote-btn:active {
    transform: translateY(0);
}

/* Secondary Target: WhatsApp Button */
.wcgqp-whatsapp-btn {
    background-color: #25D366 !important;
    color: #ffffff !important;
    border-color: #25D366 !important;
}

.wcgqp-whatsapp-btn:hover {
    background-color: #128C7E !important;
    border-color: #128C7E !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 211, 102, 0.4), 0 4px 6px -2px rgba(37, 211, 102, 0.2) !important;
}

.wcgqp-whatsapp-btn:active {
    transform: translateY(0);
}

/* Single Page Button Wrapper */
.wcgqp-single-buttons-wrapper {
    display: inline-flex !important;
    vertical-align: middle !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    margin: 0 !important;
    clear: none !important;
    width: auto !important;
}

.wcgqp-single-buttons-wrapper .wcgqp-get-quote-btn,
.wcgqp-single-buttons-wrapper .wcgqp-whatsapp-btn {
    width: auto !important;
    display: inline-flex !important;
    margin: 0 !important;
}

/* Standard Quantity Alignment Fix */
/* We target with ABSOLUTE specificity to beat almost any theme */
.wcgqp-form div.quantity,
.woocommerce div.product form.cart div.quantity,
.woocommerce-variation-add-to-cart div.quantity {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    margin: 0 15px 0 0 !important;
    padding: 0 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #fff !important;
    height: 48px !important;
    width: auto !important;
}

.wcgqp-form div.quantity .qty,
.woocommerce div.product form.cart div.quantity .qty,
.woocommerce-variation-add-to-cart div.quantity .qty {
    width: 65px !important;
    min-width: 65px !important;
    max-width: 65px !important;
    height: 46px !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-left: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    background: #fff !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    line-height: 46px !important;
}

/* Clear focus on qty and ghost borders */
.wcgqp-form div.quantity .qty:focus,
.wcgqp-form div.quantity .qty:active {
    outline: none !important;
    box-shadow: none !important;
    background: #fff !important;
}

/* Eliminate theme-specific dark lines or shadows */
.quantity::before,
.quantity::after,
.quantity .qty::before,
.quantity .qty::after {
    display: none !important;
    content: none !important;
}

/* Standardized dividers instead of heavy borders */
.wcgqp-form div.quantity .qty {
    border-left: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-right: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-top: none !important;
    border-bottom: none !important;
    box-sizing: border-box !important;
    background-image: none !important;
    /* Hide theme ghost arrows */
}

/* Hard Reset for spin buttons */
.quantity .qty::-webkit-outer-spin-button,
.quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Standardized +/- Buttons */
.wcgqp-form div.quantity .minus,
.wcgqp-form div.quantity .plus,
.woocommerce div.product form.cart div.quantity .minus,
.woocommerce div.product form.cart div.quantity .plus {
    width: 44px !important;
    height: 46px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f8fafc !important;
    border: none !important;
    /* Managed by container */
    cursor: pointer !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    user-select: none !important;
    outline: none !important;
}

.wcgqp-form .quantity .minus:hover,
.wcgqp-form .quantity .plus:hover {
    background: #f1f5f9 !important;
    color: #2563eb !important;
}

.wcgqp-form .quantity .minus:active,
.wcgqp-form .quantity .plus:active {
    background: #e2e8f0 !important;
    transform: scale(0.95);
}

/* Ensure the 'Get Quote' button matches the height */
.wcgqp-get-quote-btn,
.wcgqp-whatsapp-btn {
    height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 0 24px !important;
    margin: 0 !important;
    line-height: normal !important;
    white-space: nowrap !important;
}

.wcgqp-get-quote-btn svg,
.wcgqp-whatsapp-btn svg {
    flex-shrink: 0 !important;
}

/* Standard Hiding for the native ATC button */
.single_add_to_cart_button:not(.wcgqp-get-quote-btn),
button.alt[name="add-to-cart"]:not(.wcgqp-get-quote-btn) {
    display: none !important;
}

/* --- Modal UI --- */

/* Overlay */
.wcgqp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wcgqp-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.wcgqp-modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 700px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.wcgqp-modal-overlay.is-active .wcgqp-modal-container {
    transform: scale(1) translateY(0);
}

/* Header */
.wcgqp-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.wcgqp-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.wcgqp-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    transition: color 0.2s ease;
}

.wcgqp-modal-close:hover {
    color: #ef4444;
}

/* Body */
.wcgqp-modal-body {
    padding: 24px;
    overflow-y: auto;
}

/* Product Info */
.wcgqp-product-info-wrapper {
    background: #f3f4f6;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.wcgqp-product-info-wrapper .wcgqp-product-title {
    margin: 0 0 8px 0;
    font-size: 1.125rem;
    color: #1f2937;
    font-weight: 600;
}

.wcgqp-product-info-wrapper .wcgqp-product-attributes {
    margin: 0;
    font-size: 0.875rem;
    color: #4b5563;
}

/* Form Styling */
.wcgqp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.wcgqp-form-row {
    margin-bottom: 0;
    /* Reset for grid */
}

.wcgqp-form-row.wcgqp-full-width {
    margin-bottom: 16px;
}

.wcgqp-form-row label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.wcgqp-form-row label .required {
    color: #ef4444;
}

.wcgqp-input,
.wcgqp-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    color: #111827;
    box-sizing: border-box;
}

.wcgqp-input:focus,
.wcgqp-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wcgqp-textarea {
    resize: vertical;
}

/* Footer / Buttons */
.wcgqp-modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.wcgqp-modal-footer button {
    flex: 1 1 auto;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.wcgqp-btn-primary {
    background-color: #111827 !important;
    color: #ffffff !important;
}

.wcgqp-btn-primary:hover {
    background-color: #374151 !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.wcgqp-btn-secondary {
    background-color: #25D366 !important;
    color: #ffffff !important;
}

.wcgqp-btn-secondary:hover {
    background-color: #128C7E !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 211, 102, 0.4) !important;
}

/* Notices */
.wcgqp-notices {
    margin-top: 15px;
    font-size: 0.9rem;
}

.wcgqp-notice-success {
    color: #059669;
    background: #d1fae5;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid #10b981;
}

.wcgqp-notice-error {
    color: #dc2626;
    background: #fee2e2;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid #ef4444;
}

/* Responsive */
@media (max-width: 768px) {
    .wcgqp-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .wcgqp-modal-container {
        max-width: 95%;
        margin: 20px;
    }

    .wcgqp-modal-footer {
        flex-direction: column;
    }

    .wcgqp-modal-footer button {
        width: 100%;
        margin-left: 0 !important;
    }
}
.wcgqp-invalid { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important; }
