/* Cyber Monday floating bar - Upskilling Academy. Design: cmday-26-main/floating-bars/upa/style.css. Canva-only fonts load if installed locally, otherwise the design fallbacks are used. */

/*
 * Custom fonts from the Canva design. They are NOT on Google Fonts, so put the
 * files in a "fonts" folder next to this CSS (.woff2 preferred, .woff / .otf /
 * .ttf also work):
 *   fonts/intro-rust.woff2         -> price
 *   fonts/bodoni-flf-roman.woff2   -> timer
 * Until they're there, the fallbacks are Montserrat Black and Bodoni Moda.
 */
@font-face {
  font-family: "Intro Rust";
  src: local("Intro Rust"),
       local("IntroRust-Base");
  font-weight: 100 900; /* single weight: used as-is, never faux-bolded */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bodoni FLF";
  src: local("Bodoni FLF Roman"),
       local("BodoniFLF-Roman");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/*
 * 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.
 */
.upa-bar {
  --u: min(1px, calc(100vw / 1440));
  --cyan: #00f0ff;
  --magenta: #ff00ff;
  --bg-opacity: 0.42;
  --font-text: "Hammersmith One", sans-serif;
  --font-price: "Intro Rust", "Montserrat", sans-serif;
  --font-timer: "Bodoni FLF", "Bodoni Moda", Didot, serif;

  position: relative;
  overflow: hidden;
  width: 100%;
  height: calc(135 * var(--u));
  display: flex;
  align-items: center;
  background: #000;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-synthesis: none;
}

/* Light-streak photo at 42% opacity over black (same as the Canva design) */
.upa-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("upa-cm-bn-bg.webp") center / cover no-repeat;
  opacity: var(--bg-opacity);
  pointer-events: none;
}

.upa-bar:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: -3px;
}

/* ===== Absolute decoration ===== */
.upa-bar__deco {
  position: absolute;
  z-index: 0;
  display: block;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.upa-bar__deco--title {
  left: calc(8.5 * var(--u));
  top: calc(9.8 * var(--u));
  width: calc(467.1 * var(--u));
}

/* ===== Content: fixed-width slots so positions match the design ===== */
.upa-bar__inner {
  position: relative;
  z-index: 1;
  width: calc(1440 * var(--u));
  margin: 0 auto;
  padding-left: calc(531.1 * var(--u));
  display: flex;
  align-items: center;
}

.upa-bar__offer {
  display: flex;
  align-items: center;
}

/* hard black shadow, down-right (as in the design) */
.upa-bar__text {
  flex-shrink: 0;
  width: calc(238.7 * var(--u));
  font-family: var(--font-text);
  font-size: calc(32.2 * var(--u));
  line-height: 1;
  color: #fff;
  text-shadow: 0.0442em 0.0442em 0 #000;
  white-space: nowrap;
}

/* Black ribbon with neon cyan / magenta offset frame (image) */
.upa-bar__pricebox {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: calc(260.9 * var(--u));
  height: calc(109.9 * var(--u));
  margin-left: calc(23.4 * var(--u));
  background: url("upa-cm-bn-pricebg.webp") center / 100% 100% no-repeat;
}

/*
 * Canva "Echo" effect (Offset 48, Direction -54): solid white text with two
 * fading magenta copies stepping down-right behind it.
 * Offset 48 -> 0.06em per step; direction -54deg (from straight down)
 * -> x = 0.06em * sin54 = 0.0485em, y = 0.06em * cos54 = 0.0353em.
 */
.upa-bar__price {
  position: relative;
  z-index: 0;
  font-family: var(--font-price);
  font-weight: 900;
  font-size: calc(47.7 * var(--u));
  line-height: 1;
  color: #fff;
  white-space: nowrap;
}

.upa-bar__price::before,
.upa-bar__price::after {
  content: attr(data-text);
  content: attr(data-text) / ""; /* decorative layers: screen readers skip them */
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  color: var(--magenta);
  pointer-events: none;
}

/* Echo step 2 (farthest, faintest) */
.upa-bar__price::before {
  opacity: 0.3;
  transform: translate(0.0971em, 0.0705em);
}

/* Echo step 1 (nearest) */
.upa-bar__price::after {
  opacity: 0.5;
  transform: translate(0.0485em, 0.0353em);
}

.upa-bar__timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: calc(176.8 * var(--u));
  margin-left: calc(69.2 * var(--u));
  line-height: 1;
  white-space: nowrap;
}

