/* WySync — widget styles */

/* ───── catalog browser ───── */
.catalog {
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.catalog-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.catalog-controls {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.cat-input {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--fg);
  font-family: var(--font-mono);
  min-width: 220px;
}
.cat-input:focus { outline: none; border-color: var(--accent); }
.cat-select {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-size: 12px;
  font-family: var(--font-mono);
}

.seg { display: inline-flex; border: 1px solid var(--line); background: var(--bg); }
.seg-btn {
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  border-right: 1px solid var(--line);
  transition: background .15s, color .15s;
}
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { color: var(--fg); }
.seg-btn.on { background: var(--accent); color: var(--accent-fg); }

.catalog-table {
  font-family: var(--font-mono);
  font-size: 12px;
}
.cat-row {
  display: grid;
  grid-template-columns: 110px 1.6fr 1.1fr 1.1fr 1.4fr 0.9fr 0.7fr;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.cat-row:last-child { border-bottom: 0; }
.cat-row.cat-th {
  background: var(--bg);
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  padding: 10px 18px;
}
.cat-row strong { font-family: var(--font-sans); font-weight: 600; font-size: 13px; }
.cat-row span { font-family: var(--font-sans); font-size: 13px; }
.cat-row .mono { font-family: var(--font-mono); font-size: 12px; color: var(--fg); }
.ta-r { text-align: right; }

.catalog-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg-3);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.catalog-live { display: inline-flex; align-items: center; gap: 6px; color: var(--good); }
.pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--good);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.cat-empty { padding: 32px; text-align: center; color: var(--fg-3); }

@media (max-width: 880px) {
  .catalog-head { flex-direction: column; align-items: stretch; }
  .catalog-controls { width: 100%; }
  .cat-input { flex: 1; min-width: 0; }
  .cat-row.cat-th { display: none; }
  .cat-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "sku    price"
      "brand  brand"
      "specs  specs"
      "footer footer";
    gap: 4px 12px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }
  .cat-row > div:nth-child(1) { grid-area: sku; }
  .cat-row > div:nth-child(2) { grid-area: brand; }
  .cat-row > div:nth-child(3) { grid-area: specs; }
  .cat-row > div:nth-child(4),
  .cat-row > div:nth-child(5) { display: none; } /* hide bolt + finish — keep them in tooltip on hover later */
  .cat-row > div:nth-child(6) { grid-area: price; }
  .cat-row > div:nth-child(7) {
    grid-area: footer;
    text-align: left;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-3);
    padding-top: 4px;
  }
  .cat-row > div:nth-child(7)::before { content: "stock: "; }
  .cat-row .ta-r { text-align: right; }
}
@media (max-width: 480px) {
  .cat-input { font-size: 11px; padding: 7px 10px; }
}

/* ───── refresh viz ───── */
.refresh {
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 28px;
}
.refresh-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 24px;
}
.refresh-grid {
  display: flex; flex-direction: column; gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.refresh-row {
  display: grid;
  grid-template-columns: 100px 1fr 100px;
  gap: 18px;
  align-items: center;
}
.rrow-label { color: var(--fg-3); }
.rrow-val { color: var(--accent); text-align: right; }
.rrow-track {
  height: 28px;
  background: var(--bg);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.dotstream {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
}
.dot-tick {
  flex: 1;
  height: 60%;
  background: var(--accent);
  transition: opacity .25s;
  min-width: 4px;
}

@media (max-width: 660px) {
  .refresh-row { grid-template-columns: 80px 1fr 70px; gap: 10px; font-size: 11px; }
}

/* ───── YMMS ───── */
.ymms {
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 24px;
}
.ymms-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.ymms-brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg-2);
}
.ymms-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.ymms-sub {
  color: var(--fg-3); margin-top: 6px; margin-bottom: 18px;
}
.ymms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: var(--bg);
}
.ymms-col { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 240px; }
.ymms-col:last-child { border-right: 0; }
.ymms-col.off { opacity: 0.45; }
.ymms-col-head {
  display: flex; justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-3);
  background: var(--bg-2);
}
.ymms-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  max-height: 260px;
}
.ymms-pick {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  transition: background .15s, color .15s;
}
.ymms-pick:hover { background: var(--bg-3); }
.ymms-pick.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.ymms-pick:last-child { border-bottom: 0; }

@media (max-width: 720px) {
  .ymms-grid { grid-template-columns: repeat(2, 1fr); }
  .ymms-col:nth-child(2) { border-right: 0; }
  .ymms-col:nth-child(1), .ymms-col:nth-child(2) { border-bottom: 1px solid var(--line); }
}

.ymms-result {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--good);
  background: color-mix(in oklab, var(--good), transparent 90%);
  margin-bottom: 18px;
}
.ymms-vehicle { font-size: 18px; font-weight: 600; margin-top: 4px; letter-spacing: -0.02em; }
.ymms-fits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.ymms-fit {
  border: 1px solid var(--line);
  background: var(--bg);
  display: flex; flex-direction: column;
  transition: border-color .15s;
}
.ymms-fit:hover { border-color: var(--accent); }
.ymms-fit-img {
  aspect-ratio: 4 / 3;
}
.ymms-fit-body { padding: 14px; }
.ymms-fit-title { font-weight: 600; font-size: 14px; }
.ymms-fit-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
@media (max-width: 720px) {
  .ymms-fits { grid-template-columns: 1fr; }
}

/* ───── shared embed wrapper for YMMS in fake browser ───── */
.fake-browser {
  border: 1px solid var(--line);
  background: var(--bg);
}
.fake-browser-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
}
.fake-dots { display: flex; gap: 6px; }
.fake-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); display: inline-block; }
.fake-url {
  flex: 1; text-align: center;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 5px 12px;
  letter-spacing: 0.04em;
}
