/* ============================================================================
   pages.css — product detail, cart, checkout, account, panel, articles, about
   ========================================================================= */

/* ── product detail ──────────────────────────────────────────────────────── */
.crumbs { font-size: .8rem; margin-bottom: 14px; color: var(--steel-500); }
.crumbs a:hover { color: var(--amber-deep); }
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
.pdp-main { aspect-ratio: 4 / 3; border: var(--line); border-radius: var(--r); background: var(--white);
  display: grid; place-items: center; overflow: hidden; }
.pdp-main img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.pdp-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.pdp-thumbs button { width: 66px; height: 66px; border: var(--line); border-radius: var(--r);
  background: var(--white); cursor: pointer; padding: 0; overflow: hidden; }
.pdp-thumbs button:hover { border-color: var(--amber); }
.pdp-thumbs img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.pdp-info h1 { margin: 0 0 14px; font-size: 1.4rem; font-weight: 800; line-height: 1.6; }
.pdp-idents { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.ident { border: var(--line); border-radius: var(--r); padding: 6px 11px; background: var(--white); line-height: 1.5; }
.ident small { display: block; font-size: .68rem; color: var(--steel-500); }
.ident b { font-weight: 600; font-size: .88rem; }
.fitment { border-inline-start: 3px solid var(--amber); padding-inline-start: 13px; margin-bottom: 18px; }
.fitment-title { display: block; font-size: .8rem; color: var(--steel-500); margin-bottom: 7px; }
.fitment-list { display: flex; flex-wrap: wrap; gap: 7px; }
.fit-chip { border: var(--line); border-radius: var(--r); padding: 3px 10px; font-size: .8rem; background: var(--white); }
.fit-chip.mine { background: var(--amber-wash); border-color: #f3dca6; color: var(--amber-deep); font-weight: 700; }
.buy-box { background: var(--white); border: var(--line); border-top: 3px solid var(--steel-800);
  border-radius: var(--r); padding: 16px; display: grid; gap: 11px; }
.buy-price { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.buy-price b { font-family: var(--mono); font-size: 1.45rem; font-weight: 700; }
.buy-price del { font-family: var(--mono); color: var(--steel-300); font-size: .88rem; }
.buy-price .off { background: var(--gone); color: var(--white); font-size: .72rem; padding: 2px 7px; border-radius: var(--r); }
.gone-text { color: var(--gone); font-size: 1.02rem; }
.stock { font-size: .82rem; display: flex; align-items: center; gap: 6px; }
.stock::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stock.ok { color: var(--ok); } .stock.low { color: var(--low); } .stock.gone { color: var(--gone); }
.buy-row { display: flex; gap: 9px; }
.buy-row input { width: 90px; text-align: center; }
.buy-row .btn { flex: 1; }
.buy-notes { margin: 4px 0 0; padding-inline-start: 16px; font-size: .8rem; color: var(--steel-500); display: grid; gap: 4px; }

/* ── cart ────────────────────────────────────────────────────────────────── */
/* One list card with hairline rows rather than a stack of separate cards:
   on a phone this fits three or four parts per screen instead of one. */
.cart-grid { display: grid; grid-template-columns: 1fr 330px; gap: 20px; align-items: start; }
.cart-lines { background: var(--white); border: var(--line); border-radius: var(--r); overflow: hidden; }

.line { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 12px 13px;
  border-bottom: var(--line); transition: background .15s, opacity .2s; position: relative; }
.line:last-of-type { border-bottom: 0; }
.line:hover { background: #fbfcfc; }
.line.busy { opacity: .5; pointer-events: none; }

.line-media { border: var(--line); border-radius: var(--r); overflow: hidden; align-self: start;
  aspect-ratio: 1 / 1; display: grid; place-items: center; background:
    linear-gradient(var(--steel-100) 1px, transparent 1px) 0 0 / 100% 18px,
    linear-gradient(90deg, var(--steel-100) 1px, transparent 1px) 0 0 / 18px 100%, var(--white); }
.line-media img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.line-media .placeholder { font-size: .64rem; color: var(--steel-300); text-align: center; }

.line-body { display: grid; gap: 5px; min-width: 0; }
.line-name { font-weight: 600; font-size: .9rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-name:hover { color: var(--amber-deep); }
.line-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .72rem; }
.line-meta .pn { font-family: var(--mono); color: var(--steel-500); }
.line-meta .chip { border: var(--line); border-radius: var(--r); padding: 0 7px; color: var(--steel-500); }
.line-meta .chip.fit { background: var(--amber-wash); border-color: #f3dca6; color: var(--amber-deep); font-weight: 700; }
.line-warn { margin: 0; font-size: .74rem; color: var(--gone); }
.line-note { margin: 0; font-size: .74rem; color: var(--low); }

.line-foot { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.stepper { display: inline-flex; align-items: center; border: var(--line); border-radius: var(--r);
  overflow: hidden; flex-shrink: 0; }
.stepper .step { width: 34px; height: 34px; border: 0; background: var(--white); cursor: pointer;
  font-size: 1rem; line-height: 1; color: var(--steel-700); padding: 0; }
.stepper .step:hover { background: var(--steel-800); color: var(--white); }
.stepper .step[disabled] { color: var(--steel-300); background: var(--paper); cursor: not-allowed; }
.stepper input { width: 42px; height: 34px; border: 0; border-inline: var(--line); text-align: center;
  padding: 0; font-size: .88rem; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.line-price { margin-inline-start: auto; text-align: end; line-height: 1.4; white-space: nowrap; }
.line-price b { font-family: var(--mono); font-size: .96rem; }
.line-price small { font-size: .68rem; color: var(--steel-500); }
.line-price .unit-price { display: block; font-size: .68rem; color: var(--steel-500); }
.line-remove { width: 34px; height: 34px; border: 0; background: none; color: var(--steel-300);
  cursor: pointer; display: grid; place-items: center; border-radius: var(--r); flex-shrink: 0; }
.line-remove:hover { color: var(--gone); background: #fbeae7; }

.cart-foot-links { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 13px; background: var(--paper); font-size: .82rem; }
.cart-foot-links a { color: var(--steel-500); }
.cart-foot-links a:hover { color: var(--amber-deep); }

/* summary */
.cart-summary { border-top: 3px solid var(--amber); position: sticky; top: 14px; }
.cart-summary h3 { margin: 0 0 10px; font-size: 1rem; }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 8px 0; border-bottom: var(--line); font-size: .9rem; }
.sum-row.discount { color: var(--ok); }
.sum-row.discount[hidden] { display: none; }
.sum-row.total { border-bottom: 0; padding-top: 12px; font-size: 1rem; }
.sum-row.total b { font-size: 1.2rem; }
.checkout-btn { width: 100%; margin-top: 12px; padding-block: 13px; }
.cart-trust { margin: 14px 0 0; padding-inline-start: 16px; display: grid; gap: 5px;
  font-size: .76rem; color: var(--steel-500); }
.coupon-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--steel-150); }
.coupon-form { display: flex; gap: 8px; }
.coupon-form input { flex: 1; text-align: center; letter-spacing: .06em; }
.coupon-on { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--amber-wash); border: 1px solid #f3dca6; border-radius: var(--r);
  padding: 8px 12px; font-size: .84rem; }

.cart-bar { display: none; }

.cart-empty { text-align: center; padding: 54px 0; display: grid; justify-items: center; gap: 10px; }
.cart-empty svg { color: var(--steel-300); }
.cart-empty h3 { margin: 0; font-size: 1.1rem; }
.cart-empty p { max-width: 46ch; margin: 0; font-size: .88rem; }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

@media (max-width: 820px) {
  .cart-grid { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .checkout-btn { display: none; }
  .cart-bar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; inset-inline: 0; bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom, 0px));
    background: var(--white); border-top: var(--line); padding: 9px 14px; z-index: 55;
    box-shadow: 0 -10px 26px -22px rgba(0,0,0,.6);
  }
  .cart-bar .bar-total { display: grid; line-height: 1.35; }
  .cart-bar .bar-total small { font-size: .7rem; color: var(--steel-500); }
  .cart-bar .bar-total b { font-family: var(--mono); font-size: 1.02rem; }
  .cart-bar .btn { margin-inline-start: auto; padding: 11px 22px; }
  body.has-cart-bar { padding-bottom: calc(var(--bottom-nav) + 62px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 480px) {
  .line { grid-template-columns: 62px 1fr; gap: 10px; padding: 10px 11px; }
  .line-name { font-size: .86rem; -webkit-line-clamp: 2; }
  .line-price .unit-price { display: none; }
  .line-price b { font-size: .9rem; }
  .stepper .step { width: 32px; height: 32px; }
  .stepper input { width: 38px; height: 32px; }
}

/* ── account / checkout / panel ──────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: var(--white); border: var(--line); border-radius: var(--r); padding: 14px;
  border-inline-start: 3px solid var(--amber); }
.stat span { display: block; font-family: var(--mono); font-size: 1.3rem; font-weight: 700; }
.stat small { color: var(--steel-500); }
.account-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.account-nav a { border: var(--line); background: var(--white); border-radius: var(--r); padding: 8px 14px; font-size: .86rem; }
.account-nav a:hover { border-color: var(--steel-800); }
.address-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 14px; }
.address-card { background: var(--white); border: var(--line); border-radius: var(--r); padding: 14px; }
.address-card h3 { margin: 0 0 6px; font-size: .94rem; }
.checkout { display: grid; gap: 18px; max-width: 720px; }
.checkout section { background: var(--white); border: var(--line); border-radius: var(--r); padding: 16px; }
.checkout h2 { margin: 0 0 12px; font-size: 1rem; }
.radio-card { display: block; border: var(--line); border-radius: var(--r); padding: 11px 13px; margin-bottom: 9px; cursor: pointer; }
.radio-card:hover { border-color: var(--steel-700); }
.radio-card input { width: auto; margin-inline-end: 8px; }
.checkout-items { margin: 0 0 10px; padding-inline-start: 18px; font-size: .88rem; }
.totals { background: var(--white); border: var(--line); border-radius: var(--r); padding: 14px; margin: 16px 0; }
.panel { display: grid; grid-template-columns: 190px 1fr; gap: 20px; }
.panel-nav { display: grid; gap: 6px; align-content: start; background: var(--white); border: var(--line);
  border-radius: var(--r); padding: 10px; position: sticky; top: 14px; }
.panel-nav a { padding: 8px 11px; border-radius: var(--r); font-size: .88rem; }
.panel-nav a:hover { background: var(--paper); }
.saved { outline: 2px solid var(--ok); }
.static-page { background: var(--white); border: var(--line); border-radius: var(--r); padding: 22px; }

/* ── articles ────────────────────────────────────────────────────────────── */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.article-card { background: var(--white); border: var(--line); border-radius: var(--r); overflow: hidden;
  display: flex; flex-direction: column; transition: border-color .18s; }
.article-card:hover { border-color: var(--steel-700); }
.article-card .cover { aspect-ratio: 16 / 9; background: var(--steel-100); overflow: hidden; }
.article-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.article-card .body { padding: 13px 14px; display: grid; gap: 7px; flex: 1; }
.article-card h3 { margin: 0; font-size: .96rem; font-weight: 700; line-height: 1.6; }
.article-card p { margin: 0; font-size: .84rem; color: var(--steel-500);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-meta { display: flex; gap: 10px; font-size: .74rem; color: var(--steel-500); margin-top: auto; }
.article-tag { background: var(--amber-wash); color: var(--amber-deep); border-radius: var(--r);
  padding: 1px 8px; font-size: .72rem; font-weight: 700; justify-self: start; }
.article-body { background: var(--white); border: var(--line); border-radius: var(--r); padding: 22px;
  max-width: 780px; margin-inline: auto; line-height: 2.1; }
.article-body img { border-radius: var(--r); margin: 14px 0; }
.article-hero { max-width: 780px; margin: 0 auto 18px; }
.article-hero h1 { font-size: 1.5rem; line-height: 1.6; margin: 0 0 8px; }

/* ── about ───────────────────────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 26px; align-items: start; }
.about-facts { display: grid; gap: 10px; }
.about-fact { background: var(--white); border: var(--line); border-radius: var(--r);
  padding: 13px 15px; position: relative; overflow: hidden; }
.about-fact::before { content: ""; position: absolute; inset-inline-start: 0; top: 12px;
  width: 3px; height: 22px; background: var(--amber); }
.about-fact b { display: block; font-size: .92rem; }
.about-fact span { font-size: .84rem; color: var(--steel-500); }

@media (max-width: 900px) {
  .pdp, .cart-layout, .panel, .about-grid { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .panel-nav { position: static; grid-auto-flow: column; overflow-x: auto; }
}
@media (max-width: 560px) {
  .article-grid { grid-template-columns: 1fr; }
  .pdp-info h1 { font-size: 1.14rem; }
  .buy-price b { font-size: 1.25rem; }
  .table th, .table td { padding: 7px 8px; font-size: .82rem; }
}

/* ── modern form (contact and anything else that needs real validation) ──── */
.form-modern { background: var(--white); border: var(--line); border-radius: var(--r);
  border-top: 3px solid var(--steel-800); padding: 20px; display: grid; gap: 16px; }
.form-lead { margin: 0; font-size: .86rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 5px; }
.field > label { font-size: .84rem; font-weight: 600; }
.field > label b { color: var(--gone); font-weight: 700; }
.field input, .field select, .field textarea { border: 1.5px solid var(--steel-150); border-radius: var(--r);
  padding: 10px 12px; transition: border-color .15s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--steel-800); outline: none; }
.field .hint { font-size: .74rem; color: var(--steel-500); }
.field .err { font-size: .76rem; color: var(--gone); min-height: 1em; }
.field .err:empty { display: none; }
.field-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.counter { font-size: .72rem; color: var(--steel-500); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--gone); background: #fff8f7; }
.field.valid input, .field.valid select, .field.valid textarea { border-color: var(--ok); }
.form-modern .btn[disabled] { opacity: .6; cursor: progress; }
@media (max-width: 700px) { .field-row { grid-template-columns: 1fr; gap: 14px; } }


/* ── coupon box (cart) ───────────────────────────────────────────────────── */
.coupon-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--steel-150); }
.coupon-form { display: flex; gap: 8px; }
.coupon-form input { flex: 1; text-align: center; letter-spacing: .08em; }
.coupon-on { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--amber-wash); border: 1px solid #f3dca6; border-radius: var(--r); padding: 8px 12px; font-size: .86rem; }
.sum-row.discount { color: var(--ok); }

/* ── back-in-stock box (product page) ────────────────────────────────────── */
.notify-box { background: var(--white); border: var(--line); border-top: 3px solid var(--amber);
  border-radius: var(--r); padding: 14px 15px; display: grid; gap: 8px; }
.notify-box p { margin: 0; font-size: .84rem; }
.notify-row { display: flex; gap: 8px; }
.notify-row input { flex: 1; text-align: center; }
.notify-msg { font-size: .84rem; color: var(--ok); }
.notify-msg.bad { color: var(--gone); }
