/**
 * Frontend CSS for WPC Request a Quote
 */

/* Add to quote button wrapper */
.wpcrq-add-to-quote-wrapper {
    margin-bottom: 20px;
}

.wpcrq-add-to-quote-wrapper.wpcrq-single {
    margin-top: 15px;
}

/* Button states */
a.wpcrq-btn {
    position: relative;
    transition: all 0.3s ease;
}

a.wpcrq-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

a.wpcrq-btn.loading::after {
    content: "\f463";
    font-family: dashicons;
    display: inline-block;
    margin-left: 5px;
    animation: spin 2s infinite linear;
}

a.wpcrq-btn.added {
    background-color: #28a745;
    color: #fff;
}

a.wpcrq-btn.added::after {
    content: "\f147";
    font-family: dashicons;
    display: inline-block;
    margin-left: 5px;
}

/* Quote Review Page */
.wpcrq-quote-review-wrapper {
    margin: 20px 0;
}

.wpcrq-quote-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.wpcrq-quote-actions .button {
    padding: 12px 25px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 4px;
}

.wpcrq-quote-actions button[type="submit"].alt {
    background-color: #96588a;
    color: #fff;
}

.wpcrq-quote-actions button[type="submit"].alt:hover {
    background-color: #7a4770;
}

.wpcrq-quote-actions button:not(.alt) {
    background-color: #f1f1f1;
    color: #333;
}

.wpcrq-quote-actions button:not(.alt):hover {
    background-color: #e2e2e2;
}

.wpcrq-variation-selection-needed .wpcrq-add-to-quote {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(359deg);
    }
}

/* Quote Page Layout */
.wpcrq-quote-page {
    display: block;
}

.wpcrq-quote-page.wpcrq-layout-right {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.wpcrq-quote-table-wrapper {
    width: 100%;
    margin-bottom: 30px;
}

.wpcrq-quote-page.wpcrq-layout-right .wpcrq-quote-table-wrapper {
    flex: 1.5;
}

.wpcrq-quote-page.wpcrq-layout-right .wpcrq-quote-form-wrapper {
    flex: 1;
    margin-bottom: 0;
}

.wpcrq-quote-form-wrapper {
    width: 100%;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
}

@media screen and (max-width: 768px) {
    .wpcrq-quote-page.wpcrq-layout-right {
        flex-direction: column;
    }
}

/* Form styling */
.wpcrq-quote-form .form-row-first {
    float: left;
    width: 48%;
}

.wpcrq-quote-form .form-row-last {
    float: right;
    width: 48%;
}

.wpcrq-quote-form .clear {
    clear: both;
}

/* Response messaging */
.wpcrq-form-response {
    margin-top: 15px;
    padding: 10px;
    display: none;
}

.wpcrq-form-response.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wpcrq-form-response.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Table alignment */
.wpcrq-quote-table .product-subtotal,
.wpcrq-quote-review-wrapper .product-total,
.wpcrq-quote-review-wrapper tfoot td {
    text-align: right;
}

.wpcrq-quote-review-wrapper tfoot th {
    text-align: left;
}

@media screen and (max-width: 600px) {
    .wpcrq-quote-review-wrapper .product-total,
    .wpcrq-quote-review-wrapper tfoot td {
        text-align: left;
    }
}

.wpcrq-cart-btn {
    display: block;
    width: 100%;
    margin-top: 10px !important;
    background-color: #96588a !important;
    color: #fff !important;
    text-align: center;
}

.wpcrq-cart-btn:hover {
    background-color: #7a4770 !important;
}
