/**
 * LOADRYX Design System — Components
 *
 * Specificity contract: every component is a single class with modifiers.
 * No element selectors, no nesting deeper than one level, no `!important`.
 * This is what stops `.lx-section` and `.lx-card` fighting over padding.
 */

/* =====================================================================
   BUTTON
   44px minimum in every variant — the audit found 60 tap targets under
   that on production, mostly nav links at 25px tall.
   ===================================================================== */

.lx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--lx-space-2);
  min-height: var(--lx-tap-min);
  padding: var(--lx-space-3) var(--lx-space-5);
  border: 1px solid transparent;
  border-radius: var(--lx-radius-md);
  font-family: var(--lx-font-display);
  font-size: var(--lx-fs-sm);
  font-weight: var(--lx-fw-bold);
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--lx-dur) var(--lx-ease),
    border-color var(--lx-dur) var(--lx-ease), color var(--lx-dur) var(--lx-ease);
}

/* The ramp is the brand gesture: one gradient, used only on the primary
   action and on the wordmark. Everywhere else the accent is a flat tint. */
.lx-btn--primary {
  background-image: var(--lx-ramp);
  border-color: transparent;
  color: var(--lx-on-accent);
}
.lx-btn--primary:hover {
  filter: brightness(1.08);
}
.lx-btn--primary:active {
  filter: brightness(0.94);
}

.lx-btn--secondary {
  background-color: transparent;
  border-color: var(--lx-line);
  color: var(--lx-fg);
}
.lx-btn--secondary:hover {
  background-color: var(--lx-ink-200);
  border-color: var(--lx-fg-dim);
}

.lx-btn--ghost {
  background-color: transparent;
  color: var(--lx-fg-mid);
}
.lx-btn--ghost:hover {
  background-color: var(--lx-ink-200);
  color: var(--lx-fg);
}

.lx-btn--block {
  width: 100%;
}

.lx-btn--sm {
  min-height: 36px;
  padding: var(--lx-space-2) var(--lx-space-4);
  font-size: var(--lx-fs-xs);
}

.lx-btn[disabled],
.lx-btn--disabled {
  background-color: var(--lx-ink-200);
  border-color: var(--lx-line-soft);
  color: var(--lx-fg-dim);
  cursor: not-allowed;
}

/* Icon-only button still honours the tap floor. */
.lx-btn--icon {
  min-width: var(--lx-tap-min);
  padding: var(--lx-space-2);
}

/* =====================================================================
   BADGE
   ===================================================================== */

.lx-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--lx-space-1);
  padding: var(--lx-space-1) var(--lx-space-2);
  border: 1px solid;
  border-radius: var(--lx-radius-pill);
  font-size: var(--lx-fs-xs);
  font-weight: var(--lx-fw-semibold);
  line-height: 1.4;
  white-space: nowrap;
}

.lx-badge--accent {
  background-image: var(--lx-ramp);
  border-color: transparent;
  color: var(--lx-on-accent);
}
.lx-badge--ok {
  background-color: var(--lx-ok-soft);
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--lx-ok-fg);
}
.lx-badge--warn {
  background-color: var(--lx-warn-soft);
  border-color: rgba(251, 191, 36, 0.35);
  color: var(--lx-warn-fg);
}
.lx-badge--crit {
  background-color: var(--lx-crit-soft);
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--lx-crit-fg);
}
.lx-badge--neutral {
  background-color: var(--lx-ink-200);
  border-color: var(--lx-line);
  color: var(--lx-fg-mid);
}

/* Numeric badge (discount, count) uses the mono face. */
.lx-badge--num {
  font-family: var(--lx-font-display);
  font-weight: var(--lx-fw-bold);
  font-size: var(--lx-fs-2xs);
  letter-spacing: 0.02em;
  direction: ltr;
  unicode-bidi: isolate;
}

/* =====================================================================
   ALERT
   ===================================================================== */

.lx-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--lx-space-3);
  padding: var(--lx-space-3) var(--lx-space-4);
  border: 1px solid;
  border-radius: var(--lx-radius-md);
  font-size: var(--lx-fs-sm);
  line-height: var(--lx-lh-snug);
}

