/* ============================================================================
   DOROSHKE Theme Components — v1.0 LIGHT MODE ONLY
   Reference implementation of every component in the theme, written entirely
   against the tokens in theme-tokens.css. Load AFTER theme-tokens.css.

   No component declares a raw colour, size or spacing value. If you need a new
   value, add a token — do not hardcode it here.
   Class prefix: .dk-
   ============================================================================ */

/* ---------------------------------------------------------------- BUTTON --- */
.dk-btn {
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--button-height);
  padding-inline: var(--button-padding-x);
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font-fa);
  font-size: var(--button-font-size);
  font-weight: var(--button-font-weight);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.dk-btn:focus-visible { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); }

/* sizes */
.dk-btn--sm { height: var(--button-height-sm); padding-inline: var(--space-3); }
.dk-btn--lg { height: var(--button-height-lg); padding-inline: var(--space-5); }
.dk-btn--block { width: 100%; }

/* primary */
.dk-btn--primary {
  background: var(--button-primary-background);
  color: var(--button-primary-text);
  border-radius: var(--radius-sm);
}
.dk-btn--primary:hover { background: var(--button-primary-hover); }
.dk-btn--primary:active { background: var(--button-primary-pressed); }

/* secondary — transparent ground, 1px inset */
.dk-btn--secondary {
  background: transparent;
  color: var(--button-secondary-text);
  box-shadow: inset 0 0 0 var(--border-width) var(--button-secondary-border);
}
.dk-btn--secondary:hover { background: var(--button-secondary-hover); }
.dk-btn--secondary:active { background: var(--button-secondary-pressed); }

/* ghost — no border, so no cut (there is no filled shape to cut) */
.dk-btn--ghost { background: transparent; color: var(--button-ghost-text); }
.dk-btn--ghost:hover { background: var(--button-ghost-hover); }

/* destructive */
.dk-btn--destructive {
  background: var(--button-destructive-background);
  color: var(--button-destructive-text);
  border-radius: var(--radius-sm);
}
.dk-btn--destructive:hover { background: var(--button-destructive-hover); }
.dk-btn--destructive:active { background: var(--button-destructive-pressed); }

/* inverse — white-on-cobalt, for the rare cobalt ground */
.dk-btn--inverse {
  background: var(--button-inverse-background);
  color: var(--button-inverse-text);
  border-radius: var(--radius-sm);
}
.dk-btn--inverse:hover { background: var(--button-inverse-hover); }
.dk-btn--inverse:active { background: var(--button-inverse-pressed); }

/* disabled — applies to every variant. Size is preserved so layout never shifts. */
.dk-btn:disabled,
.dk-btn[aria-disabled="true"] {
  background: var(--button-disabled-background);
  color: var(--button-disabled-text);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}
.dk-btn--secondary:disabled {
  background: transparent;
  color: var(--text-disabled);
  box-shadow: inset 0 0 0 var(--border-width) var(--surface-disabled);
}
/* Ghost has no border in any state — see component-specifications.md. */
.dk-btn--ghost:disabled {
  background: transparent;
  color: var(--text-disabled);
  box-shadow: none;
}

/* loading */
.dk-btn[aria-busy="true"] { pointer-events: none; }
.dk-btn__spinner {
  width: 14px; height: 14px; flex: 0 0 auto;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  animation: dk-spin 700ms linear infinite;
}
@keyframes dk-spin { to { transform: rotate(360deg); } }

/* icon-only */
.dk-icon-btn {
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--control-h); height: var(--control-h);
  background: transparent; border: 0; border-radius: var(--radius);
  color: var(--text-body); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease);
}
.dk-icon-btn--sm { width: var(--control-h-sm); height: var(--control-h-sm); }
.dk-icon-btn--outline { box-shadow: inset 0 0 0 var(--border-width) var(--border-default); }
.dk-icon-btn--filled { background: var(--surface-brand); color: var(--text-on-brand); border-radius: var(--radius-sm); }
.dk-icon-btn:hover { background: var(--surface-brand-wash); }
.dk-icon-btn:focus-visible { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); }
.dk-icon-btn[aria-pressed="true"] { color: var(--text-accent); }

/* ------------------------------------------------------------------ CARD --- */
.dk-card {
  background: var(--card-background);
  border: var(--border-width) solid var(--card-border);
  border-radius: var(--radius);
  padding: var(--card-padding);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease);
}
.dk-card:hover { border-color: var(--card-border-hover); }
.dk-card--flat { border-radius: 0; }
.dk-card__title { font-size: var(--card-title-size); font-weight: var(--weight-semibold); line-height: var(--lh-h3); margin: 0; }

/* ---------------------------------------------------------- IMAGE FRAME --- */
.dk-image {
  position: relative;
  display: block;
  width: 100%;
  background: var(--image-frame-background);
  overflow: hidden;
  border: 0;
}
.dk-image--3x2 { aspect-ratio: 3 / 2; }
.dk-image--16x9 { aspect-ratio: 16 / 9; }
.dk-image--1x1 { aspect-ratio: 1 / 1; }
.dk-image--4x5 { aspect-ratio: 4 / 5; }
.dk-image--cut { border-radius: var(--radius-md); }  /* cards only */
.dk-image > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dk-image--sold > img { filter: grayscale(1); opacity: .72; }
.dk-image__label {
  border-radius: var(--radius-xs);
  position: absolute; bottom: var(--space-2); inset-inline-start: var(--space-2);
  height: var(--chip-height); display: inline-flex; align-items: center;
  padding-inline: var(--space-2);
  background: var(--surface-inverse); color: var(--text-on-inverse);
  font-size: var(--chip-font-size); font-weight: var(--weight-semibold);
}

