/* Árak (template-parts/home/arak.php): the price stage with the slider
   through time, then the licence contents and the ways to pay. The motion
   lives in assets/js/home/prices.js; without it the stage shows today. */

/* The head: centred, like the other sections. */
.ksf-prices__head {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

/* ------------------------------------------------------------------ */
/* The stage                                                            */
/* ------------------------------------------------------------------ */

.ksf-pstage {
  margin: clamp(44px, 5.4vw, 80px) 0 0;
  border: 1px solid var(--ks-line);
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--ksf-sh-product);
}

.ksf-pstage__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: 32px clamp(32px, 5vw, 80px);
  align-items: end;
  padding: clamp(32px, 4.4vw, 64px) clamp(28px, 4.4vw, 64px) clamp(28px, 3.4vw, 48px);
}

.ksf-pstage__tag {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-height: 26px;
  margin: 0;
  color: var(--ks-teal-dark);
  font: 600 12.5px/1.3 var(--ksf-body);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ksf-pstage__now {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  color: var(--ks-teal-dark);
  background: var(--ks-mint);
  font-size: 11px;
  letter-spacing: .1em;
  transition: opacity .3s ease, transform .3s var(--ksf-ease-out);
}

.ksf-pstage__now::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ks-teal);
}

.ksf-pstage__now.is-off {
  opacity: 0;
  transform: translateX(-6px);
}

/* The price: digits in a 1.1em window; JS turns them into rolling drums. */
.ksf-pstage__amount {
  display: flex;
  align-items: flex-end;
  margin: clamp(10px, 1.4vw, 18px) 0 0;
  color: var(--ks-ink);
  font: 700 clamp(72px, 10vw, 150px)/1.1 var(--ks-display);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -.055em;
  white-space: nowrap;
}

.ksf-pstage__ft {
  margin: 0 0 .46em .3em;
  color: var(--ks-soft);
  font-size: .3em;
  line-height: 1;
  letter-spacing: -.02em;
}

.ksf-odo,
.ksf-odo__view {
  display: inline-flex;
}

.ksf-odo__d {
  display: inline-block;
  height: 1.1em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(transparent, #000 9%, #000 91%, transparent);
}

.ksf-odo__strip {
  display: flex;
  flex-direction: column;
  transform: translateY(calc(var(--n, 0) * -1.1em));
  transition: transform 1.05s cubic-bezier(.2, .85, .1, 1) calc(var(--o, 0) * 70ms);
}

.ksf-odo__strip > span {
  display: block;
  height: 1.1em;
  text-align: center;
}

.ksf-odo__sep {
  white-space: pre;
}

.ksf-pstage__when {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: 30px;
  margin: clamp(8px, 1vw, 14px) 0 0;
  color: var(--ks-ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
}

.ksf-pstage__chip {
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--ks-teal-dark);
  background: var(--ks-mint);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

/* Changing copy fades through (JS adds .is-swap for a moment). */
[data-ksf-ptag],
.ksf-pstage__when,
.ksf-pstage__save {
  transition: opacity .22s ease, transform .22s ease;
}

.ksf-pstage .is-swap {
  opacity: 0;
  transform: translateY(4px);
}

.ksf-pstage__side {
  display: grid;
  gap: 18px;
  padding-bottom: 6px;
}

.ksf-pstage__save {
  display: grid;
  gap: 2px;
  min-height: 62px;
  margin: 0;
  color: var(--ks-copy);
  font-size: 14.5px;
  line-height: 1.45;
}

.ksf-pstage__save b {
  color: var(--ks-teal-dark);
  font: 700 30px/1.15 var(--ks-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
}

.ksf-pstage__save.is-none b {
  color: var(--ks-soft);
}

.ksf .ksf-pstage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.ksf .ksf-pstage__actions .ks-btn {
  justify-content: center;
  white-space: nowrap;
}

.ksf .ksf-pstage__actions .ks-btn--primary {
  flex: 1 0 auto;
}

.ksf-pstage__meta,
.ksf-pstage__back {
  margin: 0;
  color: var(--ks-soft);
  font-size: 13.5px;
  line-height: 1.5;
}

.ksf-pstage__back[hidden] {
  display: none;
}

.ksf-pstage__back b {
  color: var(--ks-ink);
}

.ksf-pstage__back-btn {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ks-teal-dark);
  background: none;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ksf .ksf-pstage__side .ks-soon-note {
  margin: 0;
}

/* ------------------------------------------------------------------ */
/* The slider through time                                              */
/* ------------------------------------------------------------------ */

.ksf-pslider {
  padding: clamp(40px, 4vw, 52px) clamp(28px, 4.4vw, 64px) clamp(28px, 3.6vw, 48px);
  border-top: 1px solid var(--ks-line);
}

.ksf-pslider__track {
  position: relative;
  display: flex;
  height: 10px;
  touch-action: none;
}

.ksf-pslider__zone {
  min-width: 0;
  height: 100%;
  background: rgba(13, 43, 56, .07);
  transition: background-color .35s ease;
}

.ksf-pslider__zone:first-child {
  border-radius: 999px 0 0 999px;
}

.ksf-pslider__zone.is-last {
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, rgba(13, 43, 56, .07), rgba(13, 43, 56, .02));
}

.ksf-pslider__zone + .ksf-pslider__zone {
  border-left: 3px solid #fff;
}

.ksf-pslider__zone.is-on {
  background: rgba(23, 142, 139, .2);
}

/* The launch places already taken: the grey start of the first zone. */
.ksf-pslider__taken {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--today);
  border-radius: 999px 0 0 999px;
  background: repeating-linear-gradient(-45deg, rgba(13, 43, 56, .2) 0 3px, rgba(13, 43, 56, .1) 3px 6px);
}

/* From today to the knob. */
.ksf-pslider__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--today);
  width: var(--fill, 0%);
  background: linear-gradient(90deg, var(--ks-teal-bright), var(--ks-teal));
  transition: width .7s cubic-bezier(.3, .9, .2, 1);
}