.lx-alert__mark {
  flex-shrink: 0;
  margin-block-start: 2px;
  font-family: var(--lx-font-mono);
  font-size: var(--lx-fs-2xs);
  letter-spacing: 0.1em;
  opacity: 0.85;
  direction: ltr;
  unicode-bidi: isolate;
}

.lx-alert--ok {
  background-color: var(--lx-ok-soft);
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--lx-ok-fg);
}
.lx-alert--warn {
  background-color: var(--lx-warn-soft);
  border-color: rgba(251, 191, 36, 0.35);
  color: var(--lx-warn-fg);
}
.lx-alert--crit {
  background-color: var(--lx-crit-soft);
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--lx-crit-fg);
}
.lx-alert--info {
  background-color: var(--lx-info-soft);
  border-color: rgba(96, 165, 250, 0.35);
  color: var(--lx-info-fg);
}

/* =====================================================================
   FORM FIELD
   Label is never optional. Placeholder is never the label.
   ===================================================================== */

.lx-field {
  display: flex;
  flex-direction: column;
  gap: var(--lx-space-2);
}

.lx-field__label {
  font-size: var(--lx-fs-xs);
  font-weight: var(--lx-fw-medium);
  color: var(--lx-fg-mid);
}

.lx-field__req {
  color: var(--lx-crit-fg);
}

.lx-field__control {
  width: 100%;
  min-height: var(--lx-tap-min);
  padding: var(--lx-space-3);
  background-color: var(--lx-ink-100);
  border: 1px solid var(--lx-line);
  border-radius: var(--lx-radius-md);
  color: var(--lx-fg);
  font-size: var(--lx-fs-sm);
  transition: border-color var(--lx-dur) var(--lx-ease);
}

.lx-field__control::placeholder {
  color: var(--lx-fg-dim);
}

.lx-field__control:hover {
  border-color: var(--lx-fg-dim);
}

.lx-field__control:focus-visible {
  border-color: var(--lx-accent);
  outline: var(--lx-focus-ring);
  outline-offset: 1px;
}

.lx-field__hint {
  font-size: var(--lx-fs-xs);
  color: var(--lx-fg-dim);
}

.lx-field--invalid .lx-field__control {
  border-color: var(--lx-crit);
}
.lx-field--invalid .lx-field__hint {
  color: var(--lx-crit-fg);
}

textarea.lx-field__control {
  min-height: 120px;
  resize: vertical;
}

/* Native select arrow sits on the inline-end side in both directions. */
select.lx-field__control {
  appearance: none;
  padding-inline-end: var(--lx-space-6);
  background-image: linear-gradient(45deg, transparent 50%, var(--lx-fg-dim) 50%),
    linear-gradient(135deg, var(--lx-fg-dim) 50%, transparent 50%);
  background-position: calc(var(--lx-space-4) - 2px) calc(50% + 1px),
    calc(var(--lx-space-4) + 3px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* Checkbox / radio row — the whole row is the target, not the 16px box. */
.lx-check {
  display: flex;
  align-items: center;
  gap: var(--lx-space-3);
  min-height: var(--lx-tap-min);
  padding-inline: var(--lx-space-2);
  border-radius: var(--lx-radius-sm);
  cursor: pointer;
  transition: background-color var(--lx-dur-fast) var(--lx-ease);
}
.lx-check:hover {
  background-color: var(--lx-ink-200);
}
.lx-check__input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--lx-accent);
  cursor: pointer;
}
.lx-check__text {
  font-size: var(--lx-fs-sm);
  color: var(--lx-fg-mid);
}
.lx-check__count {
  margin-inline-start: auto;
  font-family: var(--lx-font-mono);
  font-size: var(--lx-fs-2xs);
  color: var(--lx-fg-dim);
  direction: ltr;
  unicode-bidi: isolate;
}

/* =====================================================================
   CARD — generic surface. Not everything is a card; this is for things
   that genuinely are separate objects.
   ===================================================================== */

.lx-card {
  background-color: var(--lx-ink-100);
  border: 1px solid var(--lx-line);
  border-radius: var(--lx-radius-lg);
  overflow: hidden;
}

/* =====================================================================
   PRODUCT CARD
   One component for every category. It knows nothing about any specific
   product — everything is passed in.
   ===================================================================== */

