/* ===========================================================================
   Styling for tradeshapes.php.

   Same contract as appshapes.css: colours come from the theme engine
   (--tp-theme-primary) or from the layout's own tunables (--sf-radius,
   --sf-gap), so a merchant changing their brand colour changes these too. The
   only hard-coded colours are the ones that carry meaning -- in stock, out of
   stock -- which must not move with the brand.
   ======================================================================== */

/* --- priced rows -----------------------------------------------------------
   A menu, not a grid. The price column is fixed-width so prices line up down
   the page, which is the entire point of showing them this way. */

.sf-plist {
  border: var(--sf-card-border);
  border-radius: var(--sf-radius);
  overflow: hidden;
  background: var(--sf-card-bg);
}
.sf-prow {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  text-decoration: none;
  transition: background .14s var(--sf-ease);
}
.sf-prow:last-child { border-bottom: 0; }
.sf-prow:hover { background: var(--sf-surface); }

.sf-prow-img {
  width: 60px; height: 60px; flex: none;
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface);
  overflow: hidden;
}
.sf-prow-img img { width: 100%; height: 100%; object-fit: cover; }

.sf-prow-main { flex: 1; min-width: 0; }
.sf-prow-name {
  display: block;
  font-size: 15px; font-weight: 650; line-height: 1.35;
  color: var(--tp-heading-primary);
}
.sf-prow-sub {
  display: block;
  margin-top: 3px;
  font-size: 12.5px; line-height: 1.45;
  color: var(--sf-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sf-prow-end { display: flex; align-items: center; gap: 16px; flex: none; }
.sf-prow-price {
  min-width: 92px; text-align: right;
  font-size: 16px; font-weight: 700;
  color: var(--tp-heading-primary);
}
.sf-prow-price small {
  display: block; font-size: 12px; font-weight: 400;
  color: var(--sf-muted); text-decoration: line-through;
}
.sf-prow-cta {
  font-size: 12.5px; font-weight: 650;
  padding: 8px 16px;
  border-radius: var(--sf-radius-sm);
  border: 1px solid var(--tp-theme-primary);
  color: var(--tp-theme-primary);
  white-space: nowrap;
  transition: background .14s var(--sf-ease), color .14s var(--sf-ease);
}
.sf-prow:hover .sf-prow-cta { background: var(--tp-theme-primary); color: #fff; }

/* --- specification cards --------------------------------------------------- */

.sf-specs {
  display: grid;
  gap: var(--sf-gap);
  grid-template-columns: repeat(4, 1fr);
}
.sf-specs--5 { grid-template-columns: repeat(5, 1fr); }
.sf-specs--3 { grid-template-columns: repeat(3, 1fr); }

.sf-spec {
  background: var(--sf-card-bg);
  border: var(--sf-card-border);
  border-radius: var(--sf-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s var(--sf-ease), box-shadow .15s var(--sf-ease);
}
.sf-spec:hover { border-color: var(--tp-theme-primary); box-shadow: var(--sf-card-shadow-h); }
.sf-spec-media {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--sf-surface);
}
.sf-spec-media img { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.sf-spec-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.sf-spec-brand {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--sf-muted);
}
.sf-spec-name {
  font-size: 13px; line-height: 1.4; font-weight: 500;
  color: var(--tp-heading-primary);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sf-spec-foot {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid rgba(0, 0, 0, .06);
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.sf-spec-price { font-size: 17px; font-weight: 800; color: var(--tp-heading-primary); letter-spacing: -.02em; }
.sf-spec-stock { font-size: 11px; font-weight: 650; color: #1a7f43; white-space: nowrap; }
.sf-spec-stock.is-out { color: #b45309; }

/* --- lookup bar ------------------------------------------------------------ */

.sf-lookup {
  background: color-mix(in srgb, var(--tp-theme-primary) 9%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--tp-theme-primary) 16%, transparent);
}
.sf-lookup-in { padding-top: 44px; padding-bottom: 40px; text-align: center; }
.sf-lookup-title {
  font-size: clamp(24px, 3.4vw, 38px);
  font-weight: 800; letter-spacing: -.02em;
  margin: 0 0 8px;
  color: var(--tp-heading-primary);
}
.sf-lookup-hint { font-size: 14.5px; color: var(--sf-muted); margin: 0 0 20px; }
.sf-lookup-form {
  display: flex; gap: 9px;
  max-width: 620px; margin: 0 auto;
}
.sf-lookup-form input {
  flex: 1; min-width: 0;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: var(--sf-radius-sm);
  padding: 13px 17px;
  font-size: 14.5px;
  background: #fff;
}
.sf-lookup-form input:focus {
  outline: none;
  border-color: var(--tp-theme-primary);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--tp-theme-primary) 18%, transparent);
}
.sf-lookup-cats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px;
  margin-top: 18px;
}
.sf-lookup-cats a {
  font-size: 13px; font-weight: 600;
  color: var(--tp-theme-primary);
  text-decoration: none;
}
.sf-lookup-cats a:hover { text-decoration: underline; }

/* --- credentials ----------------------------------------------------------- */

.sf-creds { padding: var(--sf-section-y) 0; }
.sf-creds-head {
  font-size: var(--sf-title-size);
  font-weight: var(--sf-title-weight);
  margin: 0 0 18px;
  color: var(--tp-heading-primary);
}
.sf-creds-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.sf-cred {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px;
  background: var(--sf-card-bg);
  border: var(--sf-card-border);
  border-radius: var(--sf-radius);
}
.sf-cred i {
  font-size: 15px;
  color: var(--tp-theme-primary);
  width: 22px; flex: none;
  margin-top: 2px;
  text-align: center;
}
.sf-cred strong {
  display: block; font-size: 13px; font-weight: 700; line-height: 1.35;
  color: var(--tp-heading-primary);
  margin-bottom: 3px;
}
.sf-cred span { font-size: 12.5px; line-height: 1.5; color: var(--sf-muted); }

/* --- occasion tiles -------------------------------------------------------- */

.sf-occ {
  display: grid;
  gap: var(--sf-gap);
  grid-template-columns: repeat(4, 1fr);
}
.sf-occ--3 { grid-template-columns: repeat(3, 1fr); }
.sf-occ--2 { grid-template-columns: repeat(2, 1fr); }

.sf-occ-tile {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: var(--sf-radius);
  overflow: hidden;
  background: var(--sf-surface);
  text-decoration: none;
}
.sf-occ-tile img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s var(--sf-ease);
}
.sf-occ-tile:hover img { transform: scale(1.05); }
.sf-occ-copy {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 34px 16px 15px;
  background: linear-gradient(to top, rgba(0, 0, 0, .68), transparent);
  color: #fff;
}
.sf-occ-copy strong { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.sf-occ-copy small { display: block; font-size: 11.5px; opacity: .85; margin-top: 2px; }

/* --- narrower screens ------------------------------------------------------ */

@media (max-width: 1100px) {
  .sf-specs, .sf-specs--5 { grid-template-columns: repeat(3, 1fr); }
  .sf-occ, .sf-occ--4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .sf-specs, .sf-specs--5, .sf-specs--3 { grid-template-columns: repeat(2, 1fr); }
  .sf-occ, .sf-occ--4, .sf-occ--3 { grid-template-columns: repeat(2, 1fr); }
  .sf-prow-img { width: 52px; height: 52px; }
  .sf-prow-cta { display: none; }          /* the whole row is the link anyway */
  .sf-prow-price { min-width: 0; }
  .sf-lookup-form { flex-direction: column; }
}
@media (max-width: 480px) {
  .sf-occ, .sf-occ--4, .sf-occ--3, .sf-occ--2 { grid-template-columns: 1fr; }
  .sf-prow { padding: 13px 14px; gap: 12px; }
}
