/*
 * GR Quotes - Front-end styles
 * Vanilla CSS - no third-party frameworks.
 */

/* -----------------------------------------------------------
 * Request Quote button (cart page + mini-cart widget)
 * ----------------------------------------------------------- */
.gr-quotes-request-button {
    display: inline-block;
}

.woocommerce .gr-quotes-request-button.button.alt {
    padding-left: 1.2em;
    padding-right: 1.2em;
}

/* -----------------------------------------------------------
 * Quote Request Form (responsive)
 * ----------------------------------------------------------- */
.gr-quotes-form {
    max-width: 900px;
    margin: 0 auto;
}

.gr-quotes-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}

.gr-quotes-form__field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.gr-quotes-form__field--full,
.gr-quotes-form__field--message,
.gr-quotes-form__field--address {
    grid-column: 1 / -1;
}

.gr-quotes-form__field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    color: #1d2327;
}

.gr-quotes-form__field input[type="text"],
.gr-quotes-form__field input[type="email"],
.gr-quotes-form__field input[type="tel"],
.gr-quotes-form__field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.4;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #fff;
    color: #1d2327;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gr-quotes-form__field input:focus,
.gr-quotes-form__field textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.gr-quotes-form__field textarea {
    resize: vertical;
    min-height: 120px;
}

.gr-quotes-form__field.has-error input,
.gr-quotes-form__field.has-error textarea {
    border-color: #d63638;
    box-shadow: 0 0 0 1px #d63638;
}

.gr-quotes-form__error {
    margin: 6px 0 0;
    font-size: 13px;
    color: #d63638;
}

.gr-quotes-required {
    color: #d63638;
    margin-left: 2px;
}

.gr-quotes-form__actions {
    margin-top: 20px;
    text-align: right;
}

.gr-quotes-form__submit {
    min-width: 200px;
}

/* -----------------------------------------------------------
 * Form-level status message + spinner (AJAX)
 * ----------------------------------------------------------- */
.gr-quotes-form__message {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid transparent;
}

.gr-quotes-form__message--success {
    color: #0f5132;
    background: #d1e7dd;
    border-color: #badbcc;
}

.gr-quotes-form__message--error {
    color: #842029;
    background: #f8d7da;
    border-color: #f5c2c7;
}

.gr-quotes-form.is-loading {
    opacity: 0.85;
    pointer-events: none;
}

.gr-quotes-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -2px;
    animation: gr-quotes-spin 0.7s linear infinite;
}

@keyframes gr-quotes-spin {
    to { transform: rotate(360deg); }
}

/* Small screens */
@media (max-width: 640px) {
    .gr-quotes-form__grid {
        grid-template-columns: 1fr;
    }
    .gr-quotes-form__actions {
        text-align: stretch;
    }
    .gr-quotes-form__submit {
        width: 100%;
    }
}

/* -----------------------------------------------------------
 * Dedicated Request Quote Page Styles
 * ----------------------------------------------------------- */
.gr-quotes-request-page {
    margin-bottom: 40px;
}

.gr-quotes-summary-table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 24px !important;
}

.gr-quotes-summary-table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.gr-quotes-summary-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.gr-quotes-empty-message {
    padding: 16px;
    background-color: #e9ecef;
    border-radius: 4px;
    color: #495057;
}