.lx-pcard {
  display: flex;
  flex-direction: column;
  background-color: var(--lx-ink-100);
  border: 1px solid var(--lx-line);
  border-radius: var(--lx-radius-lg);
  overflow: hidden;
  transition: border-color var(--lx-dur) var(--lx-ease),
    transform var(--lx-dur) var(--lx-ease);
}

.lx-pcard:hover {
  border-color: var(--lx-accent-line);
  box-shadow: var(--lx-glow-violet);
  transform: translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {
  .lx-pcard:hover {
    transform: none;
  }
}

/* Fixed ratio box: the image cannot shift the layout while loading. */
.lx-pcard__media {
  position: relative;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  background-image: linear-gradient(158deg, var(--lx-ink-300), var(--lx-ink-050));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Branded stand-in for a product with no photograph yet: a drawn mark on
   the card's own gradient, so the grid never shows an empty grey box. */
.lx-pcard__fallback {
  width: 46%;
  max-width: 150px;
  opacity: 0.55;
}

.lx-pcard__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lx-pcard__flags {
  position: absolute;
  inset-block-start: var(--lx-space-2);
  inset-inline-start: var(--lx-space-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--lx-space-1);
}

.lx-pcard__body {
  display: flex;
  flex-direction: column;
  gap: var(--lx-space-2);
  padding: var(--lx-space-3) var(--lx-space-4) var(--lx-space-4);
  flex: 1;
}

.lx-pcard__eyebrow {
  font-family: var(--lx-font-display);
  font-size: var(--lx-fs-2xs);
  letter-spacing: var(--lx-tracking-label);
  text-transform: uppercase;
  color: var(--lx-fg-dim);
  direction: ltr;
  unicode-bidi: isolate;
}

.lx-pcard__title {
  font-size: var(--lx-fs-sm);
  font-weight: var(--lx-fw-semibold);
  line-height: 1.45;
}

/* The whole card is clickable, but only the title is the accessible link. */
.lx-pcard__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.lx-pcard {
  position: relative;
}

.lx-pcard__excerpt {
  flex: 1;
  font-size: var(--lx-fs-xs);
  line-height: var(--lx-lh-snug);
  color: var(--lx-fg-dim);
  margin: 0;
}

.lx-pcard__price {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: var(--lx-space-2);
  font-family: var(--lx-font-display);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

.lx-pcard__price-now {
  font-size: 1.375rem;
  font-weight: var(--lx-fw-bold);
  color: var(--lx-fg);
}

.lx-pcard__price-was {
  font-size: var(--lx-fs-xs);
  color: var(--lx-fg-dim);
  text-decoration: line-through;
}

/* The CTA sits above the card-wide link overlay. */
.lx-pcard__cta {
  position: relative;
  z-index: var(--lx-z-base);
}

/* Product grid: a column count the items actually fill. */
.lx-pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--lx-space-4);
}

@media (min-width: 1024px) {
  .lx-pgrid {
    gap: var(--lx-space-5);
  }
}

/* =====================================================================
   CATEGORY TILE
   ===================================================================== */

.lx-cat {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 180px;
  padding: var(--lx-space-5);
  background-image: linear-gradient(150deg, var(--lx-ink-300), var(--lx-ink-050));
  border: 1px solid var(--lx-line);
  border-radius: var(--lx-radius-lg);
  overflow: hidden;
  transition: border-color var(--lx-dur) var(--lx-ease),
    transform var(--lx-dur) var(--lx-ease);
}

/* One bloom per tile, rotating hue by position so a row reads as a set. */
.lx-cat::before {
  content: "";
  position: absolute;
  inset-block-start: -30%;
  inset-inline-end: -14%;
  width: 210px;
  height: 210px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.38), transparent 66%);
  pointer-events: none;
}

.lx-cat:nth-child(3n + 2)::before {
  background: radial-gradient(circle, rgba(34, 211, 238, 0.30), transparent 66%);
}

.lx-cat:nth-child(3n + 3)::before {
  background: radial-gradient(circle, rgba(217, 70, 239, 0.26), transparent 66%);
}

