/*
 * VU-MED public device catalogue. Builds on the site tokens from global.css
 * (--line, --muted, --pale, type scale) and the brand palette:
 * navy #10233d, brand blue #183da6, indigo #2e3192, cyan #29abe2.
 */
.device-catalog {
  --dc-navy: #10233d;
  --dc-blue: #183da6;
  --dc-indigo: #2e3192;
  --dc-cyan: #29abe2;
  --dc-ink-soft: #345275;
  --dc-panel: #f4f8fb;
  --dc-radius: 14px;
  --dc-shadow:
    0 1px 2px rgba(16, 35, 61, 0.05), 0 12px 32px -18px rgba(16, 35, 61, 0.28);
  padding-bottom: 72px;
}
.device-catalog [hidden] {
  display: none !important;
}
.device-intro {
  border-bottom: 0;
  padding-bottom: 8px;
}
.device-intro .lead {
  max-width: 44em;
}
.device-intro .dc-own-products {
  margin: 14px 0 0;
}

/* ---------- toolbar ---------- */
.dc-browse {
  margin-top: 24px;
}
.dc-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(180deg, #f7fafc, var(--dc-panel));
  border: 1px solid var(--line);
  border-radius: var(--dc-radius);
}
.dc-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.dc-field > span:first-child {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dc-ink-soft);
}
.dc-input-wrap {
  position: relative;
  display: block;
}
.dc-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: #6b7f95;
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}
.dc-field input,
.dc-field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--dc-navy);
  background: #fff;
  border: 1px solid #c9d6e2;
  border-radius: 10px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.dc-field input {
  padding-left: 42px;
}
.dc-field select {
  appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, #345275 50%),
    linear-gradient(135deg, #345275 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 52%,
    calc(100% - 15px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.dc-field input:focus,
.dc-field select:focus {
  outline: none;
  border-color: var(--dc-blue);
  box-shadow: 0 0 0 3px rgba(41, 171, 226, 0.28);
}
.dc-field input:disabled,
.dc-field select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.dc-reset {
  min-height: 48px;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dc-blue);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #adbed2;
  text-underline-offset: 0.25em;
}
.dc-reset:hover {
  color: #09628a;
}
.dc-count {
  margin: 18px 2px 0;
  min-height: 1.5em;
  font-size: var(--text-meta);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--dc-ink-soft);
}

/* ---------- grid & cards ---------- */
.dc-stage {
  margin-top: 20px;
}
.dc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 24px;
}
.dc-card {
  min-width: 0;
}
.dc-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--dc-radius);
  box-shadow: var(--dc-shadow);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}
.dc-card-link:hover {
  transform: translateY(-3px);
  border-color: #b9cbe0;
  box-shadow:
    0 1px 2px rgba(16, 35, 61, 0.06),
    0 22px 40px -22px rgba(24, 61, 166, 0.45);
}
.dc-card-link:focus-visible {
  outline: 3px solid #156e9e;
  outline-offset: 3px;
}
.dc-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, #eef3f8, #e3ebf3);
  overflow: hidden;
}
.dc-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.dc-card-link:hover .dc-card-media img {
  transform: scale(1.03);
}
.dc-card-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: rgba(16, 35, 61, 0.72);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.dc-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 20px 22px 22px;
}
.dc-card-title {
  margin: 4px 0 0;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--dc-navy);
}
.dc-card-meta {
  margin: 0;
  font-size: var(--text-small);
  color: var(--muted);
}
.dc-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #e6edf3;
}
.dc-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dc-blue);
  white-space: nowrap;
}
.dc-card-cta svg,
.dc-back svg,
.dc-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.dc-card-link:hover .dc-card-cta svg {
  transform: translateX(3px);
}
.dc-card-cta svg {
  transition: transform 0.2s ease;
}

/* ---------- chips ---------- */
.dc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dc-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1d3f73;
  background: #eaf1f8;
  border: 1px solid #d6e3f0;
  border-radius: 999px;
}
.dc-chip-new {
  color: #0d5c80;
  background: #e5f5fc;
  border-color: #bfe6f6;
}
.dc-chip-used {
  color: #3a2f8a;
  background: #eeedf9;
  border-color: #d8d6f1;
}
.dc-availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dc-ink-soft);
}
.dc-availability::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aabbe;
}
.dc-availability-available::before {
  background: #1f9d6b;
  box-shadow: 0 0 0 3px rgba(31, 157, 107, 0.16);
}
.dc-availability-enquire::before {
  background: var(--dc-cyan);
  box-shadow: 0 0 0 3px rgba(41, 171, 226, 0.18);
}