.upa-bar__label,
.upa-bar__clock {
  font-family: var(--font-timer);
  font-weight: 400;
  color: #fff;
}

.upa-bar__label {
  font-size: calc(26.4 * var(--u));
}

.upa-bar__clock {
  margin-top: calc(9 * var(--u));
  font-size: calc(41.8 * var(--u));
  letter-spacing: 0.03em;
}

/* fixed width per unit so the clock doesn't jiggle every second */
.upa-bar__clock span {
  display: inline-block;
  min-width: 1.1em;
  text-align: center;
}

/* ===== Tablet: use the full width ===== */
@media (max-width: 991px) {
  .upa-bar {
    --u: calc(100vw / 1320);
  }

  .upa-bar__inner {
    width: 100%;
  }
}

/* ===== Mobile: timer row on top, offer row below ===== */
.upa-bar__label-mob {
  display: none;
}

@media (max-width: 767px) {
  .upa-bar {
    height: auto;
    min-height: 108px;
  }

  /* the title art is replaced by "CYBER MONDAY" text in the timer row */
  .upa-bar__deco--title {
    display: none;
  }

  .upa-bar__inner {
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 12px;
  }

  .upa-bar__offer {
    justify-content: center;
    gap: 12px;
  }

  .upa-bar__text {
    width: auto;
    font-size: 18px;
  }

  .upa-bar__pricebox {
    width: 140px;
    height: auto;
    aspect-ratio: 260.9 / 109.9;
    margin-left: 0;
  }

  .upa-bar__price {
    font-size: 27px;
  }

  .upa-bar__timer {
    order: -1;
    width: auto;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    margin-left: 0;
  }

  .upa-bar__label {
    font-size: 16px;
  }

  .upa-bar__label-desk {
    display: none;
  }

  .upa-bar__label-mob {
    display: inline;
  }

  .upa-bar__cm {
    display: inline-block;
    margin-right: 2px;
    font-family: var(--font-text);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.1;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: 1px;
    background: linear-gradient(90deg, #39d3f7 0%, #ff4dff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .upa-bar__clock {
    margin-top: 0;
    font-size: 24px;
  }
}

@media (max-width: 380px) {
  .upa-bar__offer {
    gap: 8px;
  }

  .upa-bar__text {
    font-size: 16px;
  }

  .upa-bar__pricebox {
    width: 124px;
  }

  .upa-bar__price {
    font-size: 24px;
  }

  .upa-bar__label {
    font-size: 14px;
  }

  .upa-bar__cm {
    font-size: 12px;
  }

  .upa-bar__clock {
    font-size: 22px;
  }
}

/* ==========================================================================
   Floating wrapper, close button and coupon chip (shared by all brands)
   ========================================================================== */
.cmbar {
  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;
}
.cmbar.is-on { display: block; }
.cmbar.is-in { transform: translateY(0); }
.cmbar, .cmbar *, .cmbar *::before, .cmbar *::after { box-sizing: border-box; }
.cmbar a, .cmbar a:hover, .cmbar a:focus, .cmbar a:visited { text-decoration: none; }
.cmbar img { max-width: none; border: 0; box-shadow: none; }
.cmbar-spacer { display: none; }
.cmbar-spacer.is-on { display: block; }

.cmbar-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;
}
.cmbar-close:hover, .cmbar-close:focus-visible { background: #000; border-color: #fff; color: #fff; }

.cmbar-textcol {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: calc(9 * var(--u));
}
.cmbar-code {
  display: inline-block;
  padding: calc(4 * var(--u)) calc(14 * var(--u));
  border: max(1px, calc(1.6 * var(--u))) dashed #ff00ff;
  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;
}
.cmbar-code b { color: #ff00ff; font-weight: 700; }

@media (max-width: 767px) {
  .cmbar-close { top: 4px; right: 4px; width: 22px; height: 22px; font-size: 15px; }
  .cmbar-textcol { gap: 4px; }
  .cmbar-code { padding: 2px 8px; font-size: 10.5px; border-width: 1px; letter-spacing: .05em; }
}
@media (max-width: 380px) {
  .cmbar-code { font-size: 9.5px; padding: 2px 6px; }
}

/* keep the close button clear of the timer on phones */
@media (max-width: 767px) {
  .cmbar > a { padding-right: 22px; }
}