.lx-cat:hover {
  border-color: var(--lx-accent-line);
  transform: translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {
  .lx-cat:hover { transform: none; }
}

.lx-cat__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.lx-cat__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

.lx-cat__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--lx-ink-000) 10%, transparent 85%);
}

.lx-cat__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--lx-space-1);
}

.lx-cat__name {
  font-family: var(--lx-font-display);
  font-size: 1.375rem;
  font-weight: var(--lx-fw-bold);
}

.lx-cat__count {
  font-family: var(--lx-font-display);
  font-size: var(--lx-fs-2xs);
  color: var(--lx-fg-dim);
  direction: ltr;
  unicode-bidi: isolate;
}

.lx-catgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--lx-space-4);
}

/* =====================================================================
   BREADCRUMB
   ===================================================================== */

.lx-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lx-space-2);
  padding-block: var(--lx-space-4);
  font-size: var(--lx-fs-xs);
  color: var(--lx-fg-dim);
}

.lx-crumbs__sep {
  opacity: 0.5;
}

.lx-crumbs a {
  color: var(--lx-fg-mid);
}
.lx-crumbs a:hover {
  color: var(--lx-accent);
}

.lx-crumbs [aria-current="page"] {
  color: var(--lx-fg);
}

/* =====================================================================
   ACCORDION (FAQ)
   Built on <details> so it works with zero JavaScript.
   ===================================================================== */

.lx-acc {
  border: 1px solid var(--lx-line);
  border-radius: var(--lx-radius-md);
  background-color: var(--lx-ink-050);
  overflow: hidden;
}

.lx-acc + .lx-acc {
  margin-block-start: var(--lx-space-2);
}

.lx-acc__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lx-space-4);
  min-height: var(--lx-tap-min);
  padding: var(--lx-space-3) var(--lx-space-4);
  font-size: var(--lx-fs-sm);
  font-weight: var(--lx-fw-semibold);
  cursor: pointer;
  list-style: none;
}

.lx-acc__summary::-webkit-details-marker {
  display: none;
}

.lx-acc__summary:hover {
  background-color: var(--lx-ink-200);
}

.lx-acc__chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-inline-end: 2px solid var(--lx-fg-dim);
  border-block-end: 2px solid var(--lx-fg-dim);
  transform: rotate(45deg);
  transition: transform var(--lx-dur) var(--lx-ease);
}

.lx-acc[open] .lx-acc__chevron {
  transform: rotate(225deg);
}

.lx-acc__panel {
  padding: 0 var(--lx-space-4) var(--lx-space-4);
  font-size: var(--lx-fs-sm);
  color: var(--lx-fg-mid);
  line-height: var(--lx-lh-snug);
}

/* =====================================================================
   SPEC LIST — label / value pairs, aligned down the column.
   ===================================================================== */

.lx-specs {
  display: grid;
  gap: 0;
  border: 1px solid var(--lx-line);
  border-radius: var(--lx-radius-md);
  overflow: hidden;
}

.lx-specs__row {
  display: grid;
  grid-template-columns: minmax(110px, 34%) 1fr;
  gap: var(--lx-space-4);
  padding: var(--lx-space-3) var(--lx-space-4);
  border-block-end: 1px solid var(--lx-line-soft);
  font-size: var(--lx-fs-sm);
}

.lx-specs__row:last-child {
  border-block-end: none;
}

.lx-specs__row:nth-child(odd) {
  background-color: var(--lx-ink-050);
}

.lx-specs__k {
  color: var(--lx-fg-dim);
}

.lx-specs__v {
  color: var(--lx-fg);
}

/* =====================================================================
   PAGINATION
   ===================================================================== */

.lx-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--lx-space-2);
  margin-block-start: var(--lx-space-6);
}

.lx-pager__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--lx-tap-min);
  min-height: var(--lx-tap-min);
  padding-inline: var(--lx-space-3);
  border: 1px solid var(--lx-line);
  border-radius: var(--lx-radius-md);
  font-family: var(--lx-font-mono);
  font-size: var(--lx-fs-xs);
  color: var(--lx-fg-mid);
  transition: border-color var(--lx-dur) var(--lx-ease), color var(--lx-dur) var(--lx-ease);
}

.lx-pager__item:hover {
  border-color: var(--lx-fg-dim);
  color: var(--lx-fg);
}