.ksf-pslider__today {
  position: absolute;
  bottom: calc(100% + 24px);
  left: var(--today);
  padding: 3px 8px;
  border-radius: 6px;
  color: #fff;
  background: var(--ks-ink);
  font: 700 11px/1.2 var(--ksf-body);
  letter-spacing: .12em;
  text-transform: uppercase;
  transform: translateX(-50%);
  pointer-events: none;
}

.ksf-pslider__today::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  border: 4px solid transparent;
  border-top-color: var(--ks-ink);
  transform: translateX(-50%);
}

.ksf-pslider__knob {
  position: absolute;
  top: 50%;
  left: var(--pos, var(--today));
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 1px solid rgba(23, 142, 139, .35);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(13, 43, 56, .08), 0 10px 24px -10px rgba(13, 43, 56, .35);
  transition: left .7s cubic-bezier(.3, .9, .2, 1), transform .25s var(--ksf-ease-out), box-shadow .25s ease;
}

.ksf-pslider.is-live .ksf-pslider__knob {
  cursor: grab;
}

.ksf-pslider.is-live .ksf-pslider__track {
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .ksf-pslider.is-live .ksf-pslider__knob:hover {
    transform: scale(1.06);
  }
}

.ksf-pslider.is-dragging .ksf-pslider__knob {
  cursor: grabbing;
  transform: scale(1.1);
  box-shadow: 0 1px 2px rgba(13, 43, 56, .08), 0 16px 32px -12px rgba(13, 43, 56, .45);
}

/* While dragging the knob and the fill follow the pointer directly. */
.ksf-pslider.is-dragging .ksf-pslider__knob {
  transition: transform .25s var(--ksf-ease-out), box-shadow .25s ease;
}

.ksf-pslider.is-dragging .ksf-pslider__fill {
  transition: none;
}

.ksf .ksf-pslider__knob:focus-visible {
  outline: 3px solid rgba(23, 142, 139, .4);
  outline-offset: 3px;
}

.ksf-pslider__mark {
  position: relative;
  width: 19px;
  aspect-ratio: 846 / 832;
}

.ksf-pslider .ksf-pslider__half {
  position: absolute;
  top: 0;
  width: auto;
  max-width: none;
  height: 100%;
  transition: transform .3s var(--ksf-ease-out);
}

.ksf-pslider__half--l {
  left: 0;
}

.ksf-pslider__half--r {
  right: 0;
}

/* While dragging the clasp opens a little. */
.ksf-pslider.is-dragging .ksf-pslider__half--l {
  transform: translateX(-12%);
}

