/* حزمة صفحات عرض السعر الديناميكية (منتجات متعددة الصفحات) */
.quote-a4-document-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100%;
}

.quote-a4-document-stack > .quote-a4.quote-a4--nebras-official {
    margin-bottom: 0;
}

.quote-official-page-continue {
    font-size: 9px;
    font-weight: 700;
    color: #1a365d;
    text-align: center;
    margin: 0 0 8px;
    padding: 5px 10px;
    background: #f0f5f9;
    border-radius: 4px;
}

/* صيغة عرض السعر الرسمية — مطابقة لمرجع PDF (م صالح - جده - 935) */

.quote-a4.quote-a4--nebras-official {
    padding: 0 11mm 10mm;
    overflow: visible;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 10.5px;
    line-height: 1.45;
    color: #1a2b3c;
    direction: rtl;
    unicode-bidi: plaintext;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    background: #fff;
    min-height: 297mm;
    height: 297mm;
    box-sizing: border-box;
}

.quote-a4--nebras-official .quote-a4-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    height: 100%;
}

/* رأس ثابت (صورة) — مطابق لرأس صفحات الشروط 2–4 — في كل صفحة ديناميكية */
.quote-official-fixed-header-wrap {
    margin: 0 -11mm 8px;
    line-height: 0;
    flex-shrink: 0;
}

.quote-official-fixed-header {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    max-width: none;
}

.quote-official-fixed-header--static-crop {
    display: block;
    width: 100%;
    height: 88px;
    object-fit: cover;
    object-position: top center;
    border: 0;
}

.quote-official-branded-band--fallback {
    line-height: normal;
}

.quote-official-branded-band--fallback[hidden],
.quote-official-branded-band--fallback[aria-hidden="true"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

/* شريط الرأس HTML — احتياط عند فشل تحميل الصورة الثابتة */
.quote-official-branded-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 -11mm 8px;
    padding: 10px 11mm 11px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #0a1628 0%, #0d1f38 100%);
    color: #fff;
    border-bottom: 3px solid #17a8a0;
}

.quote-official-branded-band-meta {
    font-size: 9px;
    font-weight: 700;
    line-height: 1.65;
    text-align: start;
    flex: 0 0 auto;
    letter-spacing: 0.02em;
}

.quote-official-branded-band-brand {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.quote-official-branded-band-titles {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: end;
}

.quote-official-branded-band-titles strong {
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.01em;
}

.quote-official-branded-band-titles span {
    font-size: 7.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.92;
}

.quote-official-branded-band-logo {
    display: block;
    flex: 0 0 auto;
    max-height: 52px;
    max-width: 72px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.quote-a4-health-status {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.55;
    white-space: pre-wrap;
    direction: rtl;
    background: #f4f8fb;
    border: 1px solid #c8d4dc;
    color: #1a365d;
}

.quote-a4-health-status--ok { border-color: #17a8a0; background: #f0faf9; }
.quote-a4-health-status--warn { border-color: #e8b84a; background: #fffbf0; }
.quote-a4-health-status--busy { border-color: #9bb4c8; color: #556; }

.quote-a4-health-status:not([hidden]) { display: block; }

.quote-official-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.quote-official-header-meta {
    font-size: 9.5px;
    font-weight: 700;
    color: #111;
    line-height: 1.55;
    text-align: start;
    flex: 0 0 auto;
}

.quote-official-header-logo {
    flex: 1 1 auto;
    text-align: end;
}

.quote-official-header-logo img,
.quote-official-logo {
    display: inline-block;
    max-height: 58px;
    max-width: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.quote-official-divider {
    height: 4px;
    background: #17a8a0;
    margin: 6px 0 10px;
    border-radius: 1px;
}

.quote-official-meta-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-size: 10px;
}

.quote-official-meta-table td {
    border: 1px solid #c8d4dc;
    padding: 5px 8px;
    vertical-align: middle;
}

.quote-official-meta-table .quote-official-meta-en {
    width: 22%;
    color: #1a365d;
    font-weight: 600;
    text-align: start;
}

.quote-official-meta-table .quote-official-meta-val {
    width: 34%;
    text-align: center;
    font-weight: 700;
    color: #111;
}

.quote-official-meta-table .quote-official-meta-ar {
    width: 22%;
    color: #1a365d;
    font-weight: 600;
    text-align: end;
}

.quote-official-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9.5px;
    margin-bottom: 10px;
}

.quote-official-items-table thead th {
    background: #1a365d;
    color: #fff;
    font-weight: 700;
    padding: 7px 5px;
    border: 1px solid #1a365d;
    text-align: center;
    white-space: nowrap;
}

.quote-official-items-table tbody td {
    border: 1px solid #c8d4dc;
    padding: 7px 5px;
    vertical-align: top;
}

.quote-official-items-table .quote-official-desc {
    text-align: start;
    min-width: 140px;
}

.quote-official-items-table .quote-official-desc-en {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.quote-official-items-table .quote-official-desc-ar {
    display: block;
    color: #333;
}

.quote-official-items-table .quote-official-num {
    text-align: center;
    white-space: nowrap;
}

.quote-official-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
    align-items: stretch;
}

.quote-official-words-box {
    border: 1px solid #c8d4dc;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    min-height: 120px;
}

.quote-official-words-box p {
    margin: 0;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.65;
    color: #1a365d;
}

.quote-official-totals-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.quote-official-totals-table td {
    border: 1px solid #c8d4dc;
    padding: 6px 8px;
}

.quote-official-totals-table .quote-official-totals-en {
    color: #1a365d;
    font-weight: 600;
    width: 28%;
}

.quote-official-totals-table .quote-official-totals-val {
    text-align: center;
    font-weight: 700;
    width: 22%;
}

.quote-official-totals-table .quote-official-totals-ar {
    color: #1a365d;
    font-weight: 600;
    text-align: end;
    width: 28%;
}

.quote-official-totals-table tr.quote-official-totals-grand td {
    background: #f0f4f8;
    font-size: 11px;
    font-weight: 800;
}

.quote-official-footer {
    margin-top: auto;
    padding-top: 8px;
}

.quote-official-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 9.5px;
    line-height: 1.6;
    color: #1a365d;
}

.quote-official-footer-sales strong {
    display: block;
    font-size: 10px;
    margin-bottom: 4px;
    color: #111;
}

.quote-official-footer-address {
    text-align: end;
}

.quote-official-footer-address .quote-official-web {
    display: block;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-top: 4px;
    color: #17a8a0;
}

.quote-official-footer-phones {
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
}

@media (max-width: 640px) {
    .quote-official-bottom,
    .quote-official-footer-grid {
        grid-template-columns: 1fr;
    }

    .quote-official-footer-address {
        text-align: start;
    }

    .quote-official-items-table {
        font-size: 8px;
    }
}

@media print {
    .quote-a4-document-stack {
        gap: 0;
    }

    .quote-a4-document-stack .quote-a4.quote-a4--nebras-official {
        page-break-after: always;
        margin-bottom: 0;
        box-shadow: none;
    }

    .quote-a4--nebras-official {
        height: 297mm;
        min-height: 297mm;
        page-break-after: always;
        font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif !important;
        direction: rtl !important;
    }

    .quote-official-meta-table td,
    .quote-official-items-table td,
    .quote-official-items-table th {
        font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif !important;
    }
}