.lx-pager__item[aria-current="page"] {
  background-color: var(--lx-accent);
  border-color: var(--lx-accent);
  color: var(--lx-on-accent);
}

/* =====================================================================
   EMPTY STATE
   ===================================================================== */

.lx-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--lx-space-3);
  padding: var(--lx-space-8) var(--lx-space-4);
  text-align: center;
  border: 1px dashed var(--lx-line);
  border-radius: var(--lx-radius-lg);
  background-color: var(--lx-ink-050);
}

.lx-empty__title {
  font-size: var(--lx-fs-lg);
  font-weight: var(--lx-fw-semibold);
}

.lx-empty__text {
  color: var(--lx-fg-mid);
  font-size: var(--lx-fs-sm);
  max-width: 44ch;
}

/* =====================================================================
   PLACEHOLDER BLOCK
   Marks a section deliberately left unbuilt. Visible, labelled, and
   impossible to mistake for finished work.
   ===================================================================== */

.lx-placeholder {
  display: flex;
  flex-direction: column;
  gap: var(--lx-space-2);
  padding: var(--lx-space-5);
  border: 1px dashed var(--lx-line);
  border-radius: var(--lx-radius-lg);
  background-color: var(--lx-ink-050);
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0 12px,
    rgba(255, 255, 255, 0.012) 12px 24px
  );
}

.lx-placeholder__tag {
  align-self: flex-start;
  font-family: var(--lx-font-mono);
  font-size: var(--lx-fs-2xs);
  letter-spacing: var(--lx-tracking-label);
  text-transform: uppercase;
  color: var(--lx-fg-dim);
  border: 1px solid var(--lx-line);
  border-radius: var(--lx-radius-sm);
  padding: var(--lx-space-1) var(--lx-space-2);
  direction: ltr;
  unicode-bidi: isolate;
}

.lx-placeholder__text {
  font-size: var(--lx-fs-sm);
  color: var(--lx-fg-mid);
}

/* =====================================================================
   MODAL / DRAWER
   ===================================================================== */

.lx-modal {
  border: 1px solid var(--lx-line);
  border-radius: var(--lx-radius-lg);
  background-color: var(--lx-ink-100);
  color: var(--lx-fg);
  padding: 0;
  max-width: min(520px, calc(100vw - var(--lx-space-6)));
  width: 100%;
  box-shadow: var(--lx-shadow-overlay);
}

.lx-modal::backdrop {
  background-color: rgba(4, 4, 10, 0.74);
}

.lx-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lx-space-4);
  padding: var(--lx-space-4);
  border-block-end: 1px solid var(--lx-line-soft);
}

.lx-modal__title {
  font-size: var(--lx-fs-lg);
  font-weight: var(--lx-fw-semibold);
}

.lx-modal__body {
  padding: var(--lx-space-4);
}

.lx-modal__foot {
  display: flex;
  justify-content: flex-start;
  gap: var(--lx-space-2);
  padding: var(--lx-space-4);
  border-block-start: 1px solid var(--lx-line-soft);
}

/* Slide-in drawer, used for mobile filters and the mobile menu. */
.lx-drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: var(--lx-z-drawer);
  width: min(360px, 88vw);
  display: flex;
  flex-direction: column;
  background-color: var(--lx-ink-050);
  border-inline-start: 1px solid var(--lx-line);
  transform: translateX(100%);
  transition: transform var(--lx-dur-slow) var(--lx-ease);
}

/* In RTL the drawer enters from the opposite side. */
[dir="rtl"] .lx-drawer {
  transform: translateX(-100%);
}

.lx-drawer[data-open="true"] {
  transform: translateX(0);
}

.lx-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lx-space-4);
  padding: var(--lx-space-4);
  border-block-end: 1px solid var(--lx-line-soft);
}

.lx-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--lx-space-4);
}

.lx-scrim {
  position: fixed;
  inset: 0;
  z-index: calc(var(--lx-z-drawer) - 1);
  background-color: rgba(4, 4, 10, 0.62);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--lx-dur-slow) var(--lx-ease), visibility var(--lx-dur-slow);
}

.lx-scrim[data-open="true"] {
  opacity: 1;
  visibility: visible;
}
