/* =====================================================
   Nelson Quote Cart
   Add-to-Quote button, cart page (nc- design system)
   Header cart badge (.nc-cart-badge) lives in nelson-shell.css
   ===================================================== */

/* --- Add to Quote button (product cards + detail pages) --- */

.btn-add-to-quote {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  background: var(--color-orange, #e8762a);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn-add-to-quote:hover {
  background: #d06a22;
}

.btn-add-to-quote.is-added,
.btn-add-to-quote.is-in-cart {
  background: var(--color-navy, #162240);
}

/* =====================================================
   Cart page — matches design-system/handoff-070726/cart/
   ===================================================== */

.nc-link--maroon {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  color: var(--nelson-maroon); text-decoration: underline; text-underline-offset: 4px;
}
.nc-link--maroon:hover { color: var(--nelson-maroon); }

/* --- Page head --- */
.nc-cart-head { background: var(--nelson-white); padding: 40px 0 28px; border-bottom: 1px solid var(--border-subtle); }
.nc-cart-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.nc-cart-head h1 {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 44px; line-height: 50px; color: var(--fg-strong);
  margin: 6px 0 0; letter-spacing: -0.01em;
}

/* --- Line items --- */
.nc-lineitems { padding: 56px 0 32px; }
.nc-lineitems__table {
  display: grid;
  grid-template-columns: 64px minmax(0,34fr) minmax(0,15fr) minmax(0,23fr) minmax(0,18fr) minmax(0,10fr) 40px;
  gap: 16px; align-items: center;
  padding: 0 0 12px;
  font-family: var(--font-sans); font-weight: 700;
  font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-strong);
  border-bottom: 2px solid var(--nelson-blue);
}
.nc-lineitems__table > span:last-child { text-align: right; }
.nc-lineitems__total-lbl { text-align: right; }

.nc-lineitem {
  display: grid;
  grid-template-columns: 64px minmax(0,34fr) minmax(0,15fr) minmax(0,23fr) minmax(0,18fr) minmax(0,10fr) 40px;
  gap: 16px; align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.nc-lineitem.is-justadded { animation: nc-row-in 0.9s var(--ease); }
@keyframes nc-row-in { from { background: var(--nelson-blue-95); } to { background: transparent; } }

.nc-lineitem__img {
  width: 64px; height: 64px;
  background: var(--bg-tint); border-radius: var(--radius-sm);
  display: grid; place-items: center; overflow: hidden;
}
.nc-lineitem__img img { width: 88%; max-height: 88%; object-fit: contain; mix-blend-mode: multiply; }

.nc-lineitem__main { display: flex; flex-direction: column; gap: 2px; }
.nc-lineitem__namerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nc-lineitem__sku {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--nelson-bright-blue); letter-spacing: 0.04em;
}
.nc-lineitem__name {
  font-family: var(--font-serif); font-weight: 600;
  font-size: 15px; line-height: 20px; color: var(--fg-strong);
  margin-top: 3px;
}
.nc-lineitem__notes { height: auto; margin-top: 8px; }
.nc-lineitem__notes input {
  width: 100%; max-width: 340px; height: 36px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--nelson-white); padding: 0 12px;
  font-family: var(--font-sans); font-size: 13px; color: var(--fg);
}
.nc-lineitem__notes input:focus { outline: none; border-color: var(--nelson-bright-blue); box-shadow: 0 0 0 3px rgba(0,120,189,0.18); }

.nc-lineitem__statuscell { display: flex; align-items: center; }
.nc-lineitem__class {
  display: inline-flex; align-items: center;
  font-family: var(--font-sans); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 10px; line-height: 1;
  padding: 5px 10px; border-radius: 999px;
  white-space: nowrap;
}
.nc-lineitem__class--used  { background: var(--nelson-green-95); color: var(--nelson-green-text); border: 1px solid var(--nelson-green); }
.nc-lineitem__class--clear { background: var(--nelson-orange-95); color: var(--nelson-orange-text); border: 1px solid var(--nelson-orange); }
.nc-lineitem__class--new   { background: var(--nelson-blue-95); color: var(--nelson-blue); border: 1px solid var(--nelson-blue-90); }

.nc-lineitem__unit select {
  width: 180px; height: 50px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--nelson-white); font-family: var(--font-sans);
  font-size: 14px; font-weight: 600; color: var(--fg-strong); cursor: pointer;
}

.nc-lineitem__qty { display: flex; align-items: center; min-width: 0; }
.nc-lineitem__step { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; height: 50px; width: 150px; min-width: 150px; box-sizing: border-box; }
.nc-lineitem__step button { width: 46px; flex: 0 0 46px; background: var(--nelson-white); border: 0; cursor: pointer; color: var(--nelson-blue); font-size: 20px; font-weight: 700; }
.nc-lineitem__step button:hover { background: var(--nelson-blue-95); }
.nc-lineitem__step input { flex: 1 1 auto; min-width: 0; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; font-family: var(--font-serif); font-weight: 700; font-size: 18px; color: var(--fg-strong); -moz-appearance: textfield; }
.nc-lineitem__step input::-webkit-outer-spin-button, .nc-lineitem__step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.nc-lineitem__step input:focus { outline: none; }

