/* ============================================================
   Opto Alignment — design-system components as CSS classes.
   Ported 1:1 from the compiled React design system
   (window.OptoAlignmentDesignSystem_2c67ef): Button, Card, Badge,
   Tag, Callout, SpecRow, StatReadout, Tabs, Input/Select/Checkbox,
   IconButton — plus PhotoSlot, ModelCardImage, gallery & modal.
   ============================================================ */

/* ---- Button ---- */
.oa-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 600; line-height: 1; letter-spacing: 0.01em;
  border-radius: var(--radius-md); cursor: pointer; text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
a.oa-btn:hover { text-decoration: none; }
.oa-btn--sm { font-size: 0.8125rem; padding: 6px 12px;  min-height: 32px; gap: 6px; }
.oa-btn--md { font-size: 0.9375rem; padding: 9px 18px;  min-height: 40px; gap: 8px; }
.oa-btn--lg { font-size: 1.0625rem; padding: 12px 24px; min-height: 48px; gap: 10px; }
.oa-btn--full { width: 100%; }
.oa-btn .oa-btn__icon { display: inline-flex; }

.oa-btn--primary { background: var(--action-bg); color: var(--action-fg); box-shadow: var(--shadow-xs); }
.oa-btn--primary:hover  { background: var(--action-bg-hover); color: var(--action-fg); }
.oa-btn--primary:active { background: var(--action-bg-active); }

.oa-btn--accent { background: var(--accent-bg); color: var(--accent-fg); }
.oa-btn--accent:hover  { background: var(--accent-bg-hover); color: var(--accent-fg); }
.oa-btn--accent:active { background: var(--accent-bg-active); }

.oa-btn--secondary { background: var(--surface-card); color: var(--brand-blue); border-color: var(--border-default); }
.oa-btn--secondary:hover  { background: var(--blue-50); border-color: var(--brand-blue); color: var(--brand-blue); }
.oa-btn--secondary:active { background: var(--blue-100); }

.oa-btn--ghost { background: transparent; color: var(--brand-blue); }
.oa-btn--ghost:hover  { background: var(--blue-50); color: var(--brand-blue); }
.oa-btn--ghost:active { background: var(--blue-100); }

/* Inverse secondary (transparent on brand-blue bands) */
.oa-btn--inverse { background: transparent; color: #fff; border-color: rgba(255,255,255,0.55); }
.oa-btn--inverse:hover { background: rgba(255,255,255,0.1); color: #fff; }

.oa-btn:disabled, .oa-btn.is-disabled {
  background: var(--gray-200); border-color: var(--gray-200);
  color: var(--gray-400); cursor: not-allowed; box-shadow: none;
}

/* ---- IconButton ---- */
.oa-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; color: var(--gray-600);
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-md);
  cursor: pointer; transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.oa-icon-btn:hover { background: var(--blue-50); }

/* ---- Card ---- */
.oa-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  transition: box-shadow var(--dur-base) var(--ease-standard), border-color var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-standard);
}
.oa-card--pad-none { padding: 0; }
.oa-card--pad-sm   { padding: var(--space-4); }
.oa-card--pad-lg   { padding: var(--space-8); }
.oa-card--interactive { cursor: pointer; }
.oa-card--interactive:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
a.oa-card, a.oa-card:hover { text-decoration: none; color: inherit; }

/* ---- Badge ---- */
.oa-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--radius-pill);
  white-space: nowrap; line-height: 1.4;
}
.oa-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.oa-badge--pass    { color: var(--status-pass-fg); background: var(--status-pass-bg); }
.oa-badge--pass    .oa-badge__dot { background: var(--green-500); }
.oa-badge--warn    { color: var(--status-warn-fg); background: var(--status-warn-bg); }
.oa-badge--fail    { color: var(--status-fail-fg); background: var(--status-fail-bg); }
.oa-badge--info    { color: var(--status-info-fg); background: var(--status-info-bg); }
.oa-badge--info    .oa-badge__dot { background: var(--brand-blue); }
.oa-badge--accent  { color: var(--brand-white); background: var(--brand-magenta); }
.oa-badge--neutral { color: var(--gray-600); background: var(--gray-100); }

/* ---- Tag ---- */
.oa-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body); font-size: 0.8125rem; font-weight: 500;
  color: var(--gray-700); background: var(--gray-100);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px; border-radius: var(--radius-sm); line-height: 1.4;
}
.oa-tag--brand { color: var(--brand-blue); background: var(--blue-50); border-color: var(--blue-100); }

