/* "Cotizar por Lista de Materiales (BOM / Excel)": header link, banner and upload dialog. Published and loaded only when
   the site is built with SEA_BOM=on (tools/build_site.py). Uses site.css's tokens (navy, yellow, blue, radius). */
.bom-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------------- header: yellow pill right after "Todo" (the short label below 1400 px keeps the categories in view) */
.hdr-nav .bom-nav { display: inline-flex; align-items: center; gap: 6px; background: var(--yellow); color: var(--ink); font-weight: 800; border-radius: 999px; padding: 6px 14px; margin: 3px 4px; }
.hdr-nav .bom-nav:hover, .hdr-nav .bom-nav:focus-visible { background: var(--yellow-2); border-color: transparent; }
.hdr-nav .bom-nav svg { flex: none; }
.bom-nav-s { display: none; }
@media (max-width: 1400px) { .bom-nav-l { display: none; } .bom-nav-s { display: inline; } }

/* ---------------- banner (home under the hero, quote page) */
.bom-sec { padding: 22px 0 4px; }
.bom-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; background: #fff; border: 1px solid var(--line-2); border-left: 6px solid var(--yellow); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); margin: 0 0 18px; }
.bom-banner-ic { width: 56px; height: 56px; border-radius: 14px; background: #fff7dc; color: #8a6400; display: grid; place-items: center; }
.bom-banner h2 { font-size: 19px; margin: 0 0 4px; }
.bom-banner p { margin: 0; color: var(--muted); font-size: 14.5px; }
.bom-pts { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; font-weight: 700; color: var(--navy-2); }
.bom-pts li { display: inline-flex; align-items: center; gap: 6px; }
.bom-pts svg { color: var(--green); flex: none; }
/* business hours of the 2-hour promise: banner, dialog lead and success screen */
.bom-banner .bom-hours { margin: 8px 0 0; font-size: 12.5px; }
.bom-banner-cta { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bom-cta { background: var(--yellow); color: var(--ink); box-shadow: 0 2px 0 var(--yellow-2); }
.bom-cta:hover, .bom-cta:focus-visible { background: var(--yellow-2); }
.bom-banner-alt { font-size: 13.5px; font-weight: 600; }
.bom-banner noscript p { max-width: 300px; text-align: center; }

/* ---------------- a send going on while the dialog is closed (bottom left: the WhatsApp button is bottom right) */
.bom-pill { position: fixed; left: 18px; bottom: 18px; z-index: 45; display: inline-flex; align-items: center; gap: 8px; max-width: calc(100vw - 110px); border: 0; border-radius: 999px; padding: 11px 16px; background: var(--navy); color: #fff; font: inherit; font-size: 14px; font-weight: 700; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); cursor: pointer; text-align: left; }
.bom-pill[hidden] { display: none; }
.bom-pill.ok { background: #11683a; }
.bom-pill.bad { background: var(--red); }
.bom-pill:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ---------------- dialog (above the header, the skip link and every float) */
html.bom-lock, html.bom-lock body { overflow: hidden; }
.bom { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.bom[hidden] { display: none; }
.bom-backdrop { position: absolute; inset: 0; background: rgba(19, 26, 34, .62); }
.bom-dialog { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 720px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); overflow: hidden; outline: none; }
.bom-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; background: var(--navy); color: #fff; }
.bom-head h2 { margin: 0; font-size: 20px; }
.bom-kicker { margin: 0 0 2px; color: var(--yellow); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; }
.bom-x { flex: none; width: 40px; height: 40px; margin: -4px -8px 0 0; border: 0; border-radius: 999px; background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; }
.bom-x:hover { background: rgba(255, 255, 255, .12); }
/* the site's yellow focus ring is too faint on white: blue inside the dialog, yellow on the navy header */
.bom-dialog :focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.bom-head :focus-visible { outline-color: var(--yellow); }
#bom-progress-t:focus, #bom-done-h:focus { outline: none; }
.bom-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.bom-body { overflow-y: auto; padding: 16px 20px 8px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.bom-lead { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.bom-body .bom-hours { display: flex; align-items: flex-start; gap: 6px; margin: -6px 0 14px; color: var(--muted); font-size: 12.5px; }
.bom-body .bom-hours svg { flex: none; margin-top: 2px; color: var(--blue); }
.bom-fs { border: 0; margin: 0; padding: 0; min-width: 0; }

/* upload zone */
.bom-drop { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; border: 2px dashed #b7c3cf; border-radius: var(--radius); background: #f7f9fb; padding: 18px 16px; cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.bom-drop:hover { border-color: var(--blue); background: #f0f6fc; }
.bom-drop.on { border-color: var(--blue); background: #e8f1fb; border-style: solid; }
.bom-drop.bad { border-color: var(--red); background: #fff5f5; }
.bom-drop-ic { color: var(--blue); }
.bom-drop-t { margin: 0; font-size: 15px; }
.bom-drop-or { color: var(--muted); }
.bom-drop-touch, .bom-drop-act { display: none; }
@media (hover: none) and (pointer: coarse) { .bom-drop-fine, .bom-drop-or { display: none; } .bom-drop-touch { display: inline; } }
.bom-drop.on .bom-drop-fine, .bom-drop.on .bom-drop-touch, .bom-drop.on .bom-drop-or { display: none; }
.bom-drop.on .bom-drop-act { display: inline; }
.bom-pick { padding: 8px 18px; }
.bom-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; clip: rect(0 0 0 0); }
.bom-files { margin-top: 10px; }
.bom-files-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin: 0 0 6px; font-size: 13.5px; }
.bom-files-h span { color: var(--muted); font-size: 12.5px; }
.bom-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bom-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 6px 8px 10px; background: #fff; }
.bom-row-ic { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: #e9f7ef; color: #11683a; }
.bom-row-ic.pdf { background: #fdecec; color: #b3121b; }
.bom-row-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.bom-row-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bom-row-meta { color: var(--muted); font-size: 12.5px; }
.bom-rm { width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.bom-rm:hover, .bom-rm:focus-visible { background: #fff0f0; color: var(--red); }

/* fields */
.bom-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin-top: 14px; }
.bom-full { grid-column: 1 / -1; }
.bom-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bom-field label { font-size: 13.5px; font-weight: 700; }
.bom-req { color: var(--red); }
.bom-opt { color: var(--muted); font-weight: 400; }
.bom-field input:not([type=hidden]), .bom-field textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; font: inherit; font-size: 15px; background: #fff; color: var(--ink); min-height: 44px; }
.bom-field textarea { resize: vertical; min-height: 76px; }
.bom-field input:focus, .bom-field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(15, 76, 129, .15); outline: none; }
.bom-field input[aria-invalid=true], .bom-field textarea[aria-invalid=true] { border-color: var(--red); background: #fffafa; }
.bom-field input[aria-invalid=true]:focus, .bom-field textarea[aria-invalid=true]:focus { box-shadow: 0 0 0 3px rgba(179, 18, 27, .15); border-color: var(--red); }
.bom-help { margin: 0; color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 5px; }
.bom-count { justify-content: flex-end; }
.bom-count.over { color: var(--red); font-weight: 700; }
.bom-err { margin: 0; color: var(--red); font-size: 13px; font-weight: 600; }
.bom-err[hidden] { display: none; }
.bom-err-l { display: block; }
.bom-phone { display: flex; gap: 6px; min-width: 0; }
.bom-phone input { flex: 1; }
.bom-cc { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.bom-cc button { border: 0; background: #fff; color: var(--ink); padding: 0 11px; min-width: 48px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.bom-cc button + button { border-left: 1px solid var(--line); }
.bom-cc button[aria-pressed=true] { background: var(--navy); color: #fff; }
.bom-cc button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

/* footer: alert, progress, submit */
.bom-foot { border-top: 1px solid var(--line-2); padding: 12px 20px 14px; background: #fbfcfd; }
.bom-alert { display: flex; gap: 10px; align-items: flex-start; background: #fff5f5; border: 1px solid #f0a3ab; border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; color: #7d0d14; font-size: 14px; }
.bom-alert[hidden] { display: none; }
.bom-alert svg { flex: none; margin-top: 1px; }
.bom-alert p { margin: 2px 0 0; color: var(--ink); }
.bom-alert-alt { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 8px !important; }
.bom-progress { margin: 0 0 10px; }
.bom-progress[hidden] { display: none; }
.bom-bar { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bom-bar span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: inherit; transition: width .25s ease; }
.bom-progress .bom-help { margin-top: 4px; }
.bom-submit { width: 100%; background: var(--blue); color: #fff; padding: 13px 22px; font-size: 16px; }
.bom-submit:hover { background: var(--blue-2); }
.bom-submit[disabled] { cursor: progress; opacity: .92; }
.bom-spin { display: none; }
.bom-busy .bom-spin { display: block; animation: bom-rot .8s linear infinite; }
@keyframes bom-rot { to { transform: rotate(360deg); } }
.bom-busy .bom-fs { opacity: .6; }
/* the simplified privacy notice ends the scrolling form; the footer keeps one consent line under the submit button */
.bom-privacy { margin: 16px 0 4px; padding-top: 12px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.bom-consent { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; text-align: center; }
.bom-privacy a, .bom-consent a { overflow-wrap: anywhere; }
.legal-todo { background: #ffe27a; color: var(--ink); padding: 0 3px; border-radius: 3px; font-weight: 700; }  /* SEA_PRIVACY=preview */

/* success */
.bom-done { padding: 28px 24px 26px; text-align: center; overflow-y: auto; }
.bom-done[hidden], .bom-form[hidden] { display: none; }
.bom-done-ic { color: var(--green); }
.bom-done-p { margin: 8px auto 14px; max-width: 520px; font-size: 18px; font-weight: 600; line-height: 1.45; }
.bom-done-hours { margin: -6px auto 14px; max-width: 520px; color: var(--muted); font-size: 13px; }
.bom-folio { display: inline-block; margin: 0 0 4px; background: #f4f6f8; border: 1px dashed var(--line); border-radius: 8px; padding: 6px 14px; font-size: 15px; }
.bom-folio b { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .03em; }
.bom-done .bom-help { justify-content: center; }
.bom-done-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0 8px; }
.bom-again { border: 0; background: none; color: var(--link); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 8px; }
.bom-again:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .bom-busy .bom-spin { animation-duration: 2.4s; }
  .bom-bar span, .bom-drop { transition: none; }
}

/* phones: the dialog is a full-screen sheet; header and footer stay put, the form scrolls. The footer is the submit
   button and the consent line (two lines; ~110 px in all): on a 375x667 phone in Safari (~548 px visible, header
   ~65 px) the form keeps ~370 px, and ~125 px under the longest alert ("unsure"), as before the notice; the notice
   itself is read at the end of the form. 667x375 (sideways) gets the low-screen layout below. */
@media (max-width: 640px) {
  .bom { padding: 0; align-items: stretch; }
  .bom-dialog { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .bom-head { padding: 12px 16px 10px; padding-top: max(12px, env(safe-area-inset-top)); }
  .bom-head h2 { font-size: 18px; }
  .bom-body { padding: 14px 16px 8px; }
  .bom-grid { grid-template-columns: minmax(0, 1fr); }
  .bom-field input:not([type=hidden]), .bom-field textarea { font-size: 16px; }  /* no zoom on focus (iOS) */
  .bom-foot { padding: 10px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .bom-privacy, .bom-consent { font-size: 12px; }
  .bom-consent { margin-top: 6px; line-height: 1.35; }
  .bom-banner { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; }
  .bom-banner-ic { display: none; }
  .bom-banner-cta { align-items: stretch; }
  .bom-cta { white-space: normal; }
  .bom-done { padding: 28px 16px; }
  .bom-done-btns .btn { flex: 1 1 100%; }
}
/* low screens (a phone held sideways, or with the keyboard up): full screen, and the whole form scrolls with only the
   submit button kept in view, so an error message cannot squeeze the fields to a strip. At 667x375 the order is the
   fields, the privacy notice, the alert / progress, the sticky submit, the consent line. */
@media (max-height: 520px) {
  .bom { padding: 0; align-items: stretch; }
  .bom-dialog { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .bom-head { padding: 8px 16px 6px; padding-top: max(8px, env(safe-area-inset-top)); }
  .bom-kicker { display: none; }
  .bom-head h2 { font-size: 17px; }
  .bom-form { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .bom-form > * { flex-shrink: 0; }
  .bom-body { overflow: visible; padding: 12px 16px 8px; }
  .bom-foot { display: contents; }
  .bom-alert, .bom-progress { margin: 0 16px 10px; scroll-margin-bottom: 76px; }
  .bom-submit { position: sticky; bottom: 8px; z-index: 1; width: auto; margin: 0 16px; box-shadow: 0 0 0 8px #fff; }
  .bom-consent { margin: 8px 16px 12px; }
  .bom-done { padding: 16px; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .bom-banner { grid-template-columns: auto minmax(0, 1fr); }
  .bom-banner-cta { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 8px 16px; }
}
