/* Cyber Monday floating bar - Learning Facility. Design: cmday-26-main/floating-bars/lf/style.css. Canva-only fonts load if installed locally, otherwise the design fallbacks are used. */

/*
 * Timer font: ADA Hybrid (from the Canva design). It is NOT on Google Fonts,
 * so put the licensed file in a "fonts" folder next to this CSS:
 *   fonts/ada-hybrid-medium.woff2  (or .woff / .otf / .ttf)
 * Until it's there, the timer falls back to Exo 2.
 */
@font-face {
  font-family: "ADA Hybrid";
  src: local("ADA Hybrid Medium"),
       local("ADAHybrid-Medium");
  font-weight: 500;
  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.
 */
.lf-bar {
  --u: min(1px, calc(100vw / 1440));
  --cyan: #00f0ff;
  --magenta: #ff00ff;
  --soft-white: #e8e0e0;
  --bg-opacity: 0.63;
  --font-timer: "ADA Hybrid", "Exo 2", sans-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;
}

/* Wave photo at 63% opacity over black (same as the Canva design) */
.lf-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("lf-cm-bn-bg.webp") center / cover no-repeat;
  opacity: var(--bg-opacity);
  pointer-events: none;
}

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

/* ===== Absolute decoration ===== */
.lf-bar__deco {
  position: absolute;
  z-index: 0;
  display: block;
  height: auto;
  pointer-events: none;
  user-select: none;
}

/* solid black block behind the title, full bar height (as in the design) */
.lf-bar__deco--block {
  left: 0;
  top: 0;
  width: calc(473.2 * var(--u));
  height: 100%;
  background: #000;
}

.lf-bar__deco--title {
  left: calc(-0.3 * var(--u));
  top: calc(12.6 * var(--u));
  width: calc(473.4 * var(--u));
}

/* ===== Content: fixed-width slots so positions match the design ===== */
.lf-bar__inner {
  position: relative;
  z-index: 1;
  width: calc(1440 * var(--u));
  margin: 0 auto;
  padding-left: calc(481.6 * var(--u));
  display: flex;
  align-items: center;
}

.lf-bar__offer {
  display: flex;
  align-items: center;
}

.lf-bar__text {
  flex-shrink: 0;
  width: calc(261.1 * var(--u));
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: calc(33.2 * var(--u));
  line-height: 1;
  color: var(--soft-white);
  white-space: nowrap;
}

/* Black octagon with neon cyan / magenta offset frame (image) */
.lf-bar__pricebox {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: calc(370.8 * var(--u));
  height: calc(135 * var(--u));
  margin-left: calc(28.9 * var(--u));
  background: url("lf-cm-bn-pricebg.webp") center / 100% 100% no-repeat;
}

.lf-bar__price {
  font-family: "Noto Serif", Georgia, serif;
  font-weight: 700;
  font-size: calc(78.2 * var(--u));
  line-height: 1;
  /* Canva "Splice" effect (Thickness 1, Offset 28, Direction -48):
     white outline with no fill, magenta copy offset down-right underneath */
  position: relative;
  z-index: 0;
  color: transparent;
  -webkit-text-stroke: max(1px, 0.007em) #fff; /* Thickness 1 */
  transform: translateX(calc(-2.3 * var(--u)));
  white-space: nowrap;
}

.lf-bar__price::before {
  content: attr(data-text);
  content: attr(data-text) / ""; /* decorative layer: screen readers skip it */
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  pointer-events: none;
  /* Splice offset: 28 -> 0.035em, direction -48deg (from straight down) -> x = 0.035em * sin48, y = 0.035em * cos48 */
  color: var(--magenta);
  -webkit-text-stroke: 0;
  transform: translate(0.026em, 0.0234em);
}

.lf-bar__timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: calc(215.3 * var(--u));
  margin-left: calc(24.8 * var(--u));
  line-height: 1;
  white-space: nowrap;
}

.lf-bar__label,
.lf-bar__clock {
  font-family: var(--font-timer);
  font-weight: 500;
  color: #fff;
}

.lf-bar__label {
  font-size: calc(26.4 * var(--u));
}

.lf-bar__clock {
  margin-top: calc(8 * var(--u));
  font-size: calc(41.8 * var(--u));
  letter-spacing: 0.04em;
}

/* fixed width per unit so the clock doesn't jiggle every second */
.lf-bar__clock span {
  display: inline-block;
  min-width: 1.2em;
  text-align: center;
}

/* ===== Tablet: use the full width ===== */
@media (max-width: 991px) {
  .lf-bar {
    --u: calc(100vw / 1400);
  }

  .lf-bar__inner {
    width: 100%;
  }
}

/* ===== Mobile: timer row on top, offer row below ===== */
.lf-bar__label-mob {
  display: none;
}

@media (max-width: 767px) {
  .lf-bar {
    height: auto;
    min-height: 108px;
  }

  /* the title art is replaced by "CYBER MONDAY" text in the timer row */
  .lf-bar__deco--title,
  .lf-bar__deco--block {
    display: none;
  }

  .lf-bar__inner {
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 12px;
  }

  .lf-bar__offer {
    justify-content: center;
    gap: 12px;
  }

  .lf-bar__text {
    width: auto;
    font-size: 17px;
  }

  .lf-bar__pricebox {
    width: 140px;
    height: auto;
    aspect-ratio: 370.8 / 135;
    margin-left: 0;
  }

  .lf-bar__price {
    font-size: 32px;
    transform: none;
  }

  .lf-bar__timer {
    order: -1;
    width: auto;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    margin-left: 0;
  }

  .lf-bar__label {
    font-size: 15px;
  }

  .lf-bar__label-desk {
    display: none;
  }

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

  .lf-bar__cm {
    display: inline-block;
    margin-right: 2px;
    font-family: "Poppins", sans-serif;
    font-weight: 800;
    font-size: 13px;
    line-height: 1.1;
    letter-spacing: 0.02em;
    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;
  }

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

@media (max-width: 380px) {
  .lf-bar__offer {
    gap: 8px;
  }

  .lf-bar__text {
    font-size: 15px;
  }

  .lf-bar__pricebox {
    width: 124px;
  }

  .lf-bar__price {
    font-size: 28px;
  }

  .lf-bar__label {
    font-size: 13.5px;
  }

  .lf-bar__cm {
    font-size: 11.5px;
  }

  .lf-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; }
}
