/* Iron Republic PH: quote.html, the Steel List Builder (proposal 04). Tokens and components from base.css. */

/* The page has its own sticky Viber bar on mobile, so the floating button would sit on top of it */
.pg-quote .fab { display: none !important; }

/* ---------- Head ---------- */
/* Compact head: the list builder has to show in the first screen */
.q-head { padding-block: clamp(18px, 2.6vw, 34px) clamp(22px, 3vw, 40px); }
.q-head .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 24px; align-items: center; }
.q-head .crumbs { align-items: center; margin-bottom: 10px; }
.q-head h1 { font-size: clamp(1.9rem, 3.5vw, 3.1rem); }
.q-head h1 span { display: block; }
.q-head .lead { margin-top: 12px; max-width: none; }
.q-proof { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 18px 0 0; padding: 0; list-style: none; }
/* Model cutout: stands on the hero's bottom edge (cropped there, like the ads), with a base plate at her side */
.q-model { position: relative; align-self: stretch; margin-block: calc(-1 * clamp(18px, 2.6vw, 34px)) calc(-1 * clamp(22px, 3vw, 40px)); }
.q-person { position: absolute; top: 12px; right: 70px; width: auto; height: 640px; max-width: none; filter: drop-shadow(0 18px 18px rgba(0,0,0,.28)); }
.q-plate { position: absolute; left: -56px; bottom: 12px; width: 136px; transform: rotate(-6deg); }
@media (max-width: 1199px) {
  .q-head .wrap { grid-template-columns: minmax(0, 1fr); }
  .q-model { display: none; }
}
@media (max-width: 560px) {
  .q-head .crumbs { display: none; }
  .q-head h1 { font-size: 1.9rem; }
  .q-head .lead { font-size: 1rem; margin-top: 10px; }
  .q-proof { flex-wrap: nowrap; gap: 6px; margin-top: 14px; }
  .q-head .q-proof li { min-height: 32px; padding: 0 10px 0 8px; font-size: .62rem; gap: 5px; white-space: nowrap; }
  .q-head .q-proof li:nth-child(2) { display: none; }
  .q-head .outline { -webkit-text-stroke-width: 2px; }
}
@media (max-width: 359px) { .q-proof { flex-wrap: wrap; } }
.q-proof li { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px 0 10px; border-radius: 999px; background: var(--k); color: var(--w); font: 800 .76rem var(--f-display); font-stretch: 112%; letter-spacing: .04em; text-transform: uppercase; }
.q-proof i { color: var(--y); font-size: 1.2rem; }

/* ---------- Layout ---------- */
.q-sec { padding-block: clamp(16px, 2.4vw, 32px) var(--sec); }
.q-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(16px, 2.4vw, 32px); align-items: start; }
.q-grid[hidden] { display: none; }
@media (max-width: 999px) { .q-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Builder card ---------- */
.builder { background: var(--w); border-radius: 20px; box-shadow: 0 30px 60px -34px rgba(0,0,0,.45); overflow: hidden; }
.b-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 0 clamp(16px, 2.4vw, 26px); background: var(--k); color: var(--w); }
.b-hd h2 { font-size: clamp(.95rem, 1.3vw, 1.1rem); font-stretch: 118%; }
.b-count { display: inline-flex; align-items: center; gap: 6px; font: 900 .9rem var(--f-display); font-stretch: 115%; text-transform: uppercase; color: var(--y); white-space: nowrap; }
.b-count [data-list-count] { font-style: italic; font-stretch: 80%; font-size: 1.4rem; }

