:root {
  color-scheme: light;
  --ink: #16221f;
  --muted: #67716e;
  --faint: #8d9693;
  --surface: #ffffff;
  --canvas: #f4f5f1;
  --line: #dfe4df;
  --line-soft: #ebeeea;
  --green: #15775c;
  --green-dark: #0f5d48;
  --green-soft: #e2f3eb;
  --lime: #c9ed6b;
  --danger: #a33e34;
  --shadow: 0 18px 50px rgba(22, 44, 37, 0.1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }

.app-shell {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(22, 34, 31, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-copy strong,
.brand-copy small { display: block; }

.brand-copy strong {
  font-size: 1.05rem;
  letter-spacing: -0.025em;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 9px;
  border-radius: 13px;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(22, 34, 31, 0.12);
}

.brand-mark span {
  display: block;
  border-radius: 3px 3px 1px 1px;
  background: var(--lime);
}

.brand-mark span:nth-child(1) { height: 48%; }
.brand-mark span:nth-child(2) { height: 100%; }
.brand-mark span:nth-child(3) { height: 70%; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inventory-status {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.inventory-status strong,
.inventory-status small { display: block; }

.inventory-status strong {
  font-size: 0.8rem;
  line-height: 1.1;
}

.inventory-status small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.source-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #929a97;
  box-shadow: 0 0 0 4px rgba(146, 154, 151, 0.14);
}

.inventory-status.is-live .source-dot {
  background: #20a474;
  box-shadow: 0 0 0 4px rgba(32, 164, 116, 0.14);
}

.inventory-status.is-checking .source-dot { animation: pulse 1s ease-in-out infinite; }
.inventory-status.is-error .source-dot { background: var(--danger); }

@keyframes pulse {
  50% { box-shadow: 0 0 0 8px rgba(32, 164, 116, 0); }
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 750;
}

.button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.button-secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.button-secondary:hover {
  border-color: #bac5bf;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(22, 34, 31, 0.07);
}

.button:disabled { cursor: wait; opacity: 0.64; }

.catalog { padding: 32px 0 74px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.71rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 210px 180px;
  gap: 12px;
  margin-bottom: 24px;
}

.search-box,
.select-control select {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
}

.search-box:focus-within,
.select-control select:focus-visible {
  border-color: var(--green);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(21, 119, 92, 0.1);
}

.search-box svg {
  width: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-box input::placeholder { color: var(--faint); }

kbd {
  padding: 3px 7px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
  font-size: 0.68rem;
  white-space: nowrap;
}

.select-control { position: relative; }

.select-control select {
  width: 100%;
  padding: 0 42px 0 14px;
  color: var(--ink);
  appearance: none;
  font-size: 0.82rem;
  font-weight: 750;
}

.select-control svg {
  position: absolute;
  top: 17px;
  right: 14px;
  width: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.status-banner {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 20px;
  padding: 0 16px;
  color: var(--green-dark);
  border: 1px solid #cce8db;
  border-radius: 14px;
  background: var(--green-soft);
  font-size: 0.85rem;
}

.status-banner[hidden] { display: none; }

.status-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(21, 119, 92, 0.25);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.product-card:hover {
  border-color: #c4cec9;
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.product-open {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  color: inherit;
  border: 0;
  background: transparent;
  text-align: left;
}

.product-open:focus-visible {
  outline: 3px solid rgba(21, 119, 92, 0.35);
  outline-offset: -3px;
}

.product-visual {
  position: relative;
  min-height: 238px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #f8faf7, #edf1ed);
}

.product-image {
  position: relative;
  z-index: 1;
  grid-area: 1 / 1;
  width: calc(100% - 44px);
  height: 194px;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: drop-shadow(12px 16px 14px rgba(22, 34, 31, 0.12));
  transition: transform 180ms ease, opacity 140ms ease;
}

.product-card:hover .product-image { transform: scale(1.035) translateY(-2px); }

.product-placeholder,
.dialog-placeholder {
  display: grid;
  place-items: center;
  color: #94a09b;
}

.product-placeholder svg {
  width: 150px;
  fill: rgba(255, 255, 255, 0.6);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.product-placeholder { grid-area: 1 / 1; }

.product-placeholder[hidden],
.dialog-placeholder[hidden],
.product-image[hidden],
#dialog-image[hidden] { display: none; }

.quantity-badge {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid rgba(22, 34, 31, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(22, 34, 31, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
}

.product-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.product-brand {
  color: var(--green);
  font-size: 0.69rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-model {
  margin: 8px 0 5px;
  overflow: hidden;
  font-size: clamp(1.18rem, 1.6vw, 1.42rem);
  font-weight: 760;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-name {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.5;
}

.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 15px;
}

.product-specs span {
  padding: 5px 8px;
  color: #59635f;
  border-radius: 7px;
  background: #f0f3ef;
  font-size: 0.66rem;
  font-weight: 700;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.72rem;
}

.verification-label { color: var(--muted); }
.verification-label.is-pending { color: #9a681e; }
.view-details { color: var(--green); font-weight: 850; }

.skeleton-card {
  min-height: 440px;
  border-radius: 20px;
  background: linear-gradient(100deg, #e6eae5 20%, #f4f6f3 42%, #e6eae5 65%);
  background-size: 260% 100%;
  animation: shimmer 1.35s ease infinite;
}

@keyframes shimmer { to { background-position-x: -260%; } }

.empty-state,
.error-state {
  min-height: 230px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px;
  color: var(--muted);
  border: 1px dashed #c8d0cb;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
  text-align: center;
}

.empty-state:not([hidden]) { display: flex; flex-direction: column; }
.error-state:not([hidden]) { display: flex; }
.empty-state h2, .error-state h2 { margin: 0; color: var(--ink); font-size: 1.1rem; }
.empty-state p, .error-state p { margin: 6px 0 0; }

.empty-icon,
.error-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(22, 34, 31, 0.08);
  font-size: 1.4rem;
  font-weight: 850;
}

.error-icon { color: var(--danger); }

footer {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
}

.product-dialog {
  width: min(960px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 32px));
  grid-template-columns: 1fr 1.05fr;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 28px 100px rgba(12, 28, 23, 0.28);
}

.product-dialog[open] { display: grid; }

.product-dialog::backdrop {
  background: rgba(13, 29, 24, 0.58);
  backdrop-filter: blur(6px);
}

.dialog-close {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  font-size: 1.4rem;
  line-height: 1;
}

.dialog-visual {
  min-height: 570px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #f8faf7, #e9efea);
}

#dialog-image {
  grid-area: 1 / 1;
  width: calc(100% - 64px);
  height: 470px;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: drop-shadow(18px 24px 18px rgba(22, 34, 31, 0.14));
  transition: opacity 140ms ease;
}

.dialog-placeholder svg {
  width: 210px;
  fill: rgba(255, 255, 255, 0.6);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.dialog-placeholder { grid-area: 1 / 1; }

.dialog-content {
  align-self: center;
  max-height: 760px;
  padding: 58px 54px 44px;
  overflow-y: auto;
}

.dialog-content h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 4vw, 3.3rem);
  letter-spacing: -0.05em;
  line-height: 1;
}

.dialog-content h3 {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.45;
}

.dialog-note {
  margin: 22px 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.dialog-quantity {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 24px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--green-soft);
}

.dialog-quantity strong { color: var(--green-dark); font-size: 1.25rem; }
.dialog-quantity span { color: var(--green-dark); font-size: 0.78rem; font-weight: 750; }

.dialog-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 24px;
  border-top: 1px solid var(--line);
}

.dialog-specs div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.dialog-specs div:nth-child(odd) { padding-right: 18px; }
.dialog-specs div:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line); }
.dialog-specs dt { color: var(--muted); font-size: 0.7rem; }
.dialog-specs dd { margin: 4px 0 0; font-size: 0.86rem; font-weight: 800; }

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}

.source-link:hover { text-decoration: underline; }
.source-link[hidden] { display: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .app-shell { width: min(100% - 30px, 760px); }
  .site-header { min-height: 78px; }
  .inventory-status { display: none; }
  .catalog { padding-top: 28px; }
  .catalog-toolbar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-dialog { grid-template-columns: 1fr; }
  .dialog-visual { min-height: 330px; }
  #dialog-image { height: 270px; }
  .dialog-content { padding: 38px 30px 34px; }
}

@media (max-width: 590px) {
  .app-shell { width: min(100% - 22px, 520px); }
  .brand-mark { width: 38px; height: 38px; }
  .brand-copy strong { font-size: 0.9rem; }
  .brand-copy small { font-size: 0.62rem; }
  .header-actions .button { width: 44px; padding: 0; }
  .header-actions .button span { display: none; }
  .header-actions .button svg { width: 20px; }
  .catalog { padding: 22px 0 60px; }
  .catalog-toolbar { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .product-grid { grid-template-columns: 1fr; }
  .product-visual { min-height: 250px; }
  .product-image { height: 205px; }
  .product-dialog { max-height: calc(100vh - 20px); }
  .dialog-visual { display: none; }
  .dialog-content { padding: 62px 24px 30px; }
  .dialog-specs { grid-template-columns: 1fr; }
  .dialog-specs div:nth-child(odd),
  .dialog-specs div:nth-child(even) { padding: 13px 0; border-left: 0; }
  .error-state:not([hidden]) { align-items: flex-start; flex-direction: column; text-align: left; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Utility-first browsing, galleries and theme controls */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf3f0;
  --muted: #aab5b0;
  --faint: #7e8a85;
  --surface: #18211f;
  --canvas: #0e1513;
  --line: #303c38;
  --line-soft: #28332f;
  --green: #66cda8;
  --green-dark: #8ee0c0;
  --green-soft: #173c31;
  --lime: #c9ed6b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

body { transition: color 180ms ease, background-color 180ms ease; }

.stock-reminder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.stock-reminder svg {
  width: 16px;
  fill: none;
  stroke: #b67a22;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.theme-toggle {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.theme-toggle svg {
  grid-area: 1 / 1;
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sun-icon { display: none; }
html[data-theme="dark"] .sun-icon { display: block; }
html[data-theme="dark"] .moon-icon { display: none; }

html[data-theme="dark"] .brand-mark { background: #eef4f1; }
html[data-theme="dark"] .inventory-status { background: rgba(24, 33, 31, 0.86); }
html[data-theme="dark"] .button-secondary:hover,
html[data-theme="dark"] .theme-toggle:hover { border-color: #52625c; }

.category-browser {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.browser-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.browser-heading .eyebrow { margin-bottom: 5px; }

.browser-prompt-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.facet-back {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px 7px 8px;
  color: var(--green-dark);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.facet-back:hover {
  border-color: var(--green);
  background: var(--green-soft);
  transform: translateX(-2px);
}

.facet-back[hidden] { display: none; }
.facet-back svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.browser-prompt {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.facet-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font-size: 0.75rem;
  font-weight: 750;
}

.facet-breadcrumbs button {
  padding: 0;
  color: var(--green);
  border: 0;
  background: transparent;
  font-weight: inherit;
}

.facet-breadcrumbs button:hover { text-decoration: underline; }

.facet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.facet-card {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 15px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--canvas);
  text-align: left;
  animation: facet-enter 180ms ease both;
  transition: border-color 150ms ease, color 150ms ease, transform 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.facet-card:hover:not(:disabled) {
  border-color: var(--green);
  transform: translateY(-2px);
}

.facet-card.is-active {
  color: #fff;
  border-color: var(--green-dark);
  background: var(--green-dark);
  box-shadow: 0 10px 24px rgba(35, 92, 70, 0.18);
}

.facet-card:disabled { cursor: default; opacity: 0.42; }
.facet-card > span:first-child { min-width: 0; }
.facet-card strong, .facet-card small { display: block; }
.facet-card strong { font-size: 0.9rem; }
.facet-card small { margin-top: 5px; color: var(--muted); font-size: 0.69rem; line-height: 1.35; }
.facet-card.is-active small { color: rgba(255, 255, 255, 0.74); }

.facet-count {
  flex: 0 0 auto;
  padding: 6px 8px;
  color: var(--green-dark);
  border-radius: 999px;
  background: var(--green-soft);
  font-size: 0.66rem;
  font-weight: 850;
}

.facet-card.is-active .facet-count {
  color: var(--green-dark);
  background: #fff;
}

html[data-theme="dark"] .facet-card.is-active {
  color: #fff;
  border-color: #66cda8;
  background: #1d6a53;
}

html[data-theme="dark"] .facet-card.is-active .facet-count {
  color: #123c30;
  background: #dff7ed;
}

@keyframes facet-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.product-card { position: relative; }
.product-body { padding-bottom: 62px; }

.card-source-link {
  position: absolute;
  z-index: 4;
  right: 17px;
  bottom: 17px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: transform 150ms ease, border-color 150ms ease;
}

.card-source-link:hover { border-color: var(--green); transform: translateY(-1px); }
.card-source-link[hidden] { display: none; }
.card-source-link svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.product-visual,
.dialog-visual { background: linear-gradient(145deg, #f8faf7, #e9efea); }

.gallery-control {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  color: #16221f;
  border: 1px solid rgba(22, 34, 31, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(22, 34, 31, 0.12);
  font-size: 2rem;
  line-height: 1;
  transform: translateY(-50%);
}

.gallery-control[hidden],
.gallery-position[hidden] { display: none; }
.gallery-previous { left: 16px; }
.gallery-next { right: 16px; }

.gallery-position {
  position: absolute;
  z-index: 3;
  bottom: 18px;
  left: 50%;
  padding: 5px 9px;
  color: #16221f;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.68rem;
  font-weight: 800;
  transform: translateX(-50%);
}

.dialog-visual { position: relative; }
.dialog-close { color: var(--ink); background: var(--surface); }

html[data-theme="dark"] .product-specs span { color: #c3cec9; background: #28332f; }
html[data-theme="dark"] .quantity-badge { color: #16221f; }
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .error-state { background: rgba(24, 33, 31, 0.64); }
html[data-theme="dark"] .skeleton-card {
  background: linear-gradient(100deg, #202b27 20%, #2b3732 42%, #202b27 65%);
  background-size: 260% 100%;
}

@media (max-width: 1080px) {
  .stock-reminder { font-size: 0.7rem; }
  .inventory-status { display: none; }
}

@media (max-width: 860px) {
  .site-header { flex-wrap: wrap; padding: 14px 0; }
  .stock-reminder { order: 3; width: 100%; margin-top: -4px; }
  .category-browser { padding: 17px; }
  .browser-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 590px) {
  .header-actions { gap: 8px; }
  .theme-toggle { width: 44px; height: 44px; }
  .stock-reminder { justify-content: flex-start; }
  .facet-grid { grid-template-columns: 1fr; }
  .facet-card { min-height: 72px; }
  .dialog-visual { display: grid; min-height: 250px; }
  #dialog-image { width: calc(100% - 70px); height: 205px; }
  .gallery-control { width: 36px; height: 36px; }
  .gallery-previous { left: 10px; }
  .gallery-next { right: 10px; }
}
