/* Trade layer — wholesale catalogue, spec tables, quote drawer, forms.
   Builds on the tokens declared in base.css. */

/* ---------- page scaffolding ---------- */

.page-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}
.page-head-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 72px var(--pad) 64px;
}
.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.07;
  font-weight: 600;
  margin: 0 0 20px;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.page-head .lede { max-width: 62ch; margin: 0; font-size: 18px; }

.breadcrumb {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 22px;
}
.breadcrumb a { color: var(--faint); }
.breadcrumb a:hover { color: var(--gold); }

/* ---------- prose ---------- */

.prose { max-width: 68ch; }
.prose h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 600;
  margin: 52px 0 16px;
  line-height: 1.15;
}
.prose h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 34px 0 10px;
}
.prose p { font-size: 16.5px; line-height: 1.8; color: var(--muted); margin: 0 0 16px; font-weight: 300; }
.prose ul { margin: 0 0 18px; padding-left: 20px; color: var(--muted); font-weight: 300; line-height: 1.8; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- data table ---------- */

.data-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--bg-card);
  margin: 8px 0 28px;
}
table.data { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14.5px; }
table.data th, table.data td {
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data thead th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--bg-deep);
  font-weight: 500;
  white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td { color: var(--muted); font-weight: 300; }
table.data td.k { color: var(--ink); font-weight: 500; white-space: nowrap; }
table.data td.code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--gold-lt);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- definition grid ---------- */

.def-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin: 8px 0 28px;
}
.def {
  padding: 22px 24px 26px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-card);
}
.def-k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.def-v { font-family: var(--serif); font-size: 21px; color: var(--ink); line-height: 1.25; margin-bottom: 8px; }
.def-n { font-size: 14px; color: var(--dim); line-height: 1.65; font-weight: 300; }

/* ---------- markers ---------- */

.todo {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #3A2A10;
  color: #E8B84B;
  border: 1px solid #6B4E17;
  padding: 3px 8px;
  border-radius: 2px;
  vertical-align: middle;
}
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px solid var(--line-2);
  color: var(--gold);
  background: var(--bg-deep);
}

.notice {
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--gold);
  background: var(--bg-card);
  padding: 20px 24px;
  margin: 24px 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  font-weight: 300;
}
.notice b { color: var(--ink); font-weight: 500; }
.notice.is-warn { border-left-color: #C4633F; }

/* ---------- catalogue ---------- */

.cat-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.filter-btn {
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-3);
  background: transparent;
  color: var(--nav);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.filter-btn:hover { border-color: var(--gold); color: var(--gold-lt); }
.filter-btn[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 500; }

.trade-card {
  border: 1px solid var(--line);
  background: var(--bg-card);
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 0;
  margin-bottom: 18px;
}
.trade-card .media { border-right: 1px solid var(--line); }
.trade-card .media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trade-body { padding: 24px 26px 26px; }
.trade-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 6px;
}
.trade-name { font-family: var(--serif); font-size: 26px; line-height: 1.15; color: var(--ink); }
.trade-cat {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.trade-desc { font-size: 15px; line-height: 1.7; color: var(--muted); font-weight: 300; margin: 0 0 18px; max-width: 60ch; }

.spec-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 18px;
}
.spec-inline div { min-width: 0; }
.spec-inline dt {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 5px;
}
.spec-inline dd { margin: 0; font-size: 14.5px; color: var(--nav); font-weight: 300; }
.spec-inline dd.code { font-family: var(--mono); font-size: 13px; color: var(--gold-lt); }

.trade-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.qty-in {
  width: 74px;
  background: var(--bg);
  border: 1px solid var(--line-3);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  padding: 11px 12px;
  border-radius: 999px;
  text-align: center;
}
.unit-in {
  background: var(--bg);
  border: 1px solid var(--line-3);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  padding: 11px 14px;
  border-radius: 999px;
}
.qty-in:focus, .unit-in:focus { outline: none; border-color: var(--gold); }

/* ---------- quote drawer ---------- */