/* --------------------------------------------------------- FORM CONTROLS --- */
.dk-field { display: flex; flex-direction: column; gap: var(--space-2); }
.dk-field__label { font-size: var(--text-label); font-weight: var(--weight-semibold); line-height: var(--lh-label); color: var(--text-body); }
.dk-field__req { color: var(--state-error); margin-inline-start: 2px; }
.dk-field__hint { font-size: var(--text-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.dk-field__error { font-size: var(--text-caption); line-height: var(--lh-caption); color: var(--state-error); font-weight: var(--weight-medium); }

.dk-input,
.dk-select,
.dk-textarea {
  border-radius: var(--radius-sm);
  width: 100%;
  height: var(--input-height);
  padding-inline: var(--input-padding-x);
  background: var(--input-background);
  color: var(--input-text);
  border: var(--border-width) solid var(--input-border);
  border-radius: var(--radius);
  font-family: var(--font-fa);
  font-size: var(--text-size-body);
  line-height: 1.4;
  transition: border-color var(--dur-fast) var(--ease);
}
.dk-textarea { height: auto; min-height: 96px; padding-block: 12px; line-height: 1.85; resize: vertical; }
.dk-input::placeholder,
.dk-textarea::placeholder { color: var(--input-placeholder); opacity: 1; }
.dk-input:hover,
.dk-select:hover,
.dk-textarea:hover { border-color: var(--input-border-hover); }
.dk-input:focus-visible,
.dk-select:focus-visible,
.dk-textarea:focus-visible {
  border-color: var(--input-border-focus);
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: var(--focus-offset);
}
.dk-input--error,
.dk-select--error { border-color: var(--input-border-error); }
.dk-input:disabled,
.dk-select:disabled,
.dk-textarea:disabled {
  background: var(--input-disabled-background);
  color: var(--input-disabled-text);
  cursor: not-allowed;
}
.dk-input[readonly] { background: var(--surface-muted); }
/* Latin / VIN modes */
.dk-input--latin { font-family: var(--font-en); direction: ltr; text-align: start; font-variant-numeric: tabular-nums; }
.dk-input--vin { font-family: var(--font-en); direction: ltr; text-transform: uppercase; letter-spacing: var(--tracking-vin); font-variant-numeric: tabular-nums; }

/* input group: leading icon / trailing unit */
.dk-input-group { position: relative; display: flex; align-items: center; }
.dk-input-group__icon {
  position: absolute; inset-inline-start: var(--space-3);
  display: inline-flex; color: var(--text-secondary); pointer-events: none;
}
/* Affix clearance MUST come from the container's direction, not the input's.
   .dk-input--latin / --vin set direction:ltr on the input itself, which flips the
   meaning of that input's own logical padding — so padding-inline-end lands on the
   right while the affix, placed by the RTL parent's inset-inline-end, sits on the
   left, and the two overlap. Physical padding scoped to the ancestor dir is the
   only correct derivation. */
[dir="rtl"] .dk-input-group--icon .dk-input { padding-right: calc(var(--space-3) * 2 + 20px); padding-left: var(--input-padding-x); }
[dir="ltr"] .dk-input-group--icon .dk-input { padding-left: calc(var(--space-3) * 2 + 20px); padding-right: var(--input-padding-x); }
.dk-input-group__unit {
  position: absolute; inset-inline-end: 0;
  height: 100%; display: inline-flex; align-items: center;
  padding-inline: var(--space-3);
  border-inline-start: var(--border-width) solid var(--border-default);
  font-family: var(--font-en); font-size: var(--text-caption); color: var(--text-secondary);
}
[dir="rtl"] .dk-input-group--unit .dk-input { padding-left: 64px; padding-right: var(--input-padding-x); }
[dir="ltr"] .dk-input-group--unit .dk-input { padding-right: 64px; padding-left: var(--input-padding-x); }

/* select chevron — 45deg only, no curves */
.dk-select {
  appearance: none;
  padding-inline-end: calc(var(--space-3) * 2 + 8px);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%), linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: calc(var(--space-3)) calc(50% - 2px), calc(var(--space-3) + 5px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* checkbox — 20px square, square-cap check, never rounded */
.dk-check { display: flex; align-items: flex-start; gap: var(--space-2); cursor: pointer; min-height: var(--touch-min); align-items: center; }
.dk-check__box {
  width: var(--checkbox-size); height: var(--checkbox-size); flex: 0 0 auto;
  background: var(--input-background);
  border: var(--border-width) solid var(--input-border);
  border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.dk-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dk-check input:checked + .dk-check__box,
.dk-check input:indeterminate + .dk-check__box { background: var(--surface-brand); border-color: var(--surface-brand); }
.dk-check input:focus-visible + .dk-check__box { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); }
.dk-check input:disabled + .dk-check__box { background: var(--surface-disabled); border-color: var(--surface-disabled); }
.dk-check__mark { width: 10px; height: 5px; border: 2px solid var(--text-on-brand); border-top: 0; border-inline-end: 0; transform: rotate(-45deg) translateY(-1px); display: none; }
.dk-check input:checked + .dk-check__box .dk-check__mark { display: block; }
.dk-check__dash { width: 10px; height: 2px; background: var(--text-on-brand); display: none; }
.dk-check input:indeterminate + .dk-check__box .dk-check__dash { display: block; }
.dk-check__label { font-size: var(--text-size-body); line-height: 1.5; }
.dk-check__desc { font-size: var(--text-caption); color: var(--text-secondary); }

/* radio — a 45deg-rotated square, the system answer to a circle */
.dk-radio { display: flex; align-items: center; gap: var(--space-2); cursor: pointer; min-height: var(--touch-min); }
.dk-radio__box {
  width: 16px; height: 16px; flex: 0 0 auto;
  background: var(--input-background);
  border: var(--border-width) solid var(--input-border);
  transform: rotate(45deg);
  display: inline-flex; align-items: center; justify-content: center;
}
.dk-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dk-radio input:checked + .dk-radio__box { border-color: var(--surface-brand); }
.dk-radio input:checked + .dk-radio__box::after { content: ""; width: 8px; height: 8px; background: var(--surface-brand); }
.dk-radio input:focus-visible + .dk-radio__box { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); }
.dk-radio input:disabled + .dk-radio__box { background: var(--surface-disabled); border-color: var(--surface-disabled); }

/* switch — 40x24 track with a 6px cut and a square thumb */
.dk-switch { display: flex; align-items: center; gap: var(--space-2); cursor: pointer; min-height: var(--touch-min); }
.dk-switch__track {
  width: var(--switch-width); height: var(--switch-height); flex: 0 0 auto;
  background: var(--surface-disabled);
  border-radius: var(--radius-full);
  display: flex; align-items: center; padding: 3px;
  transition: background-color var(--dur-fast) var(--ease);
}
.dk-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dk-switch__thumb { width: 18px; height: 18px; background: var(--switch-thumb); transition: transform var(--dur-fast) var(--ease); }
.dk-switch input:checked + .dk-switch__track { background: var(--surface-brand); }
.dk-switch input:checked + .dk-switch__track .dk-switch__thumb { transform: translateX(16px); }
[dir="rtl"] .dk-switch input:checked + .dk-switch__track .dk-switch__thumb { transform: translateX(-16px); }
.dk-switch input:focus-visible + .dk-switch__track { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); }
.dk-switch input:disabled + .dk-switch__track { opacity: .5; }

/* ------------------------------------------------------------ NAVIGATION --- */
.dk-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--navigation-height);
  background: var(--navigation-background);
  border-bottom: var(--border-width) solid var(--navigation-border);
}
.dk-header__inner { height: 100%; display: flex; align-items: center; gap: var(--space-5); }
.dk-header__logo { display: block; height: 24px; width: auto; }
.dk-header__nav { display: flex; align-items: stretch; height: 100%; gap: var(--space-4); }
.dk-header__link {
  display: inline-flex; align-items: center; height: 100%;
  color: var(--navigation-text); text-decoration: none;
  font-size: var(--text-label); font-weight: var(--weight-medium);
  border-bottom: 2px solid transparent;
}
.dk-header__link:hover { color: var(--navigation-text-hover); }
.dk-header__link[aria-current="page"] {
  font-weight: var(--weight-semibold);
  border-bottom-color: var(--navigation-active-indicator);
}
.dk-header__brand { display: inline-flex; align-items: center; height: 100%; flex: 0 0 auto; }
.dk-header__actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--space-2); }