.ksf-pslider.is-dragging .ksf-pslider__half--r {
  transform: translateX(12%);
}

/* The steps under the track: always readable, the selected one in ink. */
.ksf-pslider__stops {
  display: grid;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.ksf-pslider__stop {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0 16px 0 0;
}

.ksf-pslider.is-live .ksf-pslider__stop {
  cursor: pointer;
}

.ksf-pslider__stop-tag {
  color: var(--ks-soft);
  font: 600 11.5px/1.3 var(--ksf-body);
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: color .3s ease;
}

.ksf-pslider__stop-price {
  color: rgba(13, 43, 56, .45);
  font: 700 clamp(20px, 2vw, 26px)/1.2 var(--ks-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  white-space: nowrap;
  transition: color .3s ease;
}

.ksf-pslider__stop-when {
  color: var(--ks-soft);
  font-size: 14px;
  line-height: 1.45;
}

.ksf-pslider__stop.is-on .ksf-pslider__stop-tag {
  color: var(--ks-teal-dark);
}

.ksf-pslider__stop.is-on .ksf-pslider__stop-price {
  color: var(--ks-ink);
}

@media (hover: hover) and (pointer: fine) {
  .ksf-pslider.is-live .ksf-pslider__stop:not(.is-on):hover .ksf-pslider__stop-price {
    color: rgba(13, 43, 56, .7);
  }
}

/* ------------------------------------------------------------------ */
/* The licence contents and the ways to pay                             */
/* ------------------------------------------------------------------ */

.ksf-lic {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 32px clamp(32px, 5vw, 80px);
  margin: clamp(28px, 3vw, 40px) 0 0;
  padding: clamp(28px, 3.4vw, 48px) clamp(28px, 4.4vw, 64px);
  border-radius: 28px;
  background: var(--ks-mist);
}

.ksf .ksf-lic__name {
  margin: 0 0 20px;
  color: var(--ks-ink);
  font: 700 19px/1.3 var(--ks-display);
  letter-spacing: -.015em;
}

.ksf .ksf-lic__ticks {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}

.ksf .ksf-lic__ticks > li {
  font-size: 15px;
}

.ksf-pay {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ksf-pay__item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0;
}

.ksf-pay__item svg {
  flex: none;
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 11px;
  color: var(--ks-teal-dark);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--ks-line);
}

.ksf-pay__item p {
  margin: 0;
  color: var(--ks-copy);
  font-size: 14.5px;
  line-height: 1.5;
}

.ksf-pay__item strong {
  display: block;
  color: var(--ks-ink);
  font: 600 15px/1.35 var(--ksf-body);
}

.ksf-pay__item span {
  display: block;
}

/* ------------------------------------------------------------------ */
/* Narrower screens                                                     */
/* ------------------------------------------------------------------ */

@media (max-width: 1080px) {
  .ksf-pstage__top {
    grid-template-columns: minmax(0, 1fr);
  }

  .ksf-pstage__side {
    max-width: 520px;
  }

  .ksf-lic {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .ksf-pstage {
    border-radius: 22px;
  }

  .ksf-pstage__amount {
    font-size: clamp(60px, 18vw, 96px);
  }

  .ksf-pstage__when {
    font-size: 15.5px;
  }

  /* The steps become rows: name and condition left, price right. */
  .ksf-pslider__stops {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 4px;
    margin-top: 20px;
  }

  .ksf-pslider__stop {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 12px;
    padding: 10px 12px;
    border-radius: 12px;
    transition: background-color .3s ease;
  }

  .ksf-pslider__stop.is-on {
    background: var(--ks-mint);
  }

  .ksf-pslider__stop-tag {
    grid-column: 1;
  }

  .ksf-pslider__stop-when {
    grid-column: 1;
    font-size: 13.5px;
  }

  .ksf-pslider__stop-price {
    grid-row: 1 / span 2;
    grid-column: 2;
    font-size: 20px;
  }

  .ksf .ksf-lic__ticks {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .ksf .ksf-pstage__actions .ks-btn {
    flex: 1 0 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ksf-odo__strip,
  .ksf-pslider__knob,
  .ksf-pslider__fill,
  .ksf-pslider__half,
  .ksf-pstage__now,
  [data-ksf-ptag],
  .ksf-pstage__when,
  .ksf-pstage__save {
    transition: none;
  }
}
