/* ============================================================
   INDUSTRIAL STOREFRONT — Elephant LLP
   Modern B2B purchasing surface: white ground, near-black ink,
   one deep safety-orange accent, Archivo + Inter, and the
   spec-sheet discipline — sizes as a clean technical BOM table.
   Big type, 48px+ targets — 50-70 y/o buyers, cheap Androids,
   daylight. No skeuomorphism, no gradients, no libraries.
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* class display rules must never beat the hidden attribute */
[hidden] { display: none !important; }

:root {
  /* color tokens */
  --paper:      #FFFFFF;  /* page + card ground */
  --tint:       #F4F6F8;  /* panel wells, group bands, image wells */
  --line:       #E4E7EC;  /* hairline borders */
  --line-strong:#D0D5DD;  /* decorative strong hairlines */
  --line-ctrl:  #767680;  /* control boundaries — 4.5:1 on white */
  --warn:       #9A4D0B;  /* under-MOQ warnings — amber, never the accent */
  --warn-bg:    #FFF7ED;
  --warn-line:  #F0D9B5;
  --steel:      #475467;  /* secondary text — 7.7:1 on white */
  --ink:        #16181D;  /* primary text — 17.8:1 on white */
  --accent:     #2E5AC7;  /* brand blue (from the logo) — 6.2:1 on white */
  --accent-deep:#274FA8;  /* pressed / emphatic accent — 7.6:1 */
  --accent-wash:#EBF1FC;  /* selected wash — brand blue tint */
  --wa:         #0C6E38;  /* WhatsApp green — send actions ONLY */
  --wa-deep:    #084D28;

  /* type tokens */
  --disp: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;

  /* spacing scale: 4 / 8 / 12 / 16 / 24 / 32 / 48 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  /* card padding — group bands bleed to this edge */
  --card-pad: 16px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  padding-bottom: 132px; /* room for sticky inquiry bar */
}

/* ---------- header ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 10px var(--s4);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner { max-width: 840px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: var(--s3); }
.brand-mark { flex-shrink: 0; display: block; width: 46px; height: 46px; border-radius: 50%; }
.brand-name {
  font-family: var(--disp);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

/* ---------- page head: title + freshness pill ---------- */
main { max-width: 840px; margin: 0 auto; padding: var(--s4); }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s3) var(--s4);
  margin: var(--s3) 0 var(--s3);
}
.page-title {
  font-family: var(--disp);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1;
}

.intro { font-size: 18px; color: var(--steel); margin-bottom: var(--s5); max-width: 52ch; }
.rates-note { font-size: 18px; color: var(--steel); margin-top: var(--s5); max-width: 52ch; }

/* ---------- product list ---------- */
.product-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
@media (min-width: 800px) { .product-list { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: var(--card-pad);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  animation: fade-rise 0.3s ease both;
}
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(n+4) { animation-delay: 0.15s; }

/* selected families carry a visible accent edge */
.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 1px 2px rgba(16, 24, 40, 0.05);
}

@keyframes fade-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-top { display: flex; align-items: flex-start; gap: var(--s3); }
.card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.card-body { flex: 1; min-width: 0; }
.card-name {
  font-family: var(--disp);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
/* the rate is the loudest object on every card */
.card-price {
  font-size: 23px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin-top: var(--s1);
}
.card-price .price-num { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
.card-price .unit { font-size: 18px; font-weight: 400; color: var(--steel); }
.rate-wa { color: var(--ink); font-size: 24px; font-weight: 700; }

/* ---------- spec strip: MOQ / step / sizes as typographic objects ---------- */
.spec-strip {
  display: flex;
  flex-wrap: wrap;
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}
.spec-item {
  display: flex;
  flex-direction: column;
  padding-right: var(--s4);
  margin-right: var(--s4);
  border-right: 1px solid var(--line);
}
.spec-item:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.spec-label {
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--steel);
  line-height: 1.25;
}
.spec-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.3;
}

/* live per-family selection summary */
.fam-sel {
  display: inline-block;
  margin-top: var(--s3);
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.fam-sel:empty { display: none; }

/* ---------- choose-sizes toggle ---------- */
.sizes-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  width: 100%;
  min-height: 52px;
  margin-top: var(--s3);
  padding: var(--s2) var(--s3);
  font-family: var(--body);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-ctrl);
  border-radius: 12px;
  cursor: pointer;
}
.sizes-toggle:active { background: var(--tint); }
.sizes-toggle-chev { display: inline-flex; color: var(--accent); transition: transform 0.15s ease; }
.sizes-toggle[aria-expanded="true"] .sizes-toggle-chev { transform: rotate(180deg); }

/* ---------- the signature: sizes as a technical spec table ---------- */
.spec-head {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  margin-top: var(--s4);
  padding-bottom: var(--s2);
  border-bottom: 2px solid var(--ink);
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--steel);
  line-height: 1.2;
}
/* group sub-headers: full-bleed bands, like BOM section rows */
.size-group {
  margin: var(--s3) calc(-1 * var(--card-pad)) 0;
  padding: 7px var(--card-pad);
  background: var(--tint);
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--steel);
  line-height: 1.3;
}
.size-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s2);
  min-height: 62px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.sizes-panel > .size-row:last-of-type { border-bottom: none; }