/* ---- Callout ---- */
.oa-callout {
  display: flex; gap: 12px;
  border-left: 3px solid var(--brand-blue);
  border-radius: var(--radius-sm);
  background: var(--blue-50);
  padding: 14px 16px;
}
.oa-callout__inner { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.oa-callout__title { font-family: var(--font-body); font-weight: 600; font-size: 0.9375rem; color: var(--blue-800); }
.oa-callout__body  { font-family: var(--font-body); font-size: 0.875rem; color: var(--text-body); line-height: 1.55; }
.oa-callout--note   { border-left-color: var(--gray-400); background: var(--gray-50); }
.oa-callout--note   .oa-callout__title { color: var(--gray-700); }
.oa-callout--warn   { border-left-color: var(--amber-500); background: var(--status-warn-bg); }
.oa-callout--warn   .oa-callout__title { color: var(--amber-700); }
.oa-callout--pass   { border-left-color: var(--green-500); background: var(--status-pass-bg); }
.oa-callout--pass   .oa-callout__title { color: var(--green-700); }
.oa-callout--accent { border-left-color: var(--brand-magenta); background: var(--magenta-50); }
.oa-callout--accent .oa-callout__title { color: var(--magenta-700); }

/* ---- SpecRow ---- */
.oa-spec-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--border-subtle);
}
.oa-spec-row.is-last { border-bottom: none; }
.oa-spec-row__label { font-family: var(--font-body); font-size: 0.875rem; color: var(--text-muted); }
.oa-spec-row__num   { display: flex; align-items: baseline; gap: 5px; }
.oa-spec-row__value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 0.9375rem; color: var(--text-strong);
}
.oa-spec-row__value--pass { color: var(--status-pass-fg); }
.oa-spec-row__value--warn { color: var(--status-warn-fg); }
.oa-spec-row__value--fail { color: var(--status-fail-fg); }
.oa-spec-row__unit { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-subtle); }

/* ---- StatReadout ---- */
.oa-stat { display: flex; flex-direction: column; gap: 4px; }
.oa-stat__label {
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted);
}
.oa-stat__row   { display: flex; align-items: baseline; gap: 6px; }
.oa-stat__value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-weight: 600; line-height: 1; letter-spacing: -0.01em;
}
.oa-stat--sm .oa-stat__value { font-size: 1.75rem; }
.oa-stat--md .oa-stat__value { font-size: 2.75rem; }
.oa-stat__unit { font-family: var(--font-mono); color: var(--text-muted); font-weight: 500; }
.oa-stat--sm .oa-stat__unit { font-size: 0.9rem; }
.oa-stat--md .oa-stat__unit { font-size: 1.1rem; }
.oa-stat__value--blue    { color: var(--brand-blue); }
.oa-stat__value--magenta { color: var(--brand-magenta); }
.oa-stat__value--cyan    { color: var(--cyan-500); }
.oa-stat__value--ink     { color: var(--text-strong); }

