/* Black Friday floating bar - Training Station. Design: floting bar/ts/style.css (image paths are relative to this file). */

/*
 * Everything on desktop is sized in "design units" (--u) taken from the
 * 1440 x 135 artboard, so the bar scales as one piece and never reflows.
 * 1u = 1px at 1440px wide and above, and shrinks proportionally below that.
 */
.ts-bar {
  --bfbar-accent: #ffc223;
  --u: min(1px, calc(100vw / 1440));
  --gold: #ffc223;
  --red-line: #b61c1c;

  position: relative;
  overflow: hidden;
  width: 100%;
  height: calc(135 * var(--u));
  display: flex;
  background: #2a2a2a url("ts-bg.webp") center / cover no-repeat;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.ts-bar:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}

/* ===== Absolute decorations ===== */
.ts-bar__deco {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

/* Left: BLACK FRIDAY between two balloon + gift bunches (one image) */
.ts-bar__deco--left {
  left: calc(-42.3 * var(--u));
  top: calc(-12.7 * var(--u));
  width: calc(450 * var(--u));
  height: auto;
}

/* Right: balloons + gifts */
.ts-bar__deco--right {
  left: auto;
  right: calc(-50 * var(--u));
  top: calc(-17 * var(--u));
  width: calc(278 * var(--u));
  height: auto;
}

/* ===== Content ===== */
.ts-bar__inner {
  position: relative;
  z-index: 1;
  width: calc(1440 * var(--u));
  margin: 0 auto;
  padding-left: calc(360 * var(--u));
  display: flex;
  align-items: center;
}

.ts-bar__megasale {
  display: block;
  width: calc(172 * var(--u));
  height: auto;
  flex-shrink: 0;
  margin-right: calc(-2 * var(--u));
}

.ts-bar__text {
  font-family: "Myriad Pro", "Source Sans 3", sans-serif;
  font-weight: 600;
  font-size: calc(23.7 * var(--u));
  line-height: 1;
  color: #e8e0e0;
  white-space: nowrap;
}

/* Full-height red gradient band behind the price */
.ts-bar__panel {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(274 * var(--u));
  margin-left: calc(15 * var(--u));
  flex-shrink: 0;
  background: linear-gradient(180deg,
    rgba(139, 0, 0, 0.55) 0%,
    rgba(246, 3, 3, 0.4) 50%,
    rgba(139, 0, 0, 0.55) 100%);
}

.ts-bar__pricebox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(215.5 * var(--u));
  height: calc(109.2 * var(--u));
  background: #000;
  border: max(1px, calc(1.5 * var(--u))) solid var(--red-line);
  border-radius: calc(12 * var(--u));
}

.ts-bar__price {
  font-family: "Gotham", "Montserrat", sans-serif;
  font-weight: 700;
  font-size: calc(53.4 * var(--u));
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--gold);
  -webkit-text-stroke: max(1px, calc(1.2 * var(--u))) #000;
  paint-order: stroke fill;
  text-shadow:
    calc(-1 * var(--u)) calc(-1 * var(--u)) 0 rgba(255, 255, 255, 0.85),
    calc(1.5 * var(--u)) calc(1.5 * var(--u)) 0 #000;
  white-space: nowrap;
}

.ts-bar__timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(187 * var(--u));
  margin-left: calc(16 * var(--u));
  line-height: 1;
  white-space: nowrap;
  font-family: "Intro Rust", "Montserrat", sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 calc(1 * var(--u)) calc(2 * var(--u)) rgba(0, 0, 0, 0.5);
}

.ts-bar__label {
  font-size: calc(17.7 * var(--u));
  letter-spacing: 0.02em;
}

.ts-bar__clock {
  margin-top: calc(8 * var(--u));
  font-size: calc(38.6 * var(--u));
  /* equal-width digits so the clock doesn't jiggle every second */
  font-variant-numeric: tabular-nums;
}

/* ===== Tablet: drop "Mega Sale", tighten spacing, scale up a little ===== */
@media (max-width: 991px) {
  .ts-bar {
    --u: calc(100vw / 1200);
  }

  .ts-bar__inner {
    width: 100%;
    padding-left: calc(372 * var(--u));
  }

  .ts-bar__megasale {
    display: none;
  }

  .ts-bar__text {
    font-size: calc(27 * var(--u));
  }

  .ts-bar__panel {
    width: calc(250 * var(--u));
  }

  /* push the right art out a little so it doesn't crowd the timer */
  .ts-bar__deco--right {
    right: calc(-90 * var(--u));
  }
}

