/* ============================================================
   v3 — FL611291 order builder: multi-colour per model + ratio template
   ============================================================ */
.af-prod-order-btn {
    display: inline-flex; align-items: center; gap: 7px; margin-top: 14px;
    padding: 10px 15px; border-radius: 10px; cursor: pointer;
    border: 1px solid rgba(230,201,141,.65); background: linear-gradient(135deg,#e6c98d,#cfa15c);
    color: #10233c; font-weight: 800; font-size: 13px; letter-spacing: .2px;
    transition: transform .18s, box-shadow .18s;
}
.af-prod-order-btn:hover, .af-prod-order-btn:focus-visible {
    transform: translateY(-2px); box-shadow: 0 8px 20px rgba(230,201,141,.28); outline: none;
}
.af-prod-order-btn::after { content: "\2192"; font-size: 15px; }

.af-order-mask {
    position: fixed; inset: 0; z-index: 10000; display: none;
    align-items: flex-start; justify-content: center; padding: 24px 16px;
    background: rgba(2,10,24,.94); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    overflow-y: auto;
}
.af-order-mask.on { display: flex; }
.af-order-dialog {
    width: min(920px, 100%); margin: auto; border-radius: 18px; overflow: hidden;
    border: 1px solid rgba(230,201,141,.45); background: linear-gradient(160deg,#0a2240,#06182c 62%);
    box-shadow: 0 28px 80px rgba(0,0,0,.6);
}
.af-order-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 20px 24px; border-bottom: 1px solid rgba(230,201,141,.25);
    background: linear-gradient(135deg,rgba(230,201,141,.12),transparent 70%);
}
.af-order-head h3 { margin: 0; color: #fff; font: 800 20px/1.3 var(--font-h, sans-serif); }
.af-order-head p { margin: 6px 0 0; color: var(--txt-2,#a8c5d4); font-size: 13px; line-height: 1.55; }
.af-order-x {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
    border: 1px solid rgba(230,201,141,.45); background: rgba(8,24,44,.9); color: #fff; font-size: 22px; line-height: 1;
}
.af-order-x:hover { background: rgba(230,201,141,.18); }
.af-order-body { padding: 22px 24px 26px; }

.af-order-terms { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.af-order-terms span {
    padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.4;
    border: 1px solid rgba(230,201,141,.4); background: rgba(230,201,141,.1); color: #f0d79c;
}
.af-order-terms span:first-child { border-color: rgba(0,229,255,.42); background: rgba(0,229,255,.1); color: #bff4ff; }

.af-order-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.af-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.af-field[hidden] { display: none !important; }

/* ---- multi-colour draft for one model ---- */
.af-colour-box {
    margin-top: 16px; padding: 14px 16px; border-radius: 12px;
    border: 1px solid rgba(0,229,255,.3); background: rgba(0,229,255,.055);
}
.af-colour-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.af-colour-head strong { color: #bff4ff; font: 700 13px/1.4 var(--font-h, sans-serif); }
.af-colour-add {
    padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 12.5px;
    border: 1px solid rgba(0,229,255,.45); background: rgba(0,229,255,.12); color: #bff4ff;
}
.af-colour-add:hover { background: rgba(0,229,255,.22); }
.af-colour-rows { display: grid; gap: 8px; margin-top: 12px; }
.af-colour-row { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(90px,.7fr) 30px; gap: 8px; align-items: center; }
.af-colour-row select, .af-colour-row input {
    width: 100%; min-width: 0; padding: 9px 10px; border-radius: 9px;
    border: 1px solid rgba(230,201,141,.3); background: rgba(4,18,36,.9); color: #eaf5ff;
    font: 500 13px/1.4 inherit; outline: none;
}
.af-colour-row select:focus, .af-colour-row input:focus { border-color: #e6c98d; box-shadow: 0 0 0 3px rgba(230,201,141,.12); }
.af-colour-row select option { background: #0a2240; color: #eaf5ff; }
.af-colour-row input { text-align: right; font-variant-numeric: tabular-nums; }
.af-colour-del {
    width: 28px; height: 28px; border-radius: 7px; cursor: pointer; color: #ffb4b4;
    border: 1px solid rgba(255,120,120,.3); background: rgba(255,80,80,.08); font-size: 16px; line-height: 1;
}
.af-colour-del:hover { background: rgba(255,80,80,.2); }
.af-colour-note { margin: 11px 0 0; color: #9fc7d8; font-size: 12px; line-height: 1.55; }
.af-draft-total { display: flex; justify-content: flex-end; gap: 10px; align-items: baseline; margin-top: 10px; color: #cfe2f0; font-size: 13px; }
.af-draft-total strong { color: #f0d79c; font-size: 16px; font-variant-numeric: tabular-nums; }
.af-order-group td {
    background: rgba(230,201,141,.09); color: #f0d79c; font-size: 12.5px; font-weight: 700;
}
.af-order-group td span { float: right; color: #bff4ff; font-weight: 700; }
.af-field > label { color: #e6c98d; font: 700 12px/1.3 var(--font-h, sans-serif); letter-spacing: .3px; }
.af-field select, .af-field input, .af-order-note {
    width: 100%; min-width: 0; padding: 10px 11px; border-radius: 9px;
    border: 1px solid rgba(230,201,141,.32); background: rgba(4,18,36,.9); color: #eaf5ff;
    font: 500 13.5px/1.4 inherit; outline: none;
}
.af-field select:focus, .af-field input:focus, .af-order-note:focus { border-color: #e6c98d; box-shadow: 0 0 0 3px rgba(230,201,141,.13); }
.af-field select option { background: #0a2240; color: #eaf5ff; }

.af-order-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.af-order-add {
    padding: 11px 18px; border-radius: 10px; cursor: pointer; font-weight: 800; font-size: 13.5px;
    border: 1px solid rgba(0,229,255,.5); background: rgba(0,229,255,.14); color: #bff4ff;
}
.af-order-add:hover { background: rgba(0,229,255,.24); }
.af-order-hint { color: var(--txt-2,#a8c5d4); font-size: 12.5px; }

.af-order-table-wrap { margin-top: 20px; overflow-x: auto; border: 1px solid rgba(230,201,141,.22); border-radius: 12px; }
.af-order-table { width: 100%; border-collapse: collapse; min-width: 660px; font-size: 13px; }
.af-order-table th {
    padding: 11px 12px; text-align: left; color: #e6c98d; font-weight: 700;
    background: rgba(230,201,141,.08); border-bottom: 1px solid rgba(230,201,141,.25); white-space: nowrap;
}
.af-order-table td { padding: 10px 12px; color: #d5e6f2; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: middle; }
.af-order-table tr:last-child td { border-bottom: none; }
.af-order-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.af-order-price {
    width: 82px; padding: 7px 8px; border-radius: 7px; text-align: right;
    border: 1px solid rgba(230,201,141,.3); background: rgba(4,18,36,.9); color: #eaf5ff; font-size: 12.5px; outline: none;
}
.af-order-price:focus { border-color: #e6c98d; }
.af-order-price::placeholder { color: #7f9db3; }
.af-order-del {
    width: 28px; height: 28px; border-radius: 7px; cursor: pointer; color: #ffb4b4;
    border: 1px solid rgba(255,120,120,.3); background: rgba(255,80,80,.08); font-size: 16px; line-height: 1;
}
.af-order-del:hover { background: rgba(255,80,80,.2); }
.af-order-empty-row td { text-align: center; color: var(--txt-2,#a8c5d4); padding: 24px 12px; }

.af-order-meta { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.af-order-meta .af-field.full { grid-column: 1 / -1; }
.af-order-note { min-height: 70px; resize: vertical; }
.af-err { border-color: #ff8a8a !important; box-shadow: 0 0 0 3px rgba(255,90,90,.14) !important; }
.af-order-msg {
    display: none; margin: 16px 0 0; padding: 11px 14px; border-radius: 10px;
    border: 1px solid rgba(255,120,120,.45); background: rgba(255,80,80,.1); color: #ffd0d0;
    font-size: 13px; line-height: 1.55;
}
.af-order-msg.on { display: block; }

.af-order-totals {
    display: flex; flex-wrap: wrap; gap: 14px 26px; justify-content: flex-end;
    margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(230,201,141,.25);
}
.af-order-total { color: #cfe2f0; font-size: 13.5px; }
.af-order-total strong { color: #f0d79c; font-size: 17px; margin-left: 8px; font-variant-numeric: tabular-nums; }
.af-order-generate {
    display: block; width: 100%; margin-top: 18px; padding: 14px; border-radius: 12px; cursor: pointer;
    border: 1px solid rgba(230,201,141,.7); background: linear-gradient(135deg,#e6c98d,#cfa15c);
    color: #10233c; font-weight: 800; font-size: 15px;
}
.af-order-generate:hover { filter: brightness(1.06); }

/* ---- PI preview (Word-like A4) ---- */
.af-pi-paper {
    background: #fff; color: #16202c; border-radius: 6px; padding: 38px 38px 38px;
    box-shadow: 0 8px 30px rgba(0,0,0,.35); font: 13px/1.55 Arial, "Helvetica Neue", sans-serif;
}
.af-pi-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 6px; border-bottom: 2px solid #14395f; }
.af-pi-brand { font: 800 18px/1.1 Arial, sans-serif; color: #14395f; letter-spacing: .6px; }
.af-pi-brand small { display: inline; font-size: 8.5px; letter-spacing: 1.2px; color: #5b7186; margin-left: 8px; font-weight: 600; }
.af-pi-title { text-align: right; }
.af-pi-title h4 { margin: 0; font: 800 16px/1.15 Arial, sans-serif; color: #14395f; letter-spacing: .4px; }
.af-pi-title p { margin: 2px 0 0; font-size: 10px; color: #5b7186; line-height: 1.35; }
.af-pi-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 7px 0 5px; }
.af-pi-parties h5 { margin: 0 0 2px; font-size: 9.5px; letter-spacing: .6px; color: #5b7186; text-transform: uppercase; }
.af-pi-parties p { margin: 0; font-size: 10.5px; color: #16202c; line-height: 1.2; }
.af-pi-product { margin: 5px 0 6px; padding: 4px 9px; background: #f5f8fb; border-left: 3px solid #e6c98d; font-size: 10.5px; color: #44586c; }
.af-pi-product b { color: #14395f; }
.af-pi-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.af-pi-table th { background: #14395f; color: #fff; padding: 6px 8px; text-align: left; font-weight: 700; white-space: nowrap; }
.af-pi-table td { padding: 5px 8px; border-bottom: 1px solid #dbe3ec; color: #16202c; }
.af-pi-table td.af-pi-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.af-pi-table td.af-pi-model { background: #eaf1f8; color: #14395f; vertical-align: middle; }
.af-pi-table td.af-pi-model b { font-size: 11.5px; }
.af-pi-table th.af-pi-num { text-align: right; }
.af-pi-grid th, .af-pi-grid td { padding: 4px 8px; }
.af-pi-grid td.af-pi-model { white-space: nowrap; background: transparent; }
.af-pi-grid th:first-child, .af-pi-grid td:first-child { text-align: left; }
.af-pi-grid td.af-pi-num { text-align: center; }
.af-pi-grid th.af-pi-num { text-align: center; }
.af-pi-grid th:last-child, .af-pi-grid td:last-child,
.af-pi-grid th:nth-last-child(2), .af-pi-grid td:nth-last-child(2) { text-align: right; }
html[dir="rtl"] .af-pi-grid td.af-pi-num { text-align: center; }
.af-pi-sum { margin: 18px 0 0 auto; width: min(320px,100%); }
.af-pi-sum div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #dbe3ec; font-size: 13px; }
.af-pi-sum div:last-child { border-bottom: 3px solid #14395f; font-weight: 800; font-size: 15px; color: #14395f; }
.af-pi-notes { margin-top: 22px; padding: 14px 16px; background: #f5f8fb; border-left: 3px solid #e6c98d; }
.af-pi-notes h5 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .6px; color: #14395f; }
.af-pi-notes p { margin: 4px 0; font-size: 11.5px; color: #44586c; }
.af-pi-foot { margin-top: 26px; padding-top: 14px; border-top: 1px solid #dbe3ec; display: flex; justify-content: space-between; font-size: 11px; color: #7a8b9c; }
.af-order-share { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.af-order-share button {
    flex: 1 1 180px; padding: 13px 12px; border-radius: 11px; cursor: pointer; font-weight: 800; font-size: 13.5px;
}
.af-order-share .dl { border: 1px solid #14395f; background: #14395f; color: #fff; }
.af-order-share .wa { border: 1px solid #25d366; background: #25d366; color: #062617; }
.af-order-share .em { border: 1px solid rgba(230,201,141,.7); background: rgba(230,201,141,.16); color: #f0d79c; }
.af-order-back { display: block; margin: 14px auto 0; padding: 9px 18px; border-radius: 9px; cursor: pointer; border: 1px solid rgba(230,201,141,.4); background: transparent; color: #e6c98d; font-size: 13px; }
.af-order-tip { margin: 12px 0 0; color: var(--txt-2,#a8c5d4); font-size: 12px; line-height: 1.55; }

html[dir="rtl"] .af-order-table th, html[dir="rtl"] .af-pi-table th { text-align: right; }
html[dir="rtl"] .af-pi-table td.af-pi-num { text-align: left; }
html[dir="rtl"] .af-pi-product { border-left: none; border-right: 3px solid #e6c98d; }
html[dir="rtl"] .af-pi-title { text-align: left; }
@media (max-width: 760px) {
    .af-order-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .af-order-meta { grid-template-columns: 1fr; }
    .af-order-head, .af-order-body { padding: 17px 16px 20px; }
    .af-pi-paper { padding: 20px 16px; }
    .af-pi-parties { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 430px) {
    .af-order-grid { grid-template-columns: 1fr; }
    .af-order-share button { flex: 1 1 100%; }
    .af-colour-box { padding: 12px; }
    .af-colour-row { grid-template-columns: minmax(0,1fr) 82px 28px; gap: 6px; }
    .af-colour-row select, .af-colour-row input { padding: 8px 7px; font-size: 12px; }
    .af-order-group td span { float: none; display: block; margin-top: 3px; }
}