/* account actions — guest: «ورود» text action + «درخواست عضویت», the ONE primary
   button in the header; member: name, membership state, «خروج». The
   .dk-header prefix keeps these at (0,2,0) so the inline-link rule in
   theme-tokens.css ((0,1,1), underline) does not restyle them. */
.dk-header__account { display: flex; align-items: center; gap: var(--space-3); }
.dk-header .dk-header__signin,
.dk-header .dk-header__logout {
  display: inline-flex; align-items: center; min-height: var(--control-h);
  padding-inline: var(--space-1);
  color: var(--text-link); text-decoration: none;
  font-size: var(--text-size-body); font-weight: var(--weight-medium);
  white-space: nowrap;
}
.dk-header .dk-header__logout { font-size: var(--text-label); font-weight: var(--weight-regular); }
.dk-header .dk-header__signin:hover,
.dk-header .dk-header__logout:hover { color: var(--text-link-hover); text-decoration: underline; text-underline-offset: 3px; }
.dk-header .dk-header__cta { text-decoration: none; white-space: nowrap; }
.dk-header__user { font-size: var(--text-label); color: var(--text-secondary); white-space: nowrap; }

/* membership state chip (pending / rejected) next to the name */
.dk-header .dk-tag,
.dk-mobile-nav .dk-tag {
  display: inline-flex; align-items: center; height: 24px; padding-inline: var(--space-2);
  border: var(--border-width) solid var(--border-default); border-radius: var(--radius-xs);
  color: var(--text-secondary); font-size: var(--text-caption); font-weight: var(--weight-medium);
  line-height: 1; white-space: nowrap;
}
.dk-header .dk-tag--pending,
.dk-mobile-nav .dk-tag--pending { background: var(--state-warning-bg); border-color: var(--state-warning); color: var(--state-warning); }
.dk-header .dk-tag--error,
.dk-mobile-nav .dk-tag--error { background: var(--state-error-bg); border-color: var(--state-error); color: var(--state-error); }

