/* ==========================================================================
   Terminals — filterable category shelves
   Cream studio product photos on warm BG. Sticky chip filter bar.
   ========================================================================== */

:root {
  --t-cream: #f6efe2;
  --t-cream-2: #efe5d2;
  --t-ink: #0a0b14;
}

[data-theme="dark"] {
  --t-cream: #1a1d35;
  --t-cream-2: #13162a;
}

/* ---------- Brandbar (Valor / Clover sub-nav) ---------- */
.t-brandbar {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-divider);
}
.t-brandbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  min-height: 44px;
  gap: 16px;
}
.t-brandbar__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: -0.005em;
  transition: color 0.15s ease;
}
.t-brandbar__back:hover { color: var(--color-text); }
.t-brandbar__back svg { flex-shrink: 0; }

.t-brandbar__tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.t-brandbar__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 12px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.t-brandbar__tab:hover { color: var(--color-text); }
.t-brandbar__tab.is-active { color: var(--color-primary); }
.t-brandbar__tab.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px 2px 0 0;
}
@media (max-width: 600px) {
  .t-brandbar__inner { min-height: 40px; }
  .t-brandbar__back { font-size: 0.75rem; }
  .t-brandbar__tab { padding: 10px 10px; font-size: 0.75rem; }
  .t-brandbar__tab.is-active::after { left: 10px; right: 10px; }
}

/* ---------- Hero ---------- */
.t-hero {
  padding: 88px 0 48px;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgb(3 116 73 / 0.06), transparent 60%),
    linear-gradient(180deg, var(--color-bg), var(--color-surface-2));
  border-bottom: 1px solid var(--color-divider);
}
@media (max-width: 900px) { .t-hero { padding: 56px 0 36px; } }

.t-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
  gap: 64px;
  align-items: end;
}
@media (max-width: 900px) {
  .t-hero__grid { grid-template-columns: 1fr; gap: 32px; }
}

.t-hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--color-text);
  margin: 16px 0 20px;
}
.t-hero__title em {
  font-style: italic;
  font-weight: 500;
  color: var(--color-primary);
}

.t-hero__sub {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--color-text-2);
  max-width: 54ch;
  margin-bottom: 28px;
}

.t-hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.t-hero__meta {
  border-top: 1px solid var(--color-border);
  padding-top: 8px;
}
.t-hero__meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-divider);
}
.t-hero__meta-row:last-child { border-bottom: none; }
.t-hero__meta-k {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.t-hero__meta-v {
  font-size: 0.9375rem;
  color: var(--color-text);
  font-weight: 600;
}

/* ---------- Sticky chip filter bar ---------- */
.t-filterbar {
  position: sticky;
  top: 64px;
  z-index: 40;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-divider);
}
.t-filterbar__inner {
  padding-block: 14px;
}
.t-filterbar__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 2px;
}
/* On narrow viewports (mobile/tablet), chips scroll horizontally on a single
   line so they don't eat vertical space in the sticky bar. */
@media (max-width: 900px) {
  .t-filterbar__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .t-filterbar__chips::-webkit-scrollbar { display: none; }
}

.t-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease;
}
.t-chip:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
  transform: translateY(-1px);
}
.t-chip.is-active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-green);
}
.t-chip.is-active .t-chip__count {
  background: rgb(255 255 255 / 0.22);
  color: #fff;
}
.t-chip__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
  transition: all 140ms ease;
}

/* ---------- Shelves ---------- */
.t-shelves {
  padding: 48px 0 72px;
}
.t-shelves__loading {
  padding: 80px 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.t-shelf {
  padding: 36px 0 8px;
  border-bottom: 1px solid var(--color-divider);
  animation: t-shelf-in 420ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.t-shelf:last-child { border-bottom: none; }
@keyframes t-shelf-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.t-shelf__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 22px;
}
.t-shelf__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  letter-spacing: -0.022em;
  color: var(--color-text);
  margin: 0;
}
.t-shelf__sub {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.t-shelf__meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Cards grid on desktop, horizontal scroll on mobile */
.t-shelf__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
@media (max-width: 1180px) {
  .t-shelf__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  /* Horizontal scroll shelf on mobile */
  .t-shelf__grid {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    gap: 14px;
    padding: 4px 20px 16px;
    margin: 0 -20px 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .t-shelf__grid::-webkit-scrollbar { display: none; }
  .t-shelf__grid > * {
    flex: 0 0 78%;
    max-width: 320px;
    scroll-snap-align: start;
  }
}

/* ---------- Product card ---------- */
.t-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 200ms cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 200ms ease, border-color 200ms ease;
  position: relative;
}
.t-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-border);
}
.t-card:hover .t-card__img img {
  transform: scale(1.03);
}

