#fdms { margin: 1rem 0; }
#fdms-searchbox { margin-bottom: 1.5rem; }

/* Search box + AI toggle row */
.fdms-top { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.fdms-top #fdms-searchbox { flex: 1 1 280px; margin-bottom: 0; }

.fdms-ai-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: none; border: 0; padding: 0.25rem; cursor: pointer;
  font: inherit; color: inherit; white-space: nowrap;
}
.fdms-ai-track {
  position: relative; width: 38px; height: 22px; border-radius: 11px;
  background: #c9c9cf; transition: background 0.2s;
}
.fdms-ai-knob {
  position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform 0.2s;
}
.fdms-ai-toggle[aria-checked="true"] .fdms-ai-track { background: #5b4fe0; }
.fdms-ai-toggle[aria-checked="true"] .fdms-ai-knob { transform: translateX(16px); }
.fdms-ai-toggle:focus-visible { outline: 2px solid #5b4fe0; outline-offset: 2px; border-radius: 6px; }
.fdms-ai-label { font-weight: 500; }
.fdms-ai-on .ais-SearchBox-form { box-shadow: 0 0 0 2px #5b4fe0 inset; border-radius: 4px; }

.fdms-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
}
.fdms-filters h4 { margin: 1.25rem 0 0.5rem; font-size: 0.95rem; }
#fdms-stock { margin-top: 1.25rem; }
#fdms-stats { margin-bottom: 1rem; opacity: 0.7; font-size: 0.9rem; }

#fdms .ais-Hits-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}
#fdms .ais-Hits-item { padding: 0; box-shadow: none; display: block; }

.fdms-card { display: flex; flex-direction: column; gap: 0.4rem; text-decoration: none; color: inherit; }
.fdms-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px; }
.fdms-name { font-weight: 500; }

#fdms-pagination { margin-top: 2rem; }

@media (max-width: 720px) {
  .fdms-layout { grid-template-columns: 1fr; gap: 1rem; }
}