.dk-header__burger { display: none; }
@media (max-width: 900px) {
  .dk-header { height: var(--navigation-height-mobile); }
  .dk-header__inner { gap: var(--space-3); }
  /* menu, sign-in text, name and state fold into the drawer; the primary CTA stays */
  .dk-header__nav,
  .dk-header .dk-header__signin,
  .dk-header .dk-header__logout,
  .dk-header .dk-header__user,
  .dk-header .dk-header__account .dk-tag { display: none; }
  .dk-header__burger { display: inline-flex; }
}
@media (max-width: 600px) {
  .dk-header__logo--lockup { display: none; }
  .dk-header__logo--mark { display: block; height: 32px; }
  .dk-header__inner { gap: var(--space-2); }
  .dk-header__actions { gap: var(--space-1); }
}

/* mobile drawer nav */
.dk-mobile-nav { position: fixed; inset: 0; z-index: 60; }
.dk-mobile-nav__scrim { position: absolute; inset: 0; background: var(--overlay-scrim); }
.dk-mobile-nav__panel {
  position: absolute; inset-block: 0; inset-inline-start: 0;
  width: min(var(--drawer-width), 88vw);
  background: var(--surface-card);
  border-inline-end: var(--border-width) solid var(--border-default);
  display: flex; flex-direction: column;
  animation: dk-slide-start var(--dur-base) var(--ease);
}
@keyframes dk-slide-start { from { transform: translateX(-100%); } to { transform: none; } }
[dir="rtl"] .dk-mobile-nav__panel { animation-name: dk-slide-start-rtl; }
@keyframes dk-slide-start-rtl { from { transform: translateX(100%); } to { transform: none; } }
.dk-mobile-nav__link {
  display: flex; align-items: center; min-height: var(--control-h);
  padding-inline: var(--space-3);
  border-bottom: var(--border-width) solid var(--border-default);
  color: var(--text-body); text-decoration: none; font-size: var(--text-size-body);
}
.dk-mobile-nav__link { border-radius: var(--radius-sm); }
.dk-mobile-nav__link[aria-current="page"] { font-weight: var(--weight-bold); background: var(--navigation-active-background); color: var(--navigation-active-text); }
.dk-mobile-nav__head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  height: var(--navigation-height-mobile); padding-inline: var(--space-3);
  border-bottom: var(--border-width) solid var(--border-default);
}
.dk-mobile-nav__mark { display: block; height: 28px; width: auto; }
.dk-mobile-nav__close { font-size: 24px; line-height: 1; }
.dk-mobile-nav__links { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2); }
.dk-mobile-nav__links .dk-mobile-nav__link { border-bottom: 0; }
.dk-mobile-nav__account {
  margin-block-start: auto; display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-top: var(--border-width) solid var(--border-default);
}
.dk-mobile-nav__user { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-label); color: var(--text-secondary); }
html.dk-nav-open, html.dk-nav-open body { overflow: hidden; }

/* tabs */
.dk-tabs { border-bottom: var(--border-width) solid var(--border-default); display: flex; gap: var(--space-4); overflow-x: auto; scrollbar-width: none; }
.dk-tabs::-webkit-scrollbar { display: none; }
.dk-tab {
  flex: 0 0 auto; height: var(--control-h);
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-secondary); font-family: var(--font-fa);
  font-size: var(--text-button); font-weight: var(--weight-medium);
  cursor: pointer; margin-bottom: calc(var(--border-width) * -1);
}
.dk-tab:hover { color: var(--text-body); }
.dk-tab[aria-selected="true"] { color: var(--text-body); font-weight: var(--weight-semibold); border-bottom-color: var(--navigation-active-indicator); }
.dk-tab:focus-visible { outline: var(--focus-width) solid var(--focus-ring); outline-offset: calc(var(--focus-offset) * -1); }
.dk-tab__count { border-radius: var(--radius-xs); font-family: var(--font-en); font-size: var(--text-caption); color: var(--text-secondary); margin-inline-start: 4px; }
/* boxed / segmented variant */
.dk-tabs--boxed { border: 0; background: var(--surface-muted); padding: var(--space-1); gap: var(--space-1); }
.dk-tabs--boxed .dk-tab { height: var(--control-h-sm); padding-inline: var(--space-3); border: 0; margin: 0; }
.dk-tabs--boxed .dk-tab[aria-selected="true"] { background: var(--surface-card); color: var(--text-selected); border-radius: var(--radius-sm); }

/* breadcrumb */
.dk-breadcrumb { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--text-caption); }
.dk-breadcrumb a { color: var(--text-link); text-decoration: none; }
.dk-breadcrumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
.dk-breadcrumb__sep { color: var(--text-secondary); direction: ltr; unicode-bidi: isolate; }
.dk-breadcrumb [aria-current="page"] { color: var(--text-body); font-weight: var(--weight-semibold); }