.nc-lineitem__total { text-align: right; }
.nc-lineitem__total b { font-family: var(--font-serif); font-weight: 700; font-size: 20px; color: var(--nelson-blue); display: block; line-height: 1.1; }
.nc-lineitem__total span { font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-muted); }

.nc-lineitem__remove {
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: 0; cursor: pointer;
  color: var(--nelson-maroon); display: grid; place-items: center;
  transition: all var(--dur-fast) var(--ease);
}
.nc-lineitem__remove:hover { color: var(--nelson-maroon); background: rgba(128,12,80,0.08); }

.nc-cart-empty { padding: 2rem 0; color: var(--fg-muted); font-size: 1rem; }

/* --- Add-product row + type-ahead --- */
.nc-add-row {
  position: relative; cursor: text;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; margin-top: 20px;
  background: var(--nelson-white); border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: 14px; color: var(--fg-subtle);
  transition: border-color var(--dur-fast) var(--ease);
}
.nc-add-row:hover { border-color: var(--nelson-bright-blue); }
.nc-add-row:focus-within { border-style: solid; border-color: var(--nelson-bright-blue); }
.nc-add-row__plus { width: 22px; height: 22px; color: var(--nelson-blue); flex: none; }
.nc-add-row #ncAddInput {
  flex: 1; border: 0; outline: none; background: none;
  font-family: var(--font-sans); font-size: 14px; color: var(--fg-strong);
  padding: 2px 0;
}
.nc-add-row #ncAddInput::placeholder { color: var(--fg-subtle); }
.nc-add-row__esc {
  flex: none; border: 1px solid var(--border); background: var(--nelson-white); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 11px; font-weight: 600; color: var(--fg-muted);
  padding: 4px 8px; cursor: pointer; letter-spacing: 0.04em;
}
.nc-add-row__esc:hover { color: var(--nelson-maroon); border-color: var(--nelson-maroon); }
.nc-add-row__searchic { flex: none; width: 18px; height: 18px; color: var(--nelson-blue); }

.nc-cart-cap {
  margin-top: 20px; padding: 14px 18px;
  background: var(--nelson-paper); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 14px; line-height: 1.5; color: var(--nelson-gray-blk);
}
.nc-cart-cap b { color: var(--nelson-blue); font-weight: 700; }
.nc-cart-cap a { color: var(--nelson-bright-blue); text-decoration: none; border-bottom: 0; }
.nc-cart-cap a:hover { color: var(--nelson-blue); text-decoration: underline; text-underline-offset: 3px; }

