:root {
    --apq-navy: #123f6d;
    --apq-blue: #007cba;
    --apq-light: #f5f8fb;
    --apq-border: #dce6ef;
    --apq-text: #17324d;
    --apq-muted: #6d7d8c;
    --apq-success: #28a745;
}

/* ============================================================
   ADVANCE POOLS — CONVERSATIONAL QUOTE OVERLAY
   Bricks Builder CSS field
   ============================================================ */

.apq-conversation {
    width: 100%;
    max-width: 760px;
    margin: 20px auto 35px;
    font-family: inherit;
}

.apq-shell {
    background: #fff;
    border: 1px solid var(--apq-border);
    border-radius: 18px;
    box-shadow: 0 12px 38px rgba(23, 50, 77, 0.10);
    overflow: hidden;
}

/* ============================================================
   HEADER — WhatsApp-style contact header
   ============================================================ */

.apq-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 26px;
    border-bottom: 1px solid var(--apq-border);
}

.apq-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.apq-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--apq-navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
}

.apq-avatar-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--apq-success);
    border: 2px solid #fff;
}

.apq-header-name {
    color: var(--apq-navy);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.apq-header-status {
    color: var(--apq-success);
    font-size: 12px;
    font-weight: 500;
    margin-top: 2px;
}

/* Progress bar */

.apq-progress-track {
    height: 5px;
    background: #eef3f7;
}

.apq-progress-bar {
    height: 100%;
    width: 0;
    background: var(--apq-blue);
    transition: width .3s ease;
}

/* Main conversation */

.apq-body {
    padding: 24px 26px 28px;
}

.apq-history {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.apq-row {
    display: flex;
    animation: apq-pop-in .35s ease backwards;
}

@keyframes apq-pop-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.apq-row-bot {
    justify-content: flex-start;
}

.apq-row-user {
    justify-content: flex-end;
}

.apq-bubble {
    max-width: 82%;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
}

.apq-bot {
    background: var(--apq-light);
    color: var(--apq-text);
    border-bottom-left-radius: 4px;
}

.apq-user {
    background: var(--apq-navy);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Questions */

.apq-question {
    color: var(--apq-navy);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 16px;
}

.apq-help {
    color: var(--apq-muted);
    font-size: 13px;
    margin: -8px 0 16px;
    line-height: 1.5;
}

.apq-controls {
    min-height: 70px;
}

/* Option / pool buttons */

.apq-pool-confirm {
    text-align: center;
    padding: 20px 16px;
    background: var(--apq-light);
    border-radius: 14px;
    margin-bottom: 6px;
}

.apq-pool-confirm-name {
    color: var(--apq-navy);
    font-size: 20px;
    font-weight: 700;
}

.apq-chips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.apq-chip {
    appearance: none;
    border: 1.5px solid var(--apq-border);
    background: #fff;
    color: var(--apq-navy);
    border-radius: 13px;
    padding: 15px 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    text-align: center;
    transition:
        transform .15s ease,
        border-color .15s ease,
        box-shadow .15s ease,
        background .15s ease;
}

.apq-chip:hover {
    transform: translateY(-1px);
    border-color: var(--apq-blue);
    box-shadow: 0 6px 18px rgba(0, 124, 186, .10);
}

.apq-chip.is-selected {
    background: var(--apq-navy);
    border-color: var(--apq-navy);
    color: #fff;
}

/* Real JetFormBuilder fields moved into conversation */

.apq-real-row {
    width: 100%;
    margin: 0 !important;
}

.apq-real-row label,
.apq-real-row .jet-form-builder__label {
    color: var(--apq-text);
    font-weight: 600;
}

.apq-real-row input,
.apq-real-row select,
.apq-real-row textarea {
    width: 100% !important;
    min-height: 48px;
    border: 1.5px solid var(--apq-border) !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: var(--apq-text) !important;
    padding: 10px 12px !important;
    box-shadow: none !important;
}

.apq-real-row input:focus,
.apq-real-row select:focus,
.apq-real-row textarea:focus {
    border-color: var(--apq-blue) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, .10) !important;
}

/* Address section */

.apq-dims-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.apq-suppress-label > label,
.apq-suppress-label .jet-form-builder__label,
.apq-suppress-label .jet-form-builder__desc,
.apq-suppress-label .description {
    display: none;
}

.apq-address-stack .pqs-msg:not(:last-of-type) {
    display: none;
}

.apq-address-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.apq-conversation .manual-address-wrapper {
    width: 100%;
    margin: 6px 0 0 !important;
    box-sizing: border-box;
}

/* Buttons */

.apq-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.apq-btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 12px 22px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.apq-btn-primary {
    background: var(--apq-blue);
    color: #fff;
}

.apq-btn-primary:hover {
    filter: brightness(.95);
}

.apq-btn-secondary {
    background: #eef3f7;
    color: var(--apq-navy);
}

/* Validation / messages */

.apq-error {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    font-size: 13px;
    line-height: 1.4;
}

.apq-contact-note {
    background: var(--apq-light);
    border-radius: 10px;
    padding: 11px 13px;
    color: var(--apq-muted);
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 14px;
}

/* Final step */

.apq-final {
    text-align: center;
    padding: 12px 0 4px;
}

.apq-final-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaf7ed;
    color: var(--apq-success);
    font-size: 26px;
    font-weight: 700;
}

/*
 * Parking area for the real JetFormBuilder fields.
 * JS temporarily moves the actual fields from here
 * into the visible conversation.
 *
 * Do NOT change this to display:none.
 */

.apq-depot {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Original elements that must remain alive but invisible */

.apq-hidden-original {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/*
 * Suppress Form 24's own full-screen loading overlay. Form 24's
 * submit/validation/PQS logic that creates and manages this
 * overlay is untouched — the conversation panel now shows its
 * own "preparing your quote" progress inside the chat thread
 * instead, so this element is simply never shown. Scoped to this
 * Bricks page's own CSS field, so the classic /get-quote/ page
 * is unaffected.
 */

.pqs-loading-overlay,
.pqs-relining-overlay {
    display: none !important;
}

/* ============================================================
   RESULT BUBBLES — [apq_quote_bubbles] on the quote result page
   ============================================================ */

.apq-result-history {
    margin-bottom: 0;
}

.apq-bubble-wide {
    max-width: 100%;
}

.apq-bubble-wide p {
    margin: 0 0 8px;
}

.apq-bubble-wide p:last-child {
    margin-bottom: 0;
}

.apq-bubble-heading {
    color: var(--apq-navy);
    font-size: 18px;
    font-weight: 700;
}

.apq-bubble-image img {
    display: block;
    width: 100%;
    max-width: 320px;
    border-radius: 12px;
    margin: 0 auto;
}

.apq-bubble-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.apq-bubble-dims li {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid var(--apq-border);
    font-size: 14px;
}

.apq-bubble-dims li:last-child {
    border-bottom: none;
}

.apq-bubble-dims li span {
    color: var(--apq-muted);
}

.apq-bubble-dims li strong {
    color: var(--apq-text);
}

.apq-bubble-inclusions .quote-subtitle {
    color: var(--apq-navy);
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 8px;
}

.apq-bubble-inclusions ul {
    margin: 0;
    padding-left: 18px;
}

.apq-bubble-inclusions li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    line-height: 1.6;
}

.factory-pricing-breakdown {
    font-size: 14px;
}

.factory-pricing-breakdown .pricing-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.factory-pricing-breakdown .pricing-line.total {
    border-top: 1px solid var(--apq-border);
    margin-top: 4px;
    padding-top: 10px;
    font-weight: 700;
    color: var(--apq-navy);
}

.factory-pricing-breakdown .discount-amount {
    color: var(--apq-success);
}

.factory-manager-details .factory-name {
    color: var(--apq-navy);
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 8px;
}

.relining-quote-container {
    font-size: 14px;
}

.relining-quote-container .cost-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.relining-quote-container .cost-item.total-cost {
    border-top: 1px solid var(--apq-border);
    margin-top: 4px;
    padding-top: 10px;
    font-weight: 700;
    color: var(--apq-navy);
}

.factory-manager-details .manager-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.factory-manager-details .manager-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.factory-manager-details .manager-name,
.factory-manager-details .manager-position,
.factory-manager-details .contact-number {
    margin: 0;
    font-size: 13px;
    color: var(--apq-text);
}

.factory-manager-details .manager-position {
    color: var(--apq-muted);
}

.factory-manager-details .contact-number .call-button {
    color: var(--apq-blue);
    font-weight: 700;
    text-decoration: none;
}

.factory-manager-details h4.manager-name {
    font-size: 14px;
    color: var(--apq-navy);
    font-weight: 700;
}

.apq-whatsapp-btn {
    display: inline-block;
    background: var(--apq-success);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 999px;
}

/*
 * Hide the raw JetFormBuilder forms from first paint, so the customer
 * never sees a brief flash of the plain unstyled fields before our JS
 * finishes building the chat overlay. The widget's own script adds the
 * "apq-ready" class once it's fully built; a small JS safety-net
 * timeout also force-reveals the form even if the widget script fails,
 * so the page can never get stuck permanently blank.
 */
form[data-form-id="24"],
form[data-form-id="2269"] {
    visibility: hidden;
}

form[data-form-id="24"].apq-ready,
form[data-form-id="2269"].apq-ready {
    visibility: visible;
}

/* Mobile */

@media (max-width: 680px) {

    .apq-header,
    .apq-body {
        padding-left: 18px;
        padding-right: 18px;
    }

    .apq-chips {
        grid-template-columns: 1fr;
    }

    .apq-dims-grid {
        grid-template-columns: 1fr;
    }

    .apq-chip {
        text-align: left;
        padding: 14px 15px;
    }

    .apq-bubble {
        max-width: 90%;
    }

    .apq-question {
        font-size: 19px;
    }
}