/* pagination — square cells, radius 0 */
.dk-pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dk-pagination__cell {
  border-radius: var(--radius-sm);
  min-width: var(--control-h-sm); height: var(--control-h-sm);
  padding-inline: var(--space-2);
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0;
  box-shadow: inset 0 0 0 var(--border-width) var(--border-default);
  color: var(--text-body); font-family: var(--font-fa); font-size: var(--text-label);
  cursor: pointer;
}
.dk-pagination__cell[aria-current="page"] { background: var(--surface-brand); color: var(--text-on-brand); box-shadow: none; font-weight: var(--weight-bold); }
.dk-pagination__cell:disabled { color: var(--text-disabled); cursor: not-allowed; }
.dk-pagination__cell:focus-visible { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); }
/* Arrows are authored pointing LEFT and mirrored per writing mode: in RTL "next"
   is to the left (no flip) and "prev" to the right (flip); in LTR the reverse.
   One path, no duplicate markup. */
.dk-pagination__arrow { display: inline-flex; }
[dir="rtl"] .dk-pagination__arrow--prev,
[dir="ltr"] .dk-pagination__arrow--next { transform: scaleX(-1); }

/* stepper */
.dk-stepper { list-style: none; margin: 0; padding: 0; display: flex; }
.dk-stepper__item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.dk-stepper__rail { display: flex; align-items: center; width: 100%; }
.dk-stepper__line { flex: 1; height: var(--border-width); background: var(--border-default); }
.dk-stepper__dot {
  width: 28px; height: 28px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-card); color: var(--text-secondary);
  box-shadow: inset 0 0 0 var(--border-width) var(--border-default);
  font-family: var(--font-fa); font-size: var(--text-caption); font-weight: var(--weight-bold);
}
.dk-stepper__item--current .dk-stepper__dot,
.dk-stepper__item--complete .dk-stepper__dot { background: var(--surface-brand); color: var(--text-on-brand); box-shadow: none; }
.dk-stepper__item--error .dk-stepper__dot { background: var(--state-error); color: var(--stepper-error-text); box-shadow: none; }
.dk-stepper__label { font-size: var(--text-caption); color: var(--text-secondary); line-height: 1.5; }
@media (max-width: 600px) {
  .dk-stepper { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .dk-stepper__item { flex-direction: row; align-items: center; gap: var(--space-2); }
  .dk-stepper__rail { width: auto; }
  .dk-stepper__line { display: none; }
}

/* accordion */
.dk-accordion { border-top: var(--border-width) solid var(--border-default); }
.dk-accordion__item { border-bottom: var(--border-width) solid var(--border-default); }
.dk-accordion__head {
  width: 100%; min-height: var(--control-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding-inline: var(--space-1);
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-fa); font-size: var(--text-size-body); color: var(--text-body); text-align: start;
}
.dk-accordion__head[aria-expanded="true"] { font-weight: var(--weight-semibold); }
/* A fixed 24px square box is load-bearing: a bare text glyph has a tall, narrow
   line box (5x25), so rotating it 90deg about its centre produces a 25px-wide
   bounding box inside a 5px flex item and overhangs the row — which is then
   clipped by any clip-path ancestor (card, modal). A 24x24 icon box is
   rotation-safe in every direction. */
.dk-accordion__chev {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  line-height: 1;
  color: var(--text-secondary);
  transition: transform var(--dur-fast) var(--ease);
}
/* 90deg only, never 180 — and the direction follows the writing mode, so the
   expanded chevron always points toward the logical end. */
[dir="rtl"] .dk-accordion__head[aria-expanded="true"] .dk-accordion__chev { transform: rotate(90deg); }
[dir="ltr"] .dk-accordion__head[aria-expanded="true"] .dk-accordion__chev { transform: rotate(-90deg); }
.dk-accordion__body { padding: 0 var(--space-1) var(--space-3); font-size: var(--text-caption); line-height: 1.8; color: var(--text-secondary); }

/* ------------------------------------------------------- CHIP / BADGE --- */
.dk-chip {
  border-radius: var(--radius-xs);
  display: inline-flex; align-items: center; gap: var(--space-1);
  height: var(--chip-height); padding-inline: var(--space-2);
  background: transparent; color: var(--chip-text);
  border: var(--border-width) solid var(--chip-border);
  border-radius: var(--radius);
  font-size: var(--chip-font-size); font-weight: var(--weight-medium); line-height: 1;
}
.dk-chip--ink { background: var(--surface-inverse); color: var(--text-on-inverse); border-color: var(--surface-inverse); }
.dk-chip--brand { background: var(--surface-brand); color: var(--text-on-brand); border-color: var(--surface-brand); }
.dk-chip--outline-brand { color: var(--text-accent); border-color: var(--border-accent); }
.dk-chip--sample { background: var(--surface-muted); color: var(--text-secondary); border-color: var(--border-default); }
.dk-chip--filter { height: var(--chip-height-filter); padding-inline: var(--space-3); cursor: pointer; font-size: var(--text-label); }
.dk-chip--filter[aria-pressed="true"] { background: var(--surface-brand); color: var(--text-on-brand); border-color: var(--surface-brand); }
.dk-chip--in-card { border-radius: var(--radius-sm); }

.dk-badge {
  border-radius: var(--radius-xs);
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding-inline: 6px;
  background: var(--badge-background); color: var(--badge-text);
  font-family: var(--font-en); font-size: 11px; font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}
.dk-badge--brand { background: var(--surface-brand); color: var(--text-on-brand); }
.dk-badge--dot { width: 8px; height: 8px; min-width: 0; padding: 0; }

.dk-status { display: inline-flex; align-items: center; gap: 6px; height: var(--chip-height); padding-inline: var(--space-2); font-size: var(--chip-font-size); font-weight: var(--weight-semibold); border: var(--border-width) solid currentColor; }
.dk-status__dot { width: 8px; height: 8px; background: currentColor; flex: 0 0 auto; }
.dk-status--ok { color: var(--state-success); }
.dk-status--warn { color: var(--state-warning); }
.dk-status--err { color: var(--state-error); }
.dk-status--info { color: var(--state-info); }
.dk-status--neutral { color: var(--text-secondary); }
.dk-status--filled.dk-status--ok { background: var(--state-success); color: var(--status-filled-text); border-color: var(--state-success); }
.dk-status--filled.dk-status--warn { background: var(--state-warning); color: var(--status-filled-text); border-color: var(--state-warning); }
.dk-status--filled.dk-status--err { background: var(--state-error); color: var(--status-filled-text); border-color: var(--state-error); }
.dk-status--filled.dk-status--info { background: var(--state-info); color: var(--status-filled-text); border-color: var(--state-info); }

/* ----------------------------------------------------------------- ALERT --- */
.dk-alert {
  border-radius: var(--radius-sm);
  display: flex; gap: var(--space-2); align-items: flex-start;
  padding: var(--alert-padding);
  border: var(--alert-border-width) solid var(--border-default);
  background: var(--surface-card);
  border-radius: var(--radius);
  font-size: var(--text-size-body); line-height: 1.7;
}
.dk-alert__icon { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 9px; background: currentColor; }
.dk-alert__title { font-weight: var(--weight-bold); display: block; }
.dk-alert--info { border-color: var(--state-info); background: var(--state-info-bg); }
.dk-alert--success { border-color: var(--state-success); background: var(--state-success-bg); }
.dk-alert--warning { border-color: var(--state-warning); background: var(--state-warning-bg); }
.dk-alert--error { border-color: var(--state-error); background: var(--state-error-bg); }
.dk-alert--inline { border: 0; background: none; padding: 0; font-size: var(--text-caption); color: var(--state-error); }
.dk-alert__body { flex: 1; min-width: 0; }
.dk-alert__close { margin-inline-start: auto; background: none; border: 0; cursor: pointer; color: inherit; }

/* toast */
.dk-toast {
  border-radius: var(--radius-md);
  position: fixed; bottom: var(--space-4); inset-inline-start: var(--space-4); z-index: 80;
  max-width: 360px; display: flex; gap: var(--space-2); align-items: flex-start;
  padding: 12px var(--space-3);
  background: var(--surface-inverse); color: var(--text-on-inverse);
  font-size: var(--text-label); line-height: 1.6;
  animation: dk-toast-in var(--dur-base) var(--ease);
}
@keyframes dk-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------ TABLE / SPECS --- */
.dk-table { width: 100%; border-collapse: collapse; font-size: var(--table-font-size); line-height: var(--lh-table); }
.dk-table thead th {
  background: var(--table-header-background);
  border-bottom: var(--border-width) solid var(--table-header-rule);
  padding: var(--table-cell-padding);
  text-align: start; font-weight: var(--weight-semibold); color: var(--text-body);
}
.dk-table td, .dk-table th { padding: var(--table-cell-padding); border-bottom: var(--border-width) solid var(--table-row-border); }
.dk-table th[scope="row"] { width: 40%; color: var(--table-key-text); font-weight: var(--weight-regular); text-align: start; }
.dk-table td { font-weight: var(--weight-medium); }
.dk-table--striped tbody tr:nth-child(even) { background: var(--table-zebra); }
.dk-table--dense td, .dk-table--dense th { padding: 6px var(--space-2); font-size: var(--text-caption); }
.dk-table__group th { background: var(--surface-muted); font-weight: var(--weight-semibold); color: var(--text-body); font-size: var(--text-caption); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; }
.dk-table__unit { font-family: var(--font-en); color: var(--text-secondary); margin-inline-start: 4px; font-size: var(--text-caption); }
.dk-table__footnote { font-size: var(--text-caption); color: var(--text-secondary); padding-top: var(--space-2); }
/* cards layout — the mobile fallback. NEVER scroll a spec table sideways. */
.dk-spec-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--border-width); background: var(--border-default); border: var(--border-width) solid var(--border-default); }
.dk-spec-cards__item { background: var(--surface-card); padding: var(--space-2) var(--space-3); }
.dk-spec-cards__key { font-size: var(--text-caption); color: var(--text-secondary); display: block; }
.dk-spec-cards__val { font-size: var(--text-size-body); font-weight: var(--weight-medium); }
@media (max-width: 600px) { .dk-table th[scope="row"] { width: 50%; } }