.size-label {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  min-width: 0;
}
.size-label .x { font-weight: 400; color: var(--steel); }
.size-detail {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--steel);
  margin-top: 1px;
}
.size-qty { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.step-btn {
  width: 48px;
  height: 48px;
  font-size: 28px;
  font-weight: 600;
  font-family: var(--body);
  line-height: 1;
  color: var(--accent);
  background: var(--paper);
  border: 1.5px solid var(--line-ctrl);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.06s ease;
}
.step-btn:active { background: var(--accent); border-color: var(--accent); color: #FFFFFF; transform: scale(0.95); }
.step-btn.plus { width: auto; min-width: 48px; padding: 0 12px; font-size: 20px; font-weight: 700; }

.qty-input {
  width: 84px;
  height: 48px;
  font-family: var(--body);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-ctrl);
  border-radius: 10px;
}
.qty-input::placeholder { color: #667085; font-weight: 400; }
/* a filled quantity marks its row active — no JS needed */
.qty-input:not(:placeholder-shown) { border-color: var(--accent); background: var(--accent-wash); }
.qty-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 90, 199, 0.2);
}

/* gentle, never-blocking MOQ reminder */
.moq-hint {
  margin-top: var(--s3);
  padding: 10px var(--s3);
  border-radius: 10px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  font-size: 18px;
  font-weight: 600;
}

/* ---------- sticky inquiry bar ---------- */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.08);
  padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  z-index: 20;
}
.cart-summary { min-width: 0; overflow: hidden; }
.cart-label {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--steel);
  line-height: 1.25;
  white-space: nowrap;
}
.cart-total {
  display: block;
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* keep the bar contents on the content column on wide screens */
@media (min-width: 880px) {
  .cart-bar { padding-left: calc(50% - 404px); padding-right: calc(50% - 404px); }
}

.send-btn {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  font-family: var(--body);
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--wa);
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  min-height: 56px;
  cursor: pointer;
  transition: transform 0.06s ease;
}
.send-btn:active { background: var(--wa-deep); transform: scale(0.98); }
.wa-icon { flex-shrink: 0; }

/* ---------- modal: bottom sheet on phones, dialog on wide ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 32, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 30;
}
.modal {
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  padding: var(--s5) var(--s5) calc(var(--s5) + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: sheet-up 0.25s ease both;
}
@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@media (min-width: 660px) {
  .modal-overlay { align-items: center; padding: var(--s5); }
  .modal { border-radius: 16px; max-width: 480px; padding-bottom: var(--s5); }
}

.modal h2 {
  font-family: var(--disp);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: var(--s3);
}
.review-title {
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--steel);
  margin-bottom: var(--s2);
}
.order-review {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--s2) var(--s3);
  margin-bottom: var(--s2);
}
.review-fam {
  font-family: var(--disp);
  font-size: 19px;
  font-weight: 700;
  padding: 10px 0 3px;
}
.review-fam:first-child { padding-top: 3px; }
.review-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s3);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.review-line b { font-weight: 700; white-space: nowrap; }
.review-line:last-child { border-bottom: none; }
.review-warn {
  font-size: 18px;
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0;
}

.modal label { display: block; margin: var(--s4) 0; font-size: 18px; font-weight: 600; }
.modal input {
  display: block;
  width: 100%;
  margin-top: var(--s2);
  font-size: 20px;
  font-family: var(--body);
  padding: 12px 14px;
  min-height: 52px;
  border: 1.5px solid var(--line-ctrl);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}
.modal input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 90, 199, 0.2);
}
/* pre-explains the WhatsApp handoff right where the anxiety occurs */
.wa-hint { font-size: 18px; color: var(--steel); margin: var(--s3) 0 var(--s2); }
.modal .send-btn { width: 100%; margin-top: var(--s2); }
.cancel-btn {
  width: 100%;
  margin-top: var(--s2);
  font-size: 18px;
  font-weight: 600;
  font-family: var(--body);
  padding: var(--s3);
  min-height: 48px;
  background: var(--paper);
  border: 1.5px solid var(--line-ctrl);
  border-radius: 12px;
  color: var(--steel);
  cursor: pointer;
}
.cancel-btn:active { background: var(--tint); }

/* ---------- success ---------- */
/* the OK button only dismisses — green stays reserved for WhatsApp */
#done-btn { background: var(--ink); }
#done-btn:active { background: #000000; }
.modal.center { text-align: center; }
.big-check { margin: var(--s2) 0; }
.big-check svg { display: block; margin: 0 auto; }
.modal.center p { font-size: 18px; color: var(--steel); margin: var(--s2) 0 var(--s4); }

/* ---------- quality floor ---------- */
/* rapid taps on steppers must not trigger double-tap zoom;
   pinch-zoom stays available */
button, input, .send-btn { touch-action: manipulation; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.send-btn:focus-visible { outline-color: var(--ink); }

/* small cheap Androids (Redmi Go / Galaxy J2 class): tighten so
   nothing clips — targets stay >= 48px */
/* phones: stack the inquiry bar — summary row on top, full-width CTA */
@media (max-width: 480px) {
  body { padding-bottom: 172px; }
  .cart-bar { flex-direction: column; align-items: stretch; gap: var(--s2); }
  .cart-summary { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
  .cart-bar .send-btn { width: 100%; }
}

@media (max-width: 360px) {
  :root { --card-pad: 12px; }
  main { padding: var(--s3); }
  .card img { width: 60px; height: 60px; }
  .card-name { font-size: 20px; }
  .card-price { font-size: 20px; }
  .card-price .price-num { font-size: 28px; }
  .card-price .rate-wa { font-size: 22px; }
  .spec-item { padding-right: var(--s3); margin-right: var(--s3); }
  .size-qty { gap: 4px; }
  .qty-input { width: 72px; }
  .cart-total { font-size: 19px; }
  .modal { padding-left: var(--s4); padding-right: var(--s4); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