/* ---- Tabs ---- */
.oa-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-subtle); }
.oa-tab {
  position: relative; border: none; background: transparent; cursor: pointer;
  font-family: var(--font-body); font-size: 0.9375rem; font-weight: 500;
  color: var(--text-muted); padding: 10px 14px; margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.oa-tab[aria-selected="true"] { font-weight: 600; color: var(--text-strong); border-bottom-color: var(--brand-magenta); }
.oa-tab-panel[hidden] { display: none; }

/* ---- Form fields ---- */
.oa-field { display: flex; flex-direction: column; gap: 6px; }
.oa-field__label { font-family: var(--font-body); font-size: 0.8125rem; font-weight: 600; color: var(--text-strong); }
.oa-field__label .req { color: var(--brand-magenta); margin-left: 3px; }
.oa-field__box {
  display: flex; align-items: center; background: var(--surface-card);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast); overflow: hidden;
}
.oa-field__box:focus-within { border-color: var(--brand-blue); box-shadow: var(--focus-ring); }
.oa-field__box input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-body); font-size: 0.9375rem; color: var(--text-strong);
  padding: 9px 12px; min-width: 0;
}
.oa-field__box input.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.oa-field__unit {
  font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-muted);
  padding: 0 12px; border-left: 1px solid var(--border-subtle);
  align-self: stretch; display: flex; align-items: center;
}
.oa-field textarea {
  font-family: var(--font-body); font-size: var(--fs-body); color: var(--text-strong);
  padding: 10px 12px; border-radius: var(--radius-md); resize: vertical;
  border: 1px solid var(--border-default); outline: none; background: var(--surface-card);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.oa-field textarea:focus { border-color: var(--brand-blue); box-shadow: var(--focus-ring); }
.oa-select-wrap { position: relative; display: flex; }
.oa-select-wrap select {
  flex: 1; appearance: none; -webkit-appearance: none;
  font-family: var(--font-body); font-size: 0.9375rem; color: var(--text-strong);
  background: var(--surface-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: 9px 36px 9px 12px; cursor: pointer;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.oa-select-wrap select:focus { outline: none; border-color: var(--brand-blue); box-shadow: var(--focus-ring); }
.oa-select-wrap::after {
  content: ''; position: absolute; right: 12px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--gray-500); border-bottom: 2px solid var(--gray-500);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.oa-checkbox { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.oa-checkbox input { position: absolute; opacity: 0; width: 18px; height: 18px; margin: 0; cursor: inherit; }
.oa-checkbox__box {
  position: relative; width: 18px; height: 18px; flex-shrink: 0;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong);
  background: var(--surface-card); display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.oa-checkbox__box svg { opacity: 0; }
.oa-checkbox input:checked + .oa-checkbox__box { background: var(--brand-blue); border-color: var(--brand-blue); }
.oa-checkbox input:checked + .oa-checkbox__box svg { opacity: 1; }
.oa-checkbox__label { font-family: var(--font-body); font-size: 0.9375rem; color: var(--text-body); }

/* ---- PhotoSlot (branded placeholder) ---- */
.oa-photoslot {
  border-radius: var(--radius-lg); position: relative; overflow: hidden;
  background: var(--gray-100); border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
}
.oa-photoslot--dark { background: var(--blue-900); border-color: transparent; }
.oa-photoslot__mark { height: 54%; max-height: 180px; opacity: 0.10; }
.oa-photoslot--dark .oa-photoslot__mark { opacity: 0.16; filter: brightness(3); }
.oa-photoslot__label {
  position: absolute; bottom: 12px; left: 14px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-subtle);
}
.oa-photoslot--dark .oa-photoslot__label { color: var(--blue-200); }

/* ---- ModelCardImage (lineup-gradient contained photo) ---- */
.oa-model-img {
  background: linear-gradient(180deg, #e7eff2 0%, #d3e3ec 55%, #bdd8e2 100%);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  padding: 10px; overflow: hidden;
}
.oa-model-img img { max-height: 100%; max-width: 100%; object-fit: contain; }

/* ---- Accessory gallery (click-through carousel) ---- */
.oa-gallery { align-self: start; }
.oa-gallery__frame {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-subtle); padding: 10px;
  background: linear-gradient(180deg, #e7eff2 0%, #d3e3ec 55%, #bdd8e2 100%);
  display: flex; align-items: center; justify-content: center;
}
.oa-gallery__frame img { max-height: 100%; max-width: 100%; object-fit: contain; }
.oa-gallery__frame img[hidden] { display: none; }
.oa-gallery__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border-subtle); background: rgba(255,255,255,0.92);
  color: var(--brand-blue); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(16,32,56,0.16);
}
.oa-gallery__nav--prev { left: 12px; }
.oa-gallery__nav--next { right: 12px; }
.oa-gallery__dots { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.oa-gallery__dot {
  width: 8px; height: 8px; border-radius: 99px; padding: 0; border: none;
  cursor: pointer; background: #c3d0da; transition: width 160ms ease;
}
.oa-gallery__dot[aria-current="true"] { width: 24px; background: var(--brand-blue); }

/* ---- Hero rotator dots ---- */
.oa-hero-dot {
  height: 8px; width: 8px; border-radius: var(--radius-pill); border: none; padding: 0;
  cursor: pointer; background: var(--gray-300);
  transition: width 200ms cubic-bezier(0.2,0,0.2,1), background 200ms;
}
.oa-hero-dot[aria-current="true"] { width: 28px; background: var(--brand-magenta); }

/* ---- Store configurator modal ---- */
.oa-modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(13,27,61,0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.oa-modal-overlay[hidden] { display: none; }
.oa-modal {
  background: var(--surface-card); border-radius: var(--radius-lg);
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.oa-opt-toggle {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  border: 1px solid var(--border-default); background: var(--surface-card);
  border-radius: var(--radius-md); padding: 10px 12px;
  font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--text-strong);
}
.oa-opt-toggle[aria-pressed="true"] { border-color: var(--brand-blue); background: var(--blue-50); }
.oa-opt-toggle .swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border-default); flex-shrink: 0; }

/* ---- Quantity stepper ---- */
.oa-qty { display: inline-flex; align-items: center; border: 1px solid var(--border-default); border-radius: var(--radius-sm); overflow: hidden; }
.oa-qty button {
  width: 36px; height: 36px; border: none; background: var(--surface-sunken);
  color: var(--text-strong); font-size: 18px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.oa-qty input {
  width: 56px; height: 36px; text-align: center; border: none; outline: none;
  font-family: var(--font-mono); font-size: 15px; color: var(--text-strong);
  -moz-appearance: textfield; appearance: textfield;
}
.oa-qty input::-webkit-outer-spin-button, .oa-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.oa-qty--sm button { width: 28px; height: 28px; font-size: 16px; }
.oa-qty--sm .oa-qty__num { min-width: 34px; text-align: center; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 14px; }

/* ---- Misc ---- */
.oa-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); margin-bottom: 24px; flex-wrap: wrap; }
.oa-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.oa-breadcrumb a:hover { color: var(--brand-blue); }
.oa-breadcrumb .is-current { color: var(--text-body); }
.oa-link-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600;
  color: var(--brand-blue); text-decoration: none;
}
.oa-link-btn:hover { text-decoration: underline; }
.oa-check-round {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--status-pass-bg); color: var(--status-pass-fg);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---- Header search ---- */
.oa-search { position: relative; display: flex; align-items: center; }
.oa-search__toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; margin-right: 2px; flex-shrink: 0;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-md);
  color: var(--text-body); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.oa-search__toggle:hover { background: var(--blue-50); color: var(--brand-blue); }
