/* Richiesta d'offerta — catalog + quote basket. Uses tokens from site.css. */
.quote { padding: clamp(32px, 5vw, 64px) 0 clamp(64px, 8vw, 112px); }
.q-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: clamp(24px, 3vw, 44px); align-items: start; }
.q-main { min-width: 0; }

.q-tools { display: grid; gap: 14px; margin-bottom: 14px; }
.q-search { position: relative; display: block; }
.q-search .i { position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.q-search input { width: 100%; font: inherit; font-size: 16px; padding: 15px 16px 15px 48px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.q-search input:focus, .q-group select:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: transparent; }
.q-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.q-chip { font: 500 14.5px var(--f-body); padding: 9px 16px; min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.q-chip:hover { border-color: var(--ink); }
.q-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-dark); }
.q-group select { width: 100%; font: inherit; font-size: 15px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.q-count { color: var(--muted); margin: 6px 0 14px; }

.q-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.q-card { all: unset; box-sizing: border-box; display: flex; flex-direction: column; width: 100%; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color .2s, box-shadow .25s var(--ease), translate .25s var(--ease); }
.q-card:hover { border-color: rgba(28, 27, 25, .3); box-shadow: var(--shadow); translate: 0 -2px; }
.q-card:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.q-card-img { display: grid; place-items: center; aspect-ratio: 16 / 10; background: #fff; border-bottom: 1px solid var(--line); padding: 10px; }
.q-card-img img { width: 100%; height: 100%; object-fit: contain; }
.q-ph { color: rgba(28, 27, 25, .2); }
.q-ph .i { width: 48px; height: 48px; }
.q-card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; }
.q-card-body small { color: var(--muted); font-size: 11.5px; letter-spacing: .04em; line-height: 1.35; }
.q-card-body b { font-family: var(--f-display); font-weight: 500; font-size: 19px; line-height: 1.15; text-transform: uppercase; overflow-wrap: anywhere; }
.q-hit { color: var(--red); font-size: 12.5px; }
.q-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; font-size: 14px; color: var(--muted); }
.q-card-go { display: inline-flex; align-items: center; gap: 6px; color: var(--red); font-weight: 600; }
.q-card-go .i { width: 16px; height: 16px; }
.q-none { padding: 28px; background: #fff; border-radius: var(--radius); border: 1px dashed var(--line); }
.q-more { margin: 24px auto 0; display: flex; }

/* basket */
.q-side { position: sticky; top: calc(var(--head-h) + 16px); display: grid; gap: 16px; max-height: calc(100dvh - var(--head-h) - 32px); overflow: auto; overscroll-behavior: contain; padding-bottom: 4px; }
.q-cart { background: var(--ink); color: var(--on-dark); border-radius: 20px; padding: 22px; }
.q-cart h2 { font-size: 26px; display: flex; align-items: center; gap: 10px; }
.q-badge { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--red); color: #fff; font: 500 14px var(--f-mono); }
.q-empty { color: var(--on-dark-muted); font-size: 15px; margin: 12px 0 0; }
.q-lines { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.q-lines li { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--ink-3); }
.q-line-top { display: grid; grid-template-columns: minmax(0, 1fr) 84px 36px; gap: 8px; align-items: center; }
.q-line-top span { display: grid; min-width: 0; }
.q-line-top b { font-size: 14px; overflow-wrap: anywhere; }
.q-line-top small, .q-spec { font-size: 12.5px; color: var(--on-dark-muted); line-height: 1.35; overflow-wrap: anywhere; }
.q-lines .q-qty, .q-note { font: inherit; font-size: 16px; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line-dark); background: var(--ink-2); color: var(--on-dark); width: 100%; }
.q-note { font-size: 14px; }
.q-rm { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: none; color: var(--on-dark-muted); cursor: pointer; }
.q-rm:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.q-rm .i { width: 18px; height: 18px; }
.q-hint { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; font-size: 13px; color: var(--on-dark-muted); line-height: 1.45; }
.q-hint .i { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.q-form { gap: 14px; padding: 22px; }
.q-form h2 { font-size: 26px; }
.q-form .f-row { grid-template-columns: 1fr; gap: 14px; }
.q-form .is-bad, .q-dlg .is-bad { border-color: var(--red) !important; background: #fff5f5 !important; }
.f-error a { color: inherit; font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.q-ok { background: #fff; border-radius: 20px; border: 1px solid var(--line); padding: 26px; outline: none; }
.q-ok h2 { font-size: 30px; margin-bottom: 10px; color: var(--red); }
.q-fab { display: none; }

/* product dialog */
.q-dlg { width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
.q-dlg::backdrop { background: rgba(20, 19, 17, .6); backdrop-filter: blur(3px); }
.q-dlg[open] { animation: q-in .28s var(--ease); }
@keyframes q-in { from { opacity: 0; translate: 0 12px; } }
.q-dlg-in { position: relative; padding: clamp(18px, 3vw, 32px); }
.q-dlg-x { position: absolute; top: 12px; right: 12px; color: var(--ink); border-color: var(--line); background: #fff; z-index: 1; }
.q-dlg-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; margin-bottom: 20px; }
.q-dlg-head > img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #fff; border-radius: 14px; border: 1px solid var(--line); padding: 10px; }
.q-dlg-head h2 { font-size: clamp(26px, 3.4vw, 38px); margin: 0 40px 10px 0; }
.q-dlg-head .eyebrow { margin-bottom: 10px; font-size: 11.5px; }
.q-desc { font-size: 15px; color: var(--muted); line-height: 1.5; margin: 0 0 12px; }
.q-page { display: inline-flex; align-items: center; gap: 6px; color: var(--red); text-decoration: none; }
.q-page:hover { text-decoration: underline; }
.q-page .i { width: 16px; height: 16px; }
.q-opts { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 16px; }
.q-opts:empty { display: none; }
.q-opts label, .q-free label { font-size: 14px; font-weight: 500; color: var(--muted); }
.q-opts select, .q-opts input, .q-free input, .q-table .q-qty { font: inherit; font-size: 16px; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.q-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); font-size: 15px; }
.q-table th { text-align: left; font: 500 12px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; background: var(--cream); }
.q-table td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.q-table td:first-child { white-space: nowrap; font-weight: 500; }
.q-table .q-qty { width: 96px; padding: 7px 8px; }
.q-table tr.is-hit td { background: #fff4d6; }
.q-table .btn.is-done, .q-free .btn.is-done { background: #1f7a3a; }
.q-free { display: grid; gap: 8px; margin-top: 16px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.q-free-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.q-free-row .q-qty { width: 110px; }

@media (max-width: 1024px) {
  .q-grid { grid-template-columns: minmax(0, 1fr); }
  .q-side { position: static; max-height: none; overflow: visible; }
  .q-form .f-row { grid-template-columns: 1fr 1fr; }
  .q-fab:not([hidden]) { display: inline-flex; align-items: center; gap: 10px; position: fixed; left: 50%; translate: -50% 0; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40; padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--on-dark); text-decoration: none; font-weight: 600; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .45); }
}
@media (max-width: 640px) {
  .q-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .q-card-body { padding: 10px 12px 12px; }
  .q-card-body b { font-size: 16px; }
  .q-card-meta { flex-direction: column; align-items: flex-start; gap: 2px; font-size: 13px; }
  .q-form .f-row { grid-template-columns: 1fr; }
  .q-dlg-head { grid-template-columns: minmax(0, 1fr); }
  .q-table thead { display: none; }
  .q-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
  .q-table td { padding: 0; border: 0; }
  .q-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; color: var(--muted); font-size: 14px; }
  .q-table td:nth-child(3) { grid-row: 3; }
  .q-table td:nth-child(4) { grid-row: 3; justify-self: end; }
}
@media (prefers-reduced-motion: reduce) {
  .q-dlg[open] { animation: none; }
  .q-card { transition: none; }
}