/* ===== Mobile: offer on top, timer below ===== */
@media (max-width: 767px) {
  .ts-bar {
    height: auto;
    min-height: 116px;
  }

  .ts-bar__deco--left {
    display: none;
  }

  .ts-bar__deco--right {
    top: auto;
    bottom: -24px;
    right: -40px;
    width: 140px;
    opacity: 0.9;
  }

  .ts-bar__inner {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px 12px;
  }

  /* offer row: text + price box */
  .ts-bar__inner {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: center;
    column-gap: 12px;
    row-gap: 8px;
  }

  .ts-bar__text {
    font-size: 19px;
  }

  .ts-bar__panel {
    align-self: center;
    width: auto;
    margin-left: 0;
    background: none;
  }

  .ts-bar__pricebox {
    width: auto;
    height: auto;
    padding: 6px 14px;
    border-width: 1.5px;
    border-radius: 8px;
  }

  .ts-bar__price {
    font-size: 28px;
    -webkit-text-stroke-width: 1px;
    text-shadow: -0.5px -0.5px 0 rgba(255, 255, 255, 0.85), 1px 1px 0 #000;
  }

  .ts-bar__timer {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    width: auto;
    margin-left: 0;
  }

  .ts-bar__label {
    font-size: 13px;
  }

  .ts-bar__clock {
    margin-top: 0;
    font-size: 24px;
  }
}

@media (max-width: 380px) {
  .ts-bar__deco--right {
    width: 116px;
  }

  .ts-bar__inner {
    column-gap: 8px;
  }

  .ts-bar__text {
    font-size: 16px;
  }

  .ts-bar__price {
    font-size: 24px;
  }

  .ts-bar__label {
    font-size: 12px;
  }

  .ts-bar__clock {
    font-size: 21px;
  }
}

/* ===== Mobile: timer label reads "BLACK FRIDAY ends in" (same height, no extra row) ===== */
.ts-bar__label-mob {
  display: none;
}

@media (max-width: 767px) {
  .ts-bar__label-desk {
    display: none;
  }

  .ts-bar__label-mob {
    display: inline;
  }

  /* timer row ("BLACK FRIDAY offers end in …") goes on top, offer row below */
  .ts-bar__timer {
    order: -1;
  }

  .ts-bar__bf {
    display: inline-block;
    margin-right: 2px;
    font-family: "Montserrat", sans-serif;
    font-weight: 900;
    font-style: normal;
    font-size: 13px;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    vertical-align: 1px;
    color: #ffc223;
  }
}

@media (max-width: 380px) {
  .ts-bar__bf {
    font-size: 10.5px;
  }

  /* uppercase + heavy font: keep the top row inside 320px phones */
  .ts-bar__timer {
    gap: 6px;
  }

  .ts-bar__label {
    font-size: 10.5px;
  }

  .ts-bar__clock {
    font-size: 19px;
  }
}

/* ==========================================================================
   Floating wrapper, close button and coupon chip (shared by all brands)
   ========================================================================== */
.bfbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9990;
  display: none;
  transform: translateY(110%);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), bottom .2s ease;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .35);
  line-height: normal;
}
.bfbar.is-on { display: block; }
.bfbar.is-in { transform: translateY(0); }
.bfbar, .bfbar *, .bfbar *::before, .bfbar *::after { box-sizing: border-box; }
.bfbar a, .bfbar a:hover, .bfbar a:focus, .bfbar a:visited { text-decoration: none; }
.bfbar img { max-width: none; border: 0; box-shadow: none; }
.bfbar-spacer { display: none; }
.bfbar-spacer.is-on { display: block; }

.bfbar-close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  width: 26px;
  height: 26px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 50%;
  background: rgba(0, 0, 0, .7);
  color: #fff;
  font: 400 18px/1 Arial, sans-serif;
  cursor: pointer;
  box-shadow: none;
  min-height: 0;
}
.bfbar-close:hover, .bfbar-close:focus-visible { background: #000; border-color: #fff; color: #fff; }

.bfbar-textcol {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: calc(9 * var(--u));
}
.bfbar-code {
  display: inline-block;
  padding: calc(4 * var(--u)) calc(14 * var(--u));
  border: max(1px, calc(1.6 * var(--u))) dashed var(--bfbar-accent);
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  font-family: "Poppins", Arial, sans-serif;
  font-weight: 700;
  font-size: calc(15 * var(--u));
  line-height: 1.25;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}
.bfbar-code b { color: var(--bfbar-accent); font-weight: 700; }

@media (max-width: 767px) {
  .bfbar-close { top: 4px; right: 4px; width: 22px; height: 22px; font-size: 15px; }
  .bfbar-textcol { gap: 4px; }
  .bfbar-code { padding: 2px 8px; font-size: 10.5px; border-width: 1px; letter-spacing: .05em; }
}
@media (max-width: 380px) {
  .bfbar-code { font-size: 9.5px; padding: 2px 6px; }
}