.q-line { padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.q-line-head { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.q-line-name { font-family: var(--serif); font-size: 20px; color: var(--ink); line-height: 1.2; }
.q-line-moq { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-top: 5px; }
.q-line-controls { display: flex; gap: 10px; margin-top: 12px; }
.q-qty {
  width: 78px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 9px 10px;
  font-family: var(--sans);
  font-size: 14px;
  text-align: center;
}
.q-unit {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 9px 10px;
  font-family: var(--sans);
  font-size: 14px;
}
.q-qty:focus, .q-unit:focus { outline: none; border-color: var(--gold); }
.q-remove {
  background: none;
  border: 0;
  color: var(--fainter);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  flex: none;
}
.q-remove:hover { color: var(--gold); }
.q-note { font-size: 12.5px; line-height: 1.6; color: var(--faint); margin: 0 0 16px; font-weight: 300; }
.q-clear {
  width: 100%;
  background: none;
  border: 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 14px;
}
.q-clear:hover { color: var(--gold); }
.btn.is-disabled { opacity: 0.45; pointer-events: none; }

/* ---------- forms ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field.is-wide { grid-column: 1 / -1; }
.field label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.field label .req { color: var(--gold); }
.field input, .field select, .field textarea {
  background: var(--bg);
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 13px 15px;
  font-family: var(--sans);
  font-size: 15px;
  width: 100%;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field-help { font-size: 12.5px; color: var(--faint); font-weight: 300; }

.form-lines {
  border: 1px solid var(--line-2);
  background: var(--bg-deep);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.form-lines h3 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
}
.form-lines ul { list-style: none; margin: 0; padding: 0; }
.form-lines li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
  color: var(--nav);
  font-weight: 300;
}
.form-lines li:last-child { border-bottom: 0; }
.form-lines .v { font-family: var(--mono); font-size: 13px; color: var(--gold-lt); white-space: nowrap; }
.form-lines .empty { font-size: 14px; color: var(--faint); font-weight: 300; }

.form-status {
  margin-top: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line-2);
  background: var(--bg-card);
  font-size: 14.5px;
  color: var(--muted);
  font-weight: 300;
}
.form-status.is-ok { border-color: var(--gold); color: var(--gold-lt); }

/* ---------- contact cards ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin: 8px 0 28px;
}
.contact-card { border: 1px solid var(--line); background: var(--bg-card); padding: 26px 24px; }
.contact-role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.contact-name { font-family: var(--serif); font-size: 23px; color: var(--ink); margin-bottom: 12px; }
.contact-line { font-size: 14.5px; color: var(--muted); line-height: 1.9; font-weight: 300; }
.contact-line a { color: var(--nav); }
.contact-line a:hover { color: var(--gold-lt); }

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .trade-card { grid-template-columns: 1fr; }
  .trade-card .media { border-right: 0; border-bottom: 1px solid var(--line); aspect-ratio: 16 / 10; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head-inner { padding: 48px var(--pad) 44px; }
  .def-grid { grid-template-columns: 1fr; }
}

/* ---------- container planner ---------- */

.plan-layout {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 40px;
  align-items: start;
}
/* grid children default to min-width:auto, which lets the 560px results table
   set a floor for the whole column and push the page sideways */
.plan-layout > * { min-width: 0; }
.plan-panel { position: sticky; top: 96px; min-width: 0; }
.plan-row { min-width: 0; }
.plan-name { overflow: hidden; }
.plan-name > span:first-child { overflow-wrap: anywhere; }

.plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--bg-card);
  transition: border-color .15s ease, background .15s ease;
}
.plan-row:last-child { border-bottom: 1px solid var(--line); }
.plan-row.is-on { background: var(--bg-deep); border-color: var(--line-2); }
.plan-row.is-on + .plan-row { border-top-color: var(--line-2); }
.plan-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.plan-name > span:first-child { font-size: 15.5px; color: var(--ink); font-weight: 500; }
.plan-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.plan-row .qty-in { width: 92px; flex: none; }

.plan-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.plan-stat {
  background: var(--bg-card);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plan-k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.plan-v {
  font-family: var(--serif);
  font-size: 27px;
  color: var(--gold-lt);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.plan-empty {
  border: 1px dashed var(--line-2);
  background: var(--bg-card);
  padding: 32px 26px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--faint);
  font-weight: 300;
}

@media (max-width: 980px) {
  .plan-layout { grid-template-columns: 1fr; gap: 28px; }
  .plan-panel { position: static; }
}

/* ---------- glossary ---------- */

.gloss-term { font-family: var(--serif); font-size: 20px; color: var(--ink); white-space: nowrap; }
.gloss-am { font-family: var(--mono); font-size: 13px; color: var(--gold); white-space: nowrap; }

/* ---------- print: line card ---------- */

@media print {
  .site-header, .announce, .site-footer, .page-head, .no-print, #quoteRoot, #toastRoot { display: none !important; }
  body { background: #fff; color: #000; }
  .data-wrap { border-color: #999; overflow: visible; }
  table.data { min-width: 0; font-size: 10px; }
  table.data thead th { background: #eee; color: #000; }
  table.data td, table.data th { border-color: #ccc; padding: 5px 7px; }
  table.data td.k, table.data td.code { color: #000; }
  .print-head { display: block !important; margin-bottom: 14px; }
  a { color: #000; text-decoration: none; }
  @page { margin: 12mm; size: A4 landscape; }
}
.print-head { display: none; }

/* ---------- quote page layout ---------- */

.quote-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 56px;
  align-items: start;
}
.quote-layout > * { min-width: 0; }

@media (max-width: 980px) {
  .quote-layout { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Featured Products (Homepage) ---------- */

.featured-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.featured-card {
  border: 1px solid var(--line);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
}

.featured-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.featured-card .media-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line-soft);
}

.featured-card .media-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.featured-card:hover .media-wrap img {
  transform: scale(1.06);
}

.featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(16, 12, 9, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-2);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  z-index: 2;
}

.featured-amharic {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(16, 12, 9, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-soft);
  color: var(--gold-lt);
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 2px;
  z-index: 2;
}

.featured-content {
  padding: 22px 20px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.featured-cat {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.featured-title {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.18;
  color: var(--ink);
  margin-bottom: 4px;
}

.featured-unit {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--faint);
  margin-bottom: 12px;
}

.featured-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-specs-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--nav);
}

.featured-spec-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.featured-spec-item label {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.featured-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  width: 100%;
}

.featured-controls-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.featured-controls-row .qty-in {
  width: 66px;
  padding: 9px 6px;
  font-size: 13px;
  text-align: center;
  flex: none;
}

.featured-controls-row .unit-in {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--line-3);
  color: var(--ink);
  border-radius: 999px;
}

.featured-actions .btn {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-align: center;
  justify-content: center;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .featured-products-grid {
    grid-template-columns: 1fr;
  }
}


/* Honeypot for the quotation form. Off-canvas, not display:none -- see the
   comment on the field in quote.html. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