/* ------------------------------------------------------------- PRICE --- */
.dk-price { display: flex; flex-direction: column; gap: 2px; }
.dk-price__label { font-size: var(--text-caption); color: var(--text-secondary); }
.dk-price__row { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.dk-price__figure {
  font-size: var(--price-figure-size); font-weight: var(--price-figure-weight); line-height: var(--lh-price);
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
}
.dk-price__unit { font-size: var(--price-unit-size); font-weight: var(--price-unit-weight); }
.dk-price--sm .dk-price__figure { font-size: var(--text-size-body); }
.dk-price--md .dk-price__figure { font-size: 20px; }
.dk-vehicle .dk-price--md .dk-price__figure { font-size: var(--price-figure-size); }
.dk-price--lg .dk-price__figure { font-size: var(--text-stat); }
.dk-price__was { font-size: var(--text-caption); color: var(--text-secondary); text-decoration: line-through; }
.dk-price__note { font-size: var(--text-caption); color: var(--text-secondary); }
.dk-price--panel { background: var(--surface-card); border: var(--border-width) solid var(--border-default); padding: var(--space-3); border-radius: var(--radius-md); }
.dk-price--inverse { color: var(--text-on-inverse); }
.dk-price--inverse .dk-price__label,
.dk-price--inverse .dk-price__note { color: var(--text-secondary-on-inverse); }

/* ------------------------------------------------------ VEHICLE CARD --- */
.dk-vehicle { position: relative; display: flex; flex-direction: column; background: var(--card-background); border: var(--border-width) solid var(--card-border); border-radius: var(--radius-md); transition: border-color var(--dur-fast) var(--ease); }
.dk-vehicle:hover { border-color: var(--card-border-hover); }
.dk-vehicle:focus-within { outline: var(--focus-width) solid var(--focus-ring); outline-offset: calc(var(--focus-offset) * -1); }
.dk-vehicle__body { padding: var(--card-padding); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.dk-vehicle__title { font-size: var(--card-title-size); font-weight: var(--weight-semibold); margin: 0; line-height: var(--lh-h3); }
.dk-vehicle__title a { color: inherit; text-decoration: none; }
.dk-vehicle__title a::after { content: ""; position: absolute; inset: 0; }  /* one link target per card */
.dk-vehicle__meta { font-size: var(--text-caption); color: var(--text-secondary); display: flex; gap: var(--space-2); flex-wrap: wrap; }
.dk-vehicle__chips { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.dk-vehicle__foot { margin-top: auto; padding-top: var(--space-2); display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; border-top: var(--border-width) solid var(--border-default); }
/* The price row is nowrap by specification (the currency word never separates
   from the figure), so in a narrow 4-up track the status label wraps onto its
   own line rather than the price being compressed or clipped. */
.dk-vehicle__foot > * { min-width: 0; }
/* The price row is nowrap by specification, so the in-card figure must fit the
   NARROWEST 4-up card track (163px content box at the 901px breakpoint). At the
   20px step a 10-digit figure plus the currency word needs 194px and the surplus
   is clipped by the card's clip-path. The card therefore overrides the figure
   token to the sm step — one token, so nothing else about PriceBlock changes. */
.dk-vehicle .dk-price { --price-figure-size: var(--text-size-body); }
/* 4px rather than 6px between figure and currency at the in-card size: still one
   word space at 16px, and it clears the sub-pixel rounding of a 10-digit nowrap
   row in the 163px track. */
.dk-vehicle .dk-price__row { gap: var(--space-1); }
.dk-vehicle .dk-price__figure { font-size: var(--price-figure-size); }
.dk-vehicle--row { flex-direction: row; }
.dk-vehicle--row .dk-image { width: 40%; min-height: 160px; flex: 0 0 40%; }
.dk-vehicle--sold { opacity: .9; }
@media (max-width: 600px) { .dk-vehicle--row { flex-direction: column; } .dk-vehicle--row .dk-image { width: 100%; flex: none; } }

/* ------------------------------------------------------------- OVERLAY --- */
.dk-scrim { position: fixed; inset: 0; background: var(--overlay-scrim); z-index: 50; }  /* flat — never blurred */
.dk-modal {
  position: fixed; z-index: 60; inset: 0;
  display: flex; align-items: center; justify-content: center; padding: var(--space-3);
}
.dk-modal__panel {
  position: relative; width: 100%; max-width: var(--overlay-max-width);
  max-height: calc(100vh - var(--space-5));
  display: flex; flex-direction: column;
  background: var(--overlay-background);
  border: var(--border-width) solid var(--overlay-border);
  border-radius: var(--overlay-radius);
  box-shadow: var(--overlay-shadow);
  animation: dk-modal-in var(--dur-base) var(--ease);
}
@keyframes dk-modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dk-modal--sm .dk-modal__panel { max-width: 400px; }
.dk-modal--lg .dk-modal__panel { max-width: 800px; }
.dk-modal__head { padding: var(--space-3); border-bottom: var(--border-width) solid var(--border-default); display: flex; align-items: flex-start; gap: var(--space-3); }
.dk-modal__title { font-size: var(--text-h3); font-weight: var(--weight-bold); margin: 0; }
.dk-modal__body { padding: var(--space-3); overflow: auto; flex: 1; }
.dk-modal__foot { padding: var(--space-3); border-top: var(--border-width) solid var(--border-default); display: flex; gap: var(--space-2); }
@media (max-width: 600px) {
  .dk-modal { align-items: flex-end; padding: 0; }
  .dk-modal__panel { max-width: none; max-height: 92vh; animation-name: dk-sheet-in; }
  .dk-modal__foot .dk-btn { flex: 1; }
}
@keyframes dk-sheet-in { from { transform: translateY(100%); } to { transform: none; } }

.dk-drawer { position: fixed; inset: 0; z-index: 60; }
.dk-drawer__panel {
  position: absolute; inset-block: 0; inset-inline-start: 0;
  width: min(var(--drawer-width), 88vw);
  display: flex; flex-direction: column;
  background: var(--surface-card);
  border-inline-end: var(--border-width) solid var(--border-default);
  animation: dk-slide-start var(--dur-base) var(--ease);
}
[dir="rtl"] .dk-drawer__panel { animation-name: dk-slide-start-rtl; }
.dk-drawer--end .dk-drawer__panel { inset-inline-start: auto; inset-inline-end: 0; border-inline-end: 0; border-inline-start: var(--border-width) solid var(--border-default); }
.dk-drawer--wide .dk-drawer__panel { width: min(640px, 92vw); }

/* -------------------------------------------------------------- STATES --- */
.dk-state {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding: var(--space-6) var(--space-4); text-align: center;
  background: var(--surface-card); border: var(--border-width) solid var(--border-default);
}
.dk-state__icon {
  width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-muted); color: var(--text-secondary);
  border-radius: var(--radius-full);
}
.dk-state__title { font-size: var(--text-h3); font-weight: var(--weight-bold); margin: 0; }
.dk-state__desc { font-size: var(--text-caption); line-height: var(--lh-caption); color: var(--text-secondary); margin: 0; max-width: 42ch; }
.dk-state__code { font-family: var(--font-en); font-size: var(--text-caption); color: var(--text-secondary); direction: ltr; unicode-bidi: isolate; letter-spacing: .04em; }
.dk-state--error .dk-state__icon { background: var(--state-error-bg); color: var(--state-error); }
.dk-state--success .dk-state__icon { background: var(--state-success-bg); color: var(--state-success); }

.dk-spinner { width: 24px; height: 24px; border: 2px solid var(--border-default); border-top-color: var(--surface-brand); animation: dk-spin 700ms linear infinite; }

.dk-skeleton { background: var(--surface-muted); position: relative; overflow: hidden; border-radius: var(--radius); }
.dk-skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: dk-sweep 1.2s linear infinite;
}
[dir="rtl"] .dk-skeleton::after { animation-name: dk-sweep-rtl; }
@keyframes dk-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes dk-sweep-rtl { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
.dk-skeleton--text { height: 12px; margin-bottom: var(--space-2); }
.dk-skeleton--text:last-child { width: 60%; }
.dk-skeleton--block { height: 120px; }

/* -------------------------------------------------------------- FOOTER --- */
.dk-footer { background: var(--footer-background); color: var(--footer-text); }
.dk-footer__inner { padding-block: var(--space-6) var(--space-4); display: flex; gap: var(--space-6); flex-wrap: wrap; align-items: flex-start; }
/* align-items is load-bearing: this is a flex COLUMN, so the default stretch
   would resolve the logo img's cross-axis (width) to the column width and
   override its width:auto — distorting the mark, which is forbidden. */
.dk-footer__brand { max-width: 260px; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.dk-footer__mark { height: 28px; width: auto; display: block; }
.dk-footer__cols { flex: 1; min-width: 240px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-5) var(--space-4); }
.dk-footer__heading { font-size: var(--footer-heading); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--footer-text-secondary); margin-bottom: var(--space-2); }
.dk-footer__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.dk-footer__list a { color: var(--footer-text); text-decoration: none; font-size: var(--text-label); }
.dk-footer__list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.dk-footer__legal { padding-block: var(--space-3); border-top: var(--border-width) solid var(--footer-border); display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; font-size: var(--text-caption); color: var(--footer-text-secondary); }

/* ------------------------------------------------------------ SECTIONS --- */
.dk-section { padding-block: var(--space-7); }
.dk-section--light { background: var(--surface-page); }
.dk-section--surface { background: var(--surface-card); border-block: var(--border-width) solid var(--border-default); }
.dk-section--brand { background: var(--surface-section-brand); color: var(--section-brand-text); }
.dk-section--brand-deep { background: var(--surface-section-brand-deep); color: var(--section-brand-text); }
.dk-section--inverse { background: var(--surface-inverse); color: var(--text-on-inverse); }
.dk-section--brand .dk-eyebrow,
.dk-section--brand-deep .dk-eyebrow,
.dk-section--inverse .dk-eyebrow { color: var(--text-accent-on-inverse); }
/* 45° diagonal divider retired in the cobalt identity — flat neutral field */
.dk-diagonal { position: relative; overflow: hidden; background: var(--image-frame-background); border-radius: var(--radius-md); }
.dk-diagonal__field { display: none; }
.dk-section__title { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; padding-bottom: var(--space-2); border-bottom: var(--border-width) solid var(--border-strong); margin-bottom: var(--space-4); }
@media (max-width: 600px) { .dk-section { padding-block: var(--space-6); } }

/* ------------------------------------------------------------ UTILITIES --- */
.dk-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dk-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.dk-row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.dk-cards-4up { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--grid-gutter); }
@media (max-width: 900px) { .dk-cards-4up { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .dk-cards-4up { grid-template-columns: 1fr; gap: var(--grid-gutter-mobile); } }