.b-search { position: relative; padding: 20px clamp(16px, 2.4vw, 26px) 6px; background: var(--y); border-bottom: 2px solid var(--k); }
.b-label { display: block; margin-bottom: 8px; font: 900 .82rem var(--f-display); font-stretch: 118%; text-transform: uppercase; letter-spacing: .04em; }
.b-search .f-hint { margin: 8px 0 12px; color: var(--k); opacity: .85; }
.combo { position: relative; }
.combo > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 1.25rem; pointer-events: none; }
.combo .f-in { min-height: 56px; padding-left: 46px; border-color: var(--k); font-weight: 600; font-size: 1.05rem; }
.combo .f-in:focus { box-shadow: 0 0 0 4px var(--k); }
.combo-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); max-height: min(360px, 55vh); margin: 0; padding: 6px; overflow-y: auto; list-style: none; background: var(--w); border: 2px solid var(--k); border-radius: var(--r-s); box-shadow: 0 24px 40px -20px rgba(0,0,0,.5); }
.opt { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.opt-img { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 8px; }
.opt-img img { width: 40px; height: 40px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
.opt-img.noimg, .l-thumb.noimg { background: var(--y-3); color: var(--k); }
.opt-img.noimg i { font-size: 1.3rem; }
.opt-t { display: grid; line-height: 1.2; }
.opt-t b { font-weight: 700; }
.opt-t small { color: var(--ink-3); font-size: .78rem; }
.opt:hover { background: var(--g); }
.opt[aria-selected="true"] { background: var(--k); color: var(--w); }
.opt[aria-selected="true"] small { color: var(--on-k-2); }
.opt-custom { border-top: 1px solid var(--g-2); font-weight: 700; }
.opt-custom i { font-size: 1.5rem; width: 40px; text-align: center; }

/* ---------- Lines ---------- */
.lines { margin: 0; padding: 0; list-style: none; counter-reset: ln; }
.lines[hidden] { display: none; }
.line {
  position: relative; display: grid; align-items: center; gap: 8px 14px; counter-increment: ln;
  /* Row 1 name, qty, remove; row 2 a wide size field (long specs like "300 x 300 x 16 mm, 4 holes" fit) and the note */
  grid-template-columns: 64px minmax(0, 4.3fr) minmax(0, 1fr) 150px 44px;
  grid-template-areas: "th nm nm qt rm" "th sz nt nt nt";
  padding: 16px clamp(16px, 2.4vw, 26px); border-bottom: 1px solid var(--g-2);
}
.line::before { content: counter(ln); position: absolute; left: 8px; top: 10px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--k); color: var(--y); font: 900 .7rem var(--f-display); z-index: 1; }
.line.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { from { background: var(--y-soft); } to { background: transparent; } }
.l-thumb { grid-area: th; align-self: start; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; background: var(--y); overflow: hidden; }
.l-thumb img { width: 56px; height: 56px; filter: drop-shadow(0 6px 5px rgba(0,0,0,.3)); }
.l-thumb i { font-size: 1.8rem; }
.l-name { grid-area: nm; display: grid; gap: 2px; min-width: 0; }
.l-name b { font: 900 1rem/1.05 var(--f-display); font-stretch: 115%; text-transform: uppercase; overflow-wrap: anywhere; }
.l-name small { color: var(--ink-3); font-size: .78rem; }
.l-name-in { min-height: 44px; padding: 8px 12px; font-weight: 700; }
.l-size { grid-area: sz; }
.l-qty { grid-area: qt; }
.l-note { grid-area: nt; align-self: end; }
.l-lab { display: block; margin-bottom: 4px; font: 700 .7rem var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.line .f-in { min-height: 44px; padding: 8px 12px; font-size: .95rem; }
.l-note .f-in { border-style: dashed; }
.stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; border: 2px solid #cfcfcf; border-radius: var(--r-s); overflow: hidden; }
.stepper:focus-within { border-color: var(--k); box-shadow: 0 0 0 4px var(--y); }
.st-btn { display: grid; place-items: center; min-height: 44px; border: 0; background: var(--g); font-size: 1rem; touch-action: manipulation; }
.st-btn:hover { background: var(--y); }
.st-btn:focus-visible { outline-offset: -3px; }
.line .st-in { min-height: 40px; border: 0; border-radius: 0; padding: 0 4px; text-align: center; font: 900 1.05rem var(--f-display); font-style: italic; font-stretch: 85%; -moz-appearance: textfield; appearance: textfield; }
.line .st-in:focus { box-shadow: none; }
.st-in::-webkit-inner-spin-button, .st-in::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.l-rm { grid-area: rm; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-s); background: transparent; color: var(--ink-2); font-size: 1.25rem; align-self: end; }
.l-rm:hover { background: #fde8e6; color: var(--err); }

/* Stacked line layout: phones, and the 1000-1199px two-column range where the list column is too narrow for one row */
@media (max-width: 680px), (min-width: 1000px) and (max-width: 1199px) {
  .line { grid-template-columns: 56px minmax(0, 1fr) 132px; grid-template-areas: "th nm nm" "sz sz qt" "nt nt nt"; padding-top: 18px; }
  .l-name { padding-right: 44px; }
  .line .f-in { font-size: 1rem; padding-inline: 10px; } /* 16px keeps iOS from zooming on focus */
  .l-thumb { width: 56px; height: 56px; }
  .l-thumb img { width: 48px; height: 48px; }
  .l-rm { position: absolute; top: 12px; right: 8px; }
}

/* ---------- Empty state ---------- */
.b-empty { display: flex; gap: 22px; align-items: center; padding: 30px clamp(16px, 2.4vw, 26px); }
.b-empty[hidden] { display: none; }
.b-empty .xmarks { font-size: 30px; gap: 4px; }
.b-empty .xmarks i:nth-child(2) { color: var(--y-2); }
.b-empty p { color: var(--ink-2); max-width: 44ch; }
.b-empty .b-empty-h { margin-bottom: 4px; font: 900 1.2rem var(--f-display); font-stretch: 118%; text-transform: uppercase; color: var(--k); }
.b-empty .link { margin-top: 12px; }
.b-err { padding: 0 clamp(16px, 2.4vw, 26px); margin-top: 10px; }

/* ---------- Builder foot: custom item + attachment ---------- */
.b-foot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; align-items: center; padding: 18px clamp(16px, 2.4vw, 26px) 22px; background: var(--g); border-top: 1px solid var(--g-2); }
.b-foot .btn.ghost { min-height: 52px; }
.b-foot .f-err { grid-column: 1 / -1; }
.drop { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 12px; border: 2px dashed #9a9a9a; border-radius: var(--r-s); background: var(--w); transition: border-color .15s, background .15s; }
.drop > i { font-size: 1.4rem; flex: none; }
.drop-in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-text { display: grid; min-width: 0; line-height: 1.25; }
.drop-text b { font-size: .92rem; overflow-wrap: anywhere; }
.drop-text span { font-size: .78rem; color: var(--ink-3); }
.drop:hover, .drop.over { border-color: var(--k); background: var(--y-soft); }
.drop:focus-within { border-color: var(--k); box-shadow: 0 0 0 4px var(--y); }
.drop.has { border-style: solid; border-color: var(--k); }
.drop.bad { border-color: var(--err); }
.drop-clear { position: relative; z-index: 1; margin-left: auto; min-height: 44px; padding: 0 12px; border: 2px solid var(--k); border-radius: 8px; background: var(--w); font-weight: 700; font-size: .85rem; }
@media (max-width: 520px) { .b-foot { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Details card (black) ---------- */
.details { padding: clamp(20px, 2.4vw, 28px); border-radius: 20px; box-shadow: 0 30px 60px -34px rgba(0,0,0,.6); }
@media (min-width: 1000px) { .details { position: sticky; top: calc(var(--nav-h) + 16px); } }
.details h2 { color: var(--y); font-stretch: 120%; font-size: 1.25rem; }
.det-note { margin: 6px 0 18px; }
.details .f { margin-bottom: 14px; align-content: start; }
.details .f label, .details .f legend { color: var(--w); }
.details .f-hint { color: var(--on-k-2); }
.details .f-err { color: #ff9b91; }
.details .f-opt { font: 500 .78rem var(--f-body); color: var(--on-k-2); }
.details .f-in { border-color: var(--w); color: var(--k); }
.details .f-in:focus { border-color: var(--y); box-shadow: 0 0 0 4px rgba(255,208,40,.45); }
.details .f-in[aria-invalid="true"] { border-color: #ff9b91; box-shadow: 0 0 0 2px #ff9b91; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 400px) { .f-row { grid-template-columns: 1fr; } }
.reply { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.reply legend { padding: 0; margin-bottom: 6px; font: 700 .92rem var(--f-body); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; min-height: 44px; border: 2px solid var(--k-3); border-radius: var(--r-s); font: 800 .8rem var(--f-display); font-stretch: 112%; text-transform: uppercase; color: var(--on-k); }
.seg input:checked + span { background: var(--y); border-color: var(--y); color: var(--k); }
.seg input:focus-visible + span { outline: 3px solid var(--y); outline-offset: 2px; }
.send { display: grid; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--k-3); }
.send .btn { width: 100%; min-height: 54px; }
.send .btn.viber { min-height: 60px; font-size: 1rem; }
.send .btn:disabled { opacity: .5; cursor: progress; transform: none; }
.status { min-height: 1.4em; margin-top: 12px; font-weight: 700; font-size: .88rem; }
.status.err { color: var(--err); }
.status.ok { color: var(--ok); }
.details .status.err { color: #ff9b91; }
.send-note { margin-top: 4px; }

/* ---------- Done panel ---------- */
.done { max-width: 820px; margin-inline: auto; padding: clamp(22px, 3vw, 40px); padding-top: calc(clamp(22px, 3vw, 40px) + 10px); background: linear-gradient(var(--y) 0 10px, var(--w) 0); border-radius: 20px; box-shadow: 0 30px 60px -34px rgba(0,0,0,.45); }
.done:focus { outline: none; }
.done:focus-visible { outline: 3px solid var(--k); outline-offset: 4px; }
.done-stamp { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; margin-bottom: 14px; border-radius: 999px; background: var(--k); color: var(--y); font: 800 .76rem var(--f-display); font-stretch: 115%; letter-spacing: .06em; text-transform: uppercase; }
.done.sent .done-stamp { background: var(--ok); color: var(--w); }
.done-lead { margin-top: 12px; color: var(--ink-2); max-width: 60ch; }
.summary { margin: 20px 0 0; padding: 18px; border-radius: var(--r-s); background: var(--g); border: 1px solid var(--g-2); font: 500 .9rem/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.done-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.done-acts .btn.ghost { color: var(--k); }
#attach-note { margin-top: 12px; }

/* ---------- Mobile bottom bar ---------- */
.qbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-fab); display: none; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--k); color: var(--w); box-shadow: 0 -10px 24px -12px rgba(0,0,0,.5); }
.qbar-n { font: 700 .88rem var(--f-body); }
.qbar-n b { font: 900 1.35rem var(--f-display); font-style: italic; font-stretch: 80%; color: var(--y); margin-right: 2px; }
.qbar .btn { min-height: 48px; }
@media (max-width: 999px) {
  .qbar { display: flex; }
  .pg-quote .foot { padding-bottom: 88px; }
  .q-done .qbar, .q-combo .qbar { display: none; }
}
@media (max-width: 360px) { .qbar-n span { display: none; } }
