/**
 * @prop --mds-price-table-features-border-color: Sets the border-color of the header and of the children cells, unless a cell sets its own `--mds-price-table-features-cell-border-color`
 * @prop --mds-price-table-features-padding: Public. Sets the cell padding of the children components
 */

:host {
  --mds-price-table-features-border-color: rgb(var(--magma-border-muted, var(--border-neutral-muted, 206 206 206)));
  --mds-price-table-features-padding: --spacing(300);
  --mds-price-table-features-transition-duration: var(--duration-200, 200ms);
  --private-price-table-features-transition-duration: var(--mds-price-table-features-transition-duration);

  @apply ease-in-out;

  display: flex;
  transition-duration: var(--private-price-table-features-transition-duration);
  transition-property: border-color;
  width: 100%;
}

.table-wrapper {
  scroll-margin-inline: --spacing(600);
  width: 100%;
}

table {
  border-collapse: collapse;
  min-width: 100%;
  table-layout: fixed;
}

header {
  border-bottom: 1px solid var(--mds-price-table-features-border-color);
  padding: var(--mds-price-table-features-padding) var(--mds-price-table-features-padding)
    var(--mds-price-table-features-padding) 0;
}

/* Motion, held back.
 *
 * Every component zeroes the private durations its own base CSS reads, which composes
 * with the public knobs - but that only reaches the declarations that read them. An audit
 * of the 52 sheets found 21 transitions in 15 components that did not: the host's own
 * transition in mds-button and mds-table, the focus ring of the input family, the tab
 * slider, the close button of mds-note. This reset reaches the whole shadow tree, which is
 * what the preference promises, and keeps reaching it when a declaration is added.
 *
 * Transitions only, on purpose. A keyframe animation is usually a loader, and a loader has
 * to keep saying "working": mds-spinner slows to 8s under reduced motion instead of
 * freezing, and a duration of nearly zero on an infinite animation would spin it out of
 * control instead of stopping it.
 *
 * 0.01ms rather than 0s, so a component that waits for its own transitionend still gets
 * one: mds-modal, mds-push-notification and mds-tree-item all listen for it, and a
 * transition of zero never fires it. */

/* stylelint-disable time-min-milliseconds -- the floor is there to keep a transition
   perceivable; the point of these two is that it is not. */

:host([pref-animation='reduce']),
:host([pref-animation='reduce']) *,
:host([pref-animation='reduce']) *::before,
:host([pref-animation='reduce']) *::after {
  transition-duration: 0.01ms !important;
}

@media (prefers-reduced-motion: reduce) {
  :host([pref-animation='system']),
  :host([pref-animation='system']) *,
  :host([pref-animation='system']) *::before,
  :host([pref-animation='system']) *::after,
  :host(:not([pref-animation])),
  :host(:not([pref-animation])) *,
  :host(:not([pref-animation])) *::before,
  :host(:not([pref-animation])) *::after {
    transition-duration: 0.01ms !important;
  }
}

/* stylelint-enable time-min-milliseconds */


/* Animation preference. The component mirrors the resolved mode from <html>
 * onto its host as pref-animation (see subscribePreference in @common/preference);
 * these plain shadow selectors then zero the private duration(s) the base CSS
 * reads. `reduce` always stops; `system` and no controller follow the OS via
 * @media; `no-preference` keeps the base value. Customization composes (the base
 * sets --private from the public token, this only overrides it when reduced). */

:host([pref-animation='reduce']) {
  --private-price-table-features-transition-duration: 0s;
}

@media (prefers-reduced-motion: reduce) {
  :host([pref-animation='system']),
  :host(:not([pref-animation])) {
    --private-price-table-features-transition-duration: 0s;
  }
}

/* Theme preference. The component takes its colours from semantic roles that
 * flip per mode at :root (spec 6.1-6.3) and inherit into the shadow DOM, so it
 * needs no per-mode dark refinement. The former dark override (a ramp step
 * re-set to lift the colour off the old flat-black canvas) is intentionally gone. */

/* Contrast preference. The component takes its colours from semantic roles that
 * the contrast layer promotes under pref-contrast-more (spec 9.3), so it needs no
 * per-component high-contrast refinement. The former override (a ramp step re-set
 * by hand) is intentionally gone. */

:host(:not(:is([hydrated], .hydrated))) {
  @apply not-hydrated;
}


mds-text {
  &:not(:is([hydrated], .hydrated)) {
    @apply not-hydrated;
  }
}