.t-card__img {
  aspect-ratio: 4 / 3;
  background: var(--t-cream);
  overflow: hidden;
  position: relative;
}
.t-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 500ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.t-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: rgb(255 255 255 / 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--t-ink);
  letter-spacing: 0.02em;
}

.t-card__body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.t-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
  color: var(--color-text);
  margin: 0;
  line-height: 1.2;
}
.t-card__tagline {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.45;
}
.t-card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
}
.t-card__spec {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--color-text-2);
  font-weight: 500;
  white-space: nowrap;
}
.t-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--color-divider);
  background: var(--color-surface-2);
}
.t-card__cert {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}
.t-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
  transition: transform 200ms ease;
}
.t-card:hover .t-card__cta { transform: translateX(3px); }

/* Hidden shelves */
.t-shelf[hidden] { display: none; }

/* ---------- Dark mode refinements ---------- */
[data-theme="dark"] .t-card__badge {
  background: rgb(255 255 255 / 0.92);
  color: #0a0b14;
}
[data-theme="dark"] .t-card__img {
  background: var(--t-cream);
}

/* ---------- Bottom CTA (reuse existing styling) ---------- */
.terminals-cta {
  padding: 72px 0;
  background: linear-gradient(180deg, var(--color-surface-2), var(--color-bg));
  border-top: 1px solid var(--color-divider);
}
.terminals-cta__card {
  background: var(--color-primary-deep);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 48px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: center;
}
@media (max-width: 820px) {
  .terminals-cta__card {
    grid-template-columns: 1fr;
    padding: 32px 28px;
    gap: 24px;
  }
}
.terminals-cta__card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  color: #fff;
}
.terminals-cta__card p {
  color: rgb(255 255 255 / 0.78);
  margin: 0;
  max-width: 52ch;
  line-height: 1.5;
}
.terminals-cta__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn--ghost-on-dark {
  background: rgb(255 255 255 / 0.1);
  color: #fff;
  border: 1px solid rgb(255 255 255 / 0.22);
}
.btn--ghost-on-dark:hover {
  background: rgb(255 255 255 / 0.18);
  color: #fff;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .t-shelf, .t-card, .t-card__img img, .t-chip, .t-card__cta {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================
   REQUEST-A-TERMINAL MODAL
   ============================================ */

.t-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(16px, 5vh, 56px) 16px 24px;
  overflow-y: auto;
}

.t-modal[data-open="true"] {
  display: flex;
}

.t-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgb(2 10 6 / 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: t-modal-fade 180ms ease-out both;
}

.t-modal__panel {
  position: relative;
  width: min(560px, 100%);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-divider, #e7e5e1);
  border-radius: 18px;
  padding: 32px 32px 28px;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.28), 0 8px 24px -6px rgb(0 0 0 / 0.12);
  animation: t-modal-rise 220ms cubic-bezier(0.2, 0.8, 0.3, 1) both;
  margin-bottom: 24px;
}