/* ---------- states ---------- */
.dc-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding: 40px;
  background: var(--dc-panel);
  border: 1px solid var(--line);
  border-radius: var(--dc-radius);
}
.dc-state h2 {
  font-size: var(--text-h3);
  margin-bottom: 8px;
}
.dc-state p {
  margin-bottom: 0;
  max-width: 40em;
}
.dc-state-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--dc-blue);
}
.dc-state-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dc-state-unavailable {
  background: #fff8f1;
  border-color: #f1dcc4;
}
.dc-state-unavailable .dc-state-icon {
  color: #a5521a;
  border-color: #f1dcc4;
}
.dc-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.dc-state-actions:empty {
  display: none;
}
.dc-loading {
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 28px 32px;
}
.dc-loading p {
  margin: 0;
  font-weight: 600;
  color: var(--dc-ink-soft);
}
.dc-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid #d5e2ee;
  border-top-color: var(--dc-blue);
  animation: dc-spin 0.9s linear infinite;
}
@keyframes dc-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- buttons ---------- */
.dc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--dc-blue);
  border: 1px solid var(--dc-blue);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.dc-button:hover {
  background: #102d7e;
}
.dc-button-ghost,
.dc-button-quiet {
  color: var(--dc-blue);
  background: #fff;
  border-color: #c9d6e2;
}
.dc-button-ghost:hover,
.dc-button-quiet:hover {
  background: #eef3fa;
}
.dc-button:focus-visible,
.dc-reset:focus-visible,
.dc-thumb:focus-visible,
.dc-gallery-nav:focus-visible,
.dc-gallery-main:focus-visible {
  outline: 3px solid #156e9e;
  outline-offset: 3px;
}

/* ---------- placeholder ---------- */
.dc-placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 220px;
  color: #7f93a8;
  font-size: var(--text-meta);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.dc-placeholder-small {
  min-height: 0;
}
.dc-placeholder svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- detail ---------- */
.dc-detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.dc-gallery {
  min-width: 0;
}
.dc-gallery-main {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, #eef3f8, #e1e9f2);
  border: 1px solid var(--line);
  border-radius: var(--dc-radius);
}
.dc-gallery-image {
  width: 100%;
  height: 100%;
}
.dc-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.dc-gallery-nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--dc-navy);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 6px 18px -8px rgba(16, 35, 61, 0.45);
  transform: translateY(-50%);
  cursor: pointer;
}
.dc-gallery-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dc-gallery-prev {
  left: 14px;
}
.dc-gallery-next {
  right: 14px;
}
.dc-gallery-counter {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: rgba(16, 35, 61, 0.72);
  border-radius: 999px;
}
.dc-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.dc-thumb {
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  background: #eef3f8;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  opacity: 0.72;
  transition:
    opacity 0.15s,
    border-color 0.15s;
}
.dc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dc-thumb:hover {
  opacity: 1;
}
.dc-thumb[aria-current='true'] {
  opacity: 1;
  border-color: var(--dc-blue);
}
.dc-detail-aside {
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--dc-radius);
  box-shadow: var(--dc-shadow);
}
.dc-detail-title {
  margin: 18px 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #28538d;
}
.dc-facts > div {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #e6edf3;
  font-size: 0.9375rem;
}
.dc-facts dt {
  color: var(--muted);
}
.dc-facts dd {
  font-weight: 600;
  color: var(--dc-navy);
  overflow-wrap: anywhere;
}
.dc-enquiry {
  margin-top: 22px;
}
.dc-enquiry p {
  font-size: var(--text-small);
  margin-bottom: 14px;
}
.dc-enquiry-button {
  width: 100%;
  border-radius: 10px;
}
.dc-reference {
  margin: 14px 0 0 !important;
  font-size: 0.75rem !important;
  color: #6b7f95;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.dc-detail-body {
  display: grid;
  gap: 40px;
  max-width: 900px;
  margin-top: 48px;
}
.dc-description p {
  color: #2b3f58;
  font-size: var(--text-lead);
}
.dc-condition-notes {
  padding: 24px 28px;
  background: #f6f5fd;
  border: 1px solid #e0def4;
  border-left: 4px solid var(--dc-indigo);
  border-radius: 10px;
}
.dc-condition-notes h2,
.dc-specs h2 {
  font-size: var(--text-h3);
}
.dc-condition-notes p:last-child {
  margin-bottom: 0;
}
.dc-spec-table {
  width: 100%;
}
.dc-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 40px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #173d75;
}
.dc-back:hover {
  color: #09628a;
}
.dc-note {
  margin: 40px 0 0;
  max-width: 60em;
}

@media (max-width: 1000px) {
  .dc-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dc-field-search {
    grid-column: 1 / -1;
  }
  .dc-detail-top {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .dc-toolbar {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .dc-reset {
    justify-self: start;
    min-height: 44px;
    padding-inline: 0;
  }
  .dc-state {
    grid-template-columns: 1fr;
    padding: 28px 22px;
  }
  .dc-loading {
    grid-template-columns: auto 1fr;
  }
  .dc-detail-aside {
    padding: 22px;
  }
  .dc-state-actions .dc-button {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dc-card-link,
  .dc-card-media img,
  .dc-card-cta svg {
    transition: none;
  }
  .dc-card-link:hover {
    transform: none;
  }
  .dc-spinner {
    animation-duration: 2.4s;
  }
}
@media (forced-colors: active) {
  .dc-card-link,
  .dc-state,
  .dc-detail-aside {
    border: 1px solid CanvasText;
  }
}