.nc-typeahead {
  position: absolute; left: -1.5px; right: -1.5px; top: calc(100% + 8px); z-index: 30;
  background: var(--nelson-white); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg, 0 18px 48px rgba(16,24,40,0.16));
  max-height: 360px; overflow-y: auto; padding: 6px;
}
.nc-typeahead__item {
  display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 12px;
  width: 100%; border: 0; background: none; cursor: pointer; text-align: left;
  padding: 8px 10px; border-radius: var(--radius-sm); transition: background var(--dur-fast) var(--ease);
}
.nc-typeahead__item:hover,
.nc-typeahead__item.is-active { background: var(--nelson-blue-95); }
.nc-typeahead__thumb { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); background: var(--nelson-paper); }
.nc-typeahead__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nc-typeahead__sku { font-family: var(--font-sans); font-weight: 700; font-size: 12px; letter-spacing: 0.03em; color: var(--nelson-bright-blue); }
.nc-typeahead__name { font-family: var(--font-sans); font-size: 13px; color: var(--fg-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-typeahead mark { background: rgba(241,180,52,0.42); color: inherit; border-radius: 2px; padding: 0 1px; }
.nc-typeahead__class {
  font-family: var(--font-sans); font-weight: 700; font-size: 10px; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.nc-typeahead__class--used  { background: var(--nelson-green-95); color: var(--nelson-green-text); border: 1px solid var(--nelson-green); }
.nc-typeahead__class--clear { background: var(--nelson-orange-95); color: var(--nelson-orange-text); border: 1px solid var(--nelson-orange); }
.nc-typeahead__class--new   { background: var(--nelson-blue-95); color: var(--nelson-blue); border: 1px solid var(--nelson-blue-90); }
.nc-typeahead__add {
  font-family: var(--font-sans); font-weight: 700; font-size: 12px; color: var(--nelson-maroon);
  white-space: nowrap;
}
.nc-typeahead__item.is-incart { cursor: default; }
.nc-typeahead__item.is-incart .nc-typeahead__add { color: var(--fg-muted); }
.nc-typeahead__empty {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  padding: 16px 12px; font-family: var(--font-sans); font-size: 14px; color: var(--fg-muted);
}

/* --- Subtotal --- */
.nc-subtotal {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 28px;
  font-family: var(--font-sans); font-size: 14px; color: var(--fg-muted);
}
.nc-subtotal b { color: var(--fg-strong); font-weight: 700; }

/* --- Submit form --- */
.nc-cart-form { padding: 24px 0 96px; }
.nc-cart-form__row { display: grid; grid-template-columns: 2fr 1fr; gap: 56px; align-items: flex-start; }
.nc-cart-form h2 {
  font-family: var(--font-serif); font-weight: 600;
  font-size: 38px; line-height: 38px; color: var(--fg-strong);
  margin: 0;
}
.nc-cart-form__intro { font-family: var(--font-sans); font-size: 15px; color: var(--fg-muted); margin: 8px 0 28px; }

#nelson-quote-form.is-hidden { display: none; }

.nc-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.nc-form-grid__full { grid-column: 1 / -1; }
.nc-field { display: flex; flex-direction: column; gap: 6px; }
.nc-field__lbl {
  font-family: var(--font-sans); font-size: 11px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase; color: var(--fg-muted);
}
.nc-field__lbl b { color: var(--fg-strong); }
.nc-field__hint { font-weight: 500; letter-spacing: 0.02em; text-transform: none; color: var(--fg-muted); }
.nc-field__input {
  height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: 14px; color: var(--fg);
  transition: all var(--dur-fast) var(--ease);
}
.nc-field__input:focus { outline: none; border-color: var(--nelson-bright-blue); box-shadow: 0 0 0 3px rgba(0,120,189,0.18); }
.nc-field__ta {
  min-height: 120px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: 14px; color: var(--fg);
  resize: vertical;
}
.nc-field__ta:focus { outline: none; border-color: var(--nelson-bright-blue); box-shadow: 0 0 0 3px rgba(0,120,189,0.18); }

.nc-submit-row { display: flex; align-items: center; gap: 18px; margin-top: 32px; flex-wrap: wrap; }
.nc-submit-row__meta { font-family: var(--font-sans); font-size: 12px; color: var(--fg-muted); }

.nc-form-message {
  margin: 16px 0; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px;
  font-family: var(--font-sans);
}
.nc-form-message.is-hidden { display: none; }
.nc-form-message.success { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.nc-form-message.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

/* --- Sidebar --- */
.nc-sidebar {
  background: var(--nelson-white); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 28px;
  box-shadow: var(--shadow-1);
}
.nc-eyebrow--flush { margin: 0; }
.nc-sidebar__call { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.nc-sidebar__call-num {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 22px; color: var(--nelson-blue); margin-top: 4px;
  display: inline-flex; align-items: center; gap: 8px;
}
.nc-sidebar__call-num svg { width: 18px; height: 18px; color: var(--nelson-bright-blue); }
.nc-sidebar__call-hours { font-family: var(--font-sans); font-size: 12px; color: var(--fg-muted); margin-top: 4px; }

/* ---- Responsive: fold line-item columns at 1080 ---- */
@media (max-width: 1080px) {
  .nc-cart-head__row { flex-wrap: wrap; gap: 16px; }
  .nc-lineitems__table { display: none; }
  .nc-lineitem {
    grid-template-columns: 64px minmax(0,1fr) auto;
    grid-template-areas:
      "img  main  rm"
      "img  cond  cond"
      "unit unit  unit"
      "qty  qty   total";
    column-gap: 14px; row-gap: 16px; align-items: start;
    padding: 22px 0;
  }
  .nc-lineitem__img { grid-area: img; }
  .nc-lineitem__main { grid-area: main; }
  .nc-lineitem__statuscell { grid-area: cond; }
  .nc-lineitem__remove { grid-area: rm; justify-self: end; }
  .nc-lineitem__unit { grid-area: unit; display: flex; flex-direction: column; gap: 6px; }
  .nc-lineitem__qty { grid-area: qty; display: flex; flex-direction: column; gap: 6px; }
  .nc-lineitem__total { grid-area: total; display: flex; flex-direction: column; align-items: flex-end; align-self: center; }
  .nc-lineitem__unit::before,
  .nc-lineitem__qty::before,
  .nc-lineitem__total::before {
    font-family: var(--font-sans); font-weight: 700; font-size: 10px;
    letter-spacing: 0.10em; text-transform: uppercase; color: var(--fg-muted);
  }
  .nc-lineitem__unit::before { content: "Unit"; }
  .nc-lineitem__qty::before { content: "Quantity"; }
  .nc-lineitem__total::before { content: "Total"; }
  .nc-lineitem__unit select { width: 100%; }
  .nc-lineitem__notes input { max-width: 100%; }
  .nc-cart-form__row { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .nc-cart-head h1 { font-size: 32px; line-height: 38px; }
  .nc-form-grid { grid-template-columns: 1fr; }
  .nc-lineitem {
    grid-template-areas:
      "img  main  rm"
      "img  cond  cond"
      "unit unit  unit"
      "qty  qty   qty"
      "total total total";
  }
  .nc-lineitem__total { align-items: flex-start; align-self: start; }
}