[data-theme="dark"] .t-modal__panel {
  background: var(--color-surface-2, #111a15);
  border-color: rgb(255 255 255 / 0.08);
}

@keyframes t-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes t-modal-rise {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.t-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-divider, #e7e5e1);
  background: transparent;
  color: var(--color-text-2, #4b5048);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 140ms, color 140ms, border-color 140ms;
}

.t-modal__close:hover {
  background: var(--color-surface-2, #f6f4ef);
  color: var(--color-text, #1a1d1a);
  border-color: var(--color-text-muted, #8a8e85);
}

[data-theme="dark"] .t-modal__close:hover {
  background: rgb(255 255 255 / 0.06);
}

.t-modal__header {
  padding-right: 40px;
  margin-bottom: 20px;
}

.t-modal__eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary, #037449);
  margin-bottom: 10px;
}

.t-modal__title {
  font-family: var(--font-display, 'Aeonik', 'Poppins', sans-serif);
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--color-text, #1a1d1a);
}

.t-modal__sub {
  margin: 0;
  color: var(--color-text-2, #4b5048);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Device preview strip */
.t-modal__device {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--color-divider, #e7e5e1);
  border-radius: 12px;
  background: var(--color-surface-2, #f6f4ef);
  margin-bottom: 20px;
}

[data-theme="dark"] .t-modal__device {
  background: rgb(255 255 255 / 0.04);
  border-color: rgb(255 255 255 / 0.08);
}

.t-modal__device[data-has-device="true"] {
  display: flex;
}

.t-modal__device-img {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--color-bg, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.t-modal__device-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.t-modal__device-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.t-modal__device-cat {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted, #8a8e85);
}

.t-modal__device-name {
  font-weight: 600;
  color: var(--color-text, #1a1d1a);
  font-size: 0.98rem;
}

.t-modal__device-tag {
  font-size: 0.82rem;
  color: var(--color-text-2, #4b5048);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Form */
.t-modal__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.t-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.t-modal__field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text, #1a1d1a);
  letter-spacing: -0.005em;
}

.t-modal__field input,
.t-modal__field select {
  width: 100%;
  padding: 11px 13px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--color-text, #1a1d1a);
  background: var(--color-bg, #fff);
  border: 1px solid var(--color-divider, #d8d6cf);
  border-radius: 10px;
  transition: border-color 140ms, box-shadow 140ms, background 140ms;
  appearance: none;
  -webkit-appearance: none;
}

[data-theme="dark"] .t-modal__field input,
[data-theme="dark"] .t-modal__field select {
  background: rgb(255 255 255 / 0.03);
  border-color: rgb(255 255 255 / 0.12);
  color: var(--color-text, #f1f1ea);
}

.t-modal__field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%238a8e85' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}

.t-modal__field input::placeholder {
  color: var(--color-text-muted, #8a8e85);
}

.t-modal__field input:focus,
.t-modal__field select:focus {
  outline: none;
  border-color: var(--color-primary, #037449);
  box-shadow: 0 0 0 3px rgb(3 116 73 / 0.18);
}

.t-modal__field[data-invalid="true"] input,
.t-modal__field[data-invalid="true"] select {
  border-color: #b4332a;
  box-shadow: 0 0 0 3px rgb(180 51 42 / 0.15);
}

.t-modal__error {
  display: none;
  font-size: 0.8rem;
  color: #b4332a;
  line-height: 1.35;
}

.t-modal__field[data-invalid="true"] .t-modal__error {
  display: block;
}

.t-modal__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.t-modal__submit {
  position: relative;
}

.t-modal__submit[data-loading="true"] .t-modal__submit-label {
  opacity: 0;
}

.t-modal__submit-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgb(255 255 255 / 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: t-modal-spin 720ms linear infinite;
}

.t-modal__submit[data-loading="true"] .t-modal__submit-spinner {
  display: block;
}

@keyframes t-modal-spin {
  to { transform: rotate(360deg); }
}

.t-modal__legal {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--color-text-muted, #8a8e85);
  line-height: 1.5;
}

.t-modal__legal a {
  color: var(--color-text-2, #4b5048);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Success state */
.t-modal__success {
  text-align: center;
  padding: 20px 0 8px;
}

.t-modal__success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgb(3 116 73 / 0.12);
  color: var(--color-primary, #037449);
  display: flex;
  align-items: center;
  justify-content: center;
}

.t-modal__success-title {
  font-family: var(--font-display, 'Aeonik', 'Poppins', sans-serif);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--color-text, #1a1d1a);
}

.t-modal__success-copy {
  margin: 0 0 18px;
  color: var(--color-text-2, #4b5048);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Mobile */
@media (max-width: 600px) {
  .t-modal {
    padding: 0;
    align-items: stretch;
  }
  .t-modal__panel {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    border: none;
    padding: 68px 20px 28px;
    margin-bottom: 0;
  }
  .t-modal__close {
    top: 12px;
    right: 12px;
  }
  .t-modal__title {
    font-size: 1.35rem;
  }
  .t-modal__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .t-modal__actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .t-modal__backdrop, .t-modal__panel {
    animation: none !important;
  }
  .t-modal__submit-spinner {
    animation-duration: 1.6s;
  }
}

/* ============================================================
   Brand badge on card (top-right) + multi-row filter bar
   ============================================================ */
.t-card__brand {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  background: rgb(3 116 73 / 0.92);
  color: #fff;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.t-card__brand--dejavoo {
  background: rgb(15 20 40 / 0.92);
  color: #ffffff;
}
.t-card__brand--valor {
  background: rgb(3 116 73 / 0.92);
  color: #ffffff;
}

/* Flag (e.g., "Coming soon") — bottom-left of card image */
.t-card__flag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  background: rgb(245 158 11 / 0.95);
  color: #1a1000;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Filterbar row = label + chip strip. On desktop chips wrap to a second line when
   needed; the label sits pinned to the top-left so alignment stays clean. On
   narrow viewports the row collapses to a single scrolling strip (see above). */
.t-filterbar__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0; /* allow inner flex child to shrink and scroll on mobile */
}
.t-filterbar__row .t-filterbar__label {
  /* align label with the first row of chips (9px chip padding + ~3px for visual center) */
  padding-top: 11px;
}
@media (max-width: 900px) {
  .t-filterbar__row {
    align-items: center;
  }
  .t-filterbar__row .t-filterbar__label {
    padding-top: 0;
  }
}
.t-filterbar__row--brand {
  margin-top: 8px;
}
.t-filterbar__row .t-filterbar__chips {
  flex: 1 1 auto;
  min-width: 0;
}

/* Filterbar label (Category / Brand) */
.t-filterbar__label {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 68px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .t-filterbar__row {
    gap: 10px;
  }
  .t-filterbar__label {
    min-width: auto;
    font-size: 0.625rem;
  }
}

/* Dark mode brand/flag tweaks */
[data-theme="dark"] .t-card__brand--dejavoo {
  background: rgb(255 255 255 / 0.92);
  color: #0a0b14;
}
[data-theme="dark"] .t-card__brand--valor {
  background: rgb(47 179 122 / 0.92);
  color: #0a0b14;
}

/* ============================================================
   Terminal finder quiz modal
   - Reuses .t-modal / .t-modal__panel chrome from the request modal
     above so sizing, backdrop, and motion stay consistent.
   - Adds progress meter, question/option list, and result cards.
   ============================================================ */
.t-quiz-modal__panel {
  max-width: 720px;
  padding: 0;
}

.t-quiz__header {
  padding: 32px 36px 24px;
  border-bottom: 1px solid var(--color-divider);
}
.t-quiz__header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.t-quiz__step {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.t-quiz__progress {
  position: relative;
  height: 4px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 16px;
}
.t-quiz__progress-fill {
  display: block;
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 300ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.t-quiz__progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.t-quiz__progress-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
}
.t-quiz__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}
.t-quiz__back:hover:not(:disabled) {
  color: var(--color-text);
  background: var(--color-surface-2);
  border-color: var(--color-border);
}
.t-quiz__back:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.t-quiz__body {
  padding: 28px 36px 36px;
  max-height: 65vh;
  overflow-y: auto;
}

.t-quiz__q {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin: 0 0 8px;
  line-height: 1.2;
}
.t-quiz__q-sub {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0 0 24px;
  max-width: 56ch;
}

.t-quiz__options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.t-quiz__option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: left;
  cursor: pointer;
  transition: all 160ms cubic-bezier(0.22, 0.61, 0.36, 1);
  font-family: var(--font-body);
}
.t-quiz__option:hover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 5%, var(--color-surface));
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -8px rgba(3, 116, 73, 0.25);
}
.t-quiz__option:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.t-quiz__option-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 160ms ease, color 160ms ease;
}
.t-quiz__option:hover .t-quiz__option-num {
  background: var(--color-primary);
  color: #fff;
}
.t-quiz__option-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.35;
}

/* ---------- Results ---------- */
.t-quiz__result-head {
  margin-bottom: 24px;
}
.t-quiz__result-head h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin: 8px 0 10px;
  line-height: 1.15;
}
.t-quiz__result-head p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0;
  max-width: 56ch;
}

.t-quiz__result-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 640px) {
  .t-quiz__result-cards { grid-template-columns: 1fr; }
}

.t-quiz__card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 200ms ease, transform 200ms ease;
}
.t-quiz__card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}
.t-quiz__card-img {
  position: relative;
  aspect-ratio: 5 / 3;
  background: var(--t-cream);
  overflow: hidden;
}
.t-quiz__card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.t-quiz__card-body {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.t-quiz__card-kicker {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  text-transform: uppercase;
}
.t-quiz__card h4 {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--color-text);
  margin: 0;
  line-height: 1.25;
}
.t-quiz__card p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.45;
}

.t-quiz__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.t-quiz__empty {
  text-align: center;
  padding: 12px 0 4px;
}
.t-quiz__empty h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 8px;
}
.t-quiz__empty p {
  color: var(--color-text-muted);
  margin: 0 auto 20px;
  max-width: 44ch;
}

@media (max-width: 640px) {
  .t-quiz__header { padding: 24px 22px 18px; padding-right: 64px; }
  .t-quiz__body { padding: 22px 22px 28px; }
  .t-quiz__option { padding: 14px 16px; gap: 12px; }
  .t-quiz__header-row { gap: 8px; }
  .t-quiz__step { font-size: 0.65rem; }
}

/* Active chip state for brand tabs (they're anchors, not buttons, so the
   existing .t-chip.is-active styling applies automatically). Add a subtle
   underline hover so they feel tab-like. */
.t-chip--brand {
  text-decoration: none;
}
.t-chip--brand.is-active {
  pointer-events: none; /* prevent reload when clicking the active brand */
}

/* ============================================
   PRODUCT-DETAILS MODAL
   Wider panel with photo + spec list. Opened
   on card click; "Request this device" hands
   off to the existing request modal.
   ============================================ */

.t-details__panel {
  width: min(840px, 100%);
  padding: 0;
  overflow: hidden;
}

.t-details__grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  align-items: stretch;
}

.t-details__media {
  position: relative;
  background: var(--color-surface-2, #f6f4ef);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  border-right: 1px solid var(--color-divider, #e7e5e1);
}

[data-theme="dark"] .t-details__media {
  background: rgb(255 255 255 / 0.04);
  border-right-color: rgb(255 255 255 / 0.08);
}

.t-details__brand {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted, #8a8e85);
  margin-bottom: 12px;
}

.t-details__img {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  min-height: 220px;
}

.t-details__img img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
}

.t-details__body {
  padding: 32px 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.t-details__cat {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary, #037449);
}

.t-details__title {
  font-family: var(--font-display, 'Aeonik', 'Poppins', sans-serif);
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--color-text, #1a1d1a);
  padding-right: 40px; /* clear of the close button */
}

.t-details__tag {
  margin: 0;
  color: var(--color-text-2, #4b5048);
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 500;
}

.t-details__summary {
  margin: 0;
  color: var(--color-text-2, #4b5048);
  font-size: 0.95rem;
  line-height: 1.55;
}

.t-details__section {
  margin-top: 6px;
}

.t-details__section[hidden] {
  display: none;
}

.t-details__h3 {
  font-family: var(--font-display, 'Aeonik', 'Poppins', sans-serif);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted, #8a8e85);
  margin: 0 0 10px;
}

.t-details__specs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.t-details__spec {
  position: relative;
  padding-left: 18px;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--color-text, #1a1d1a);
}

.t-details__spec::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary, #037449);
  opacity: 0.7;
}

[data-theme="dark"] .t-details__spec {
  color: var(--color-text, #f4f1ea);
}

.t-details__certs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.t-details__cert {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--color-divider, #e7e5e1);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--color-text-2, #4b5048);
  background: var(--color-bg, #fff);
}

[data-theme="dark"] .t-details__cert {
  background: rgb(255 255 255 / 0.04);
  border-color: rgb(255 255 255 / 0.1);
  color: var(--color-text-2, #c8c9c4);
}

.t-details__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--color-divider, #e7e5e1);
}

[data-theme="dark"] .t-details__actions {
  border-top-color: rgb(255 255 255 / 0.08);
}

.t-details__request {
  flex: 1 1 auto;
  min-width: 200px;
}

/* The details modal's close button needs to sit above the media column
   on desktop, where the background is darker than the panel. */
.t-details-modal .t-modal__close {
  background: var(--color-bg, #fff);
}

[data-theme="dark"] .t-details-modal .t-modal__close {
  background: var(--color-surface-2, #111a15);
}

/* Mobile: stack media on top, full-width content below */
@media (max-width: 720px) {
  .t-details__panel {
    width: 100%;
  }

  .t-details__grid {
    grid-template-columns: 1fr;
  }

  .t-details__media {
    padding: 28px 20px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--color-divider, #e7e5e1);
  }

  [data-theme="dark"] .t-details__media {
    border-bottom-color: rgb(255 255 255 / 0.08);
  }

  .t-details__img {
    min-height: 160px;
  }

  .t-details__img img {
    max-height: 200px;
  }

  .t-details__body {
    padding: 24px 22px 26px;
  }

  .t-details__specs {
    grid-template-columns: 1fr;
  }

  .t-details__actions {
    flex-direction: column;
  }

  .t-details__request {
    width: 100%;
  }
}
