/**
 * Product page — Request a Quote (Bootstrap modal)
 * Isolated from global brochure modal styles in app.css
 */

#productQuoteModal.modal {
    z-index: 100000 !important;
}

#productQuoteModal + .modal-backdrop,
body.modal-open .modal-backdrop.show {
    z-index: 99999 !important;
}

.product-quote-modal .modal-dialog {
    max-width: 720px;
    margin: 1.75rem auto;
    overflow: visible;
}

.product-quote-modal .modal-content {
    border: none;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    overflow: visible;
}

.product-quote-modal .modal-body {
    padding: 1.5rem 1.5rem 1.25rem;
    background: #fff;
    overflow: visible;
}

/* Flush header — no stray margin from global styles */
.product-quote-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 1rem;
    margin-bottom: 0;
    padding: 1.125rem 1.5rem;
    background: #0066cc;
    color: #fff;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    text-align: left;
}

.product-quote-modal .modal-title {
    margin: 0;
    font-weight: 600;
    font-size: 1.0625rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.35;
}

.product-quote-modal .btn-close {
    flex-shrink: 0;
    margin: 0;
    padding: 0.5rem;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

.product-quote-modal .btn-close:hover {
    opacity: 1;
}

.product-quote-modal .quote-intro {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    padding: 0.875rem 1rem 0.875rem 1rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0066cc;
    border-radius: 8px;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #334155;
}

.product-quote-modal .quote-intro .fa-info-circle {
    color: #0066cc;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.product-quote-modal .quote-intro .quote-intro-text {
    display: block;
    margin: 0;
}

.product-quote-modal .quote-intro .quote-product-name {
    color: #0f3f7a;
    font-weight: 700;
    white-space: normal;
}

.product-quote-modal .quote-form-alert {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.product-quote-modal .quote-form-alert--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.product-quote-modal .quote-form-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.product-quote-modal .invalid-feedback.dynamic {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: #dc2626;
}

.product-quote-modal .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.125rem 1.25rem;
    margin-bottom: 1.125rem;
}

.product-quote-modal .form-row:last-of-type {
    margin-bottom: 1.25rem;
}

.product-quote-modal .form-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #1e293b;
    letter-spacing: 0.01em;
}

.product-quote-modal .form-label i {
    color: #64748b;
    font-size: 0.875rem;
    width: 1rem;
    text-align: center;
}

.product-quote-modal .form-control {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    min-height: 44px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-quote-modal .form-control:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.product-quote-modal .form-control::placeholder {
    color: #94a3b8;
}

.product-quote-modal .iti {
    width: 100%;
    display: block;
    position: relative;
}

.product-quote-modal .iti.quote-modal-phone-open,
.product-quote-modal.quote-modal-country-open .iti {
    z-index: 100010;
}

.product-quote-modal .iti input[type="tel"] {
    padding-left: 52px;
    width: 100%;
}

.product-quote-modal .iti__selected-flag {
    padding: 0 0 0 10px;
}

.product-quote-modal .form-row.two-col {
    grid-template-columns: 1fr;
}

.product-quote-modal .quote-phone-row {
    position: relative;
    z-index: 20;
    margin-bottom: 1.125rem;
}

.product-quote-modal .quote-phone-field {
    position: relative;
    z-index: 21;
}

.product-quote-modal.quote-modal-country-open .quote-company-field,
.product-quote-modal.quote-modal-country-open .form-check {
    position: relative;
    z-index: 1;
}

.product-quote-modal .iti__dropdown-content {
    z-index: 100011;
    width: 100%;
    min-width: 280px;
    max-height: min(280px, 52vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
    pointer-events: auto;
}

.product-quote-modal .iti__search-input {
    flex-shrink: 0;
    width: 100%;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    padding: 10px 12px;
    font-size: 0.9375rem;
    line-height: 1.45;
    pointer-events: auto;
}

.product-quote-modal .iti__search-input:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.product-quote-modal .iti__country-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    margin: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    pointer-events: auto;
}

.product-quote-modal .iti__country {
    cursor: pointer;
}

/* Portaled intl-tel-input dropdown — must sit above Bootstrap modal */
body .iti--container.quote-iti-dropdown,
body .iti--container {
    z-index: 100200 !important;
    pointer-events: auto !important;
}

body .iti--container .iti__dropdown-content,
body .iti--container .iti__search-input,
body .iti--container .iti__country-list,
body .iti--container .iti__country {
    pointer-events: auto !important;
}

body .iti--container .iti__dropdown-content {
    background: #fff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
    max-height: min(280px, 52vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body .iti--container .iti__search-input {
    color: #1e293b;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 12px;
}

body .iti--container .iti__country-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 220px !important;
    overflow-y: scroll !important;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

body .iti--container .iti__country {
    color: #1e293b;
}

body .iti--container .iti__country.iti__highlight {
    background: #f1f5f9;
}

/* Legacy fallback selector */
.iti--container {
    z-index: 100200 !important;
    pointer-events: auto !important;
}

.iti--container .iti__dropdown-content {
    pointer-events: auto !important;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
    max-height: min(280px, 52vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.iti--container .iti__country-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 220px !important;
    overflow-y: scroll !important;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
}

.iti--container .iti__search-input {
    pointer-events: auto;
}

.product-quote-modal .form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0 0 0.25rem;
    padding: 1rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.product-quote-modal .form-check-input {
    margin-top: 0.2rem;
    flex-shrink: 0;
    width: 1.1em;
    height: 1.1em;
    border-color: #94a3b8;
}

.product-quote-modal .form-check-input:checked {
    background-color: #0066cc;
    border-color: #0066cc;
}

.product-quote-modal .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.product-quote-modal .form-check-label {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #475569;
}

.product-quote-modal .form-check-label a {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.product-quote-modal .modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 0 0 12px 12px;
}

.product-quote-modal .modal-footer .btn-primary {
    margin: 0;
    background: #0066cc;
    border: none;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
}

.product-quote-modal .modal-footer .btn-primary:hover {
    background: #0052a3;
}

.product-quote-modal .modal-footer .btn-outline-secondary {
    margin: 0;
    margin-right: auto;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.product-quote-modal .modal-footer .btn-outline-secondary:hover {
    color: #1e293b;
    background: #f1f5f9;
    border-color: #94a3b8;
}

.product-quote-modal .form-control.is-invalid {
    border-color: #dc3545;
}

.product-quote-modal .form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.15);
}

@media (min-width: 768px) {
    .product-quote-modal .form-row.two-col {
        grid-template-columns: 1fr 1fr;
    }

    .product-quote-modal .form-row.quote-phone-row,
    .product-quote-modal .form-row:has(.quote-company-field) {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .product-quote-modal .modal-dialog {
        margin: 0.75rem;
    }

    .product-quote-modal .modal-body {
        padding: 1.25rem;
    }

    .product-quote-modal .modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .product-quote-modal .modal-footer .btn-outline-secondary {
        margin-right: 0;
    }
}

/* Stop page / modal scroll while intl-tel-input country list is open */
body.quote-country-dropdown-open {
    overflow: hidden !important;
}

body.quote-country-dropdown-open #productQuoteModal.modal {
    overflow: hidden !important;
}

body.quote-country-dropdown-open #smooth-wrapper,
body.quote-country-dropdown-open #smooth-content {
    overflow: hidden !important;
    touch-action: none;
}