.oa-search.is-open .oa-search__toggle { display: none; }

.oa-search__field {
  display: flex; align-items: center; gap: 8px;
  width: 0; min-width: 0; overflow: hidden; opacity: 0; padding: 0;
  background: var(--surface-card); border: 1px solid transparent; border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease-standard), opacity var(--dur-base) var(--ease-standard),
    padding var(--dur-slow) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
.oa-search.is-open .oa-search__field {
  width: 300px; opacity: 1; padding: 0 8px 0 12px; border-color: var(--border-default);
}
.oa-search.is-open .oa-search__field:focus-within { border-color: var(--brand-blue); box-shadow: var(--focus-ring); }
.oa-search__field-icon { display: inline-flex; color: var(--text-subtle); flex-shrink: 0; }
.oa-search__input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-family: var(--font-body); font-size: 14.5px; color: var(--text-strong); padding: 8px 0;
}
.oa-search__input::placeholder { color: var(--text-subtle); font-weight: 400; }
.oa-search__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex-shrink: 0; padding: 0;
  background: transparent; border: none; border-radius: 50%; color: var(--text-subtle); cursor: pointer;
}
.oa-search__close:hover { background: var(--blue-50); color: var(--brand-blue); }

.oa-search__results {
  position: absolute; top: calc(100% + 8px); left: 0;
  width: 340px; max-height: 360px; overflow-y: auto;
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 30; padding: 6px;
}
.oa-search__result {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm); text-decoration: none; cursor: pointer;
}
.oa-search__result:hover, .oa-search__result.is-active { background: var(--blue-50); }
.oa-search__result-title { font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--text-strong); }
.oa-search__result-category {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: var(--ls-wide);
  text-transform: uppercase; color: var(--text-subtle); flex-shrink: 0;
}
.oa-search__empty { padding: 14px 10px; font-size: 13.5px; color: var(--text-muted); text-align: center; }

/* Mobile nav variant — always-open static field instead of an expanding one */
.oa-search--mobile .oa-search__field--static {
  width: 100%; opacity: 1; padding: 0 10px;
  background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
}
.oa-search--mobile .oa-search__field--static:focus-within { border-color: var(--brand-blue); box-shadow: var(--focus-ring); }
.oa-search--mobile .oa-search__results { position: static; width: 100%; margin-top: 8px; box-shadow: none; }

@media (max-width: 1080px) {
  .oa-search.is-open .oa-search__field { width: 220px; }
}
