/* Cyber Monday floating bar - Career Education. Design: cmday-26-main/floating-bars/ce/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
 * licensed files in a "fonts" folder next to this CSS (.woff2 preferred,
 * .woff / .otf / .ttf also work):
 *   fonts/intro-rust.woff2           -> text + price
 *   fonts/bauer-bodoni-roman.woff2   -> timer
 * Until they're there, the fallbacks are Montserrat and Bodoni Moda.
 */
@font-face {
  font-family: "Intro Rust";
  src: local("Intro Rust"),
       local("IntroRust-Base");
  font-weight: 100 900; /* single weight: used for every element, never faux-bolded */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bauer Bodoni";
  src: local("Bauer Bodoni Pro Roman"),
       local("BauerBodoniPro-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.
 */
.ce-bar {
  --u: min(1px, calc(100vw / 1440));
  --cyan: #00f0ff;
  --magenta: #ff00ff;
  --soft-white: #e8e0e0;
  --font-text: "Intro Rust", "Montserrat", sans-serif;
  --font-timer: "Bauer Bodoni", "Bodoni Moda", Didot, serif;

  position: relative;
  overflow: hidden;
  width: 100%;
  height: calc(135 * var(--u));
  display: flex;
  align-items: center;
  background: #000 url("ce-cm-bn-bg.webp") center / cover no-repeat;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-synthesis: none;
}

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

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

.ce-bar__deco--title {
  left: calc(13.1 * var(--u));
  top: calc(12.1 * var(--u));
  width: calc(425.4 * var(--u));
}

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

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

/* Intro Rust is an all-caps font; uppercase keeps the fallback looking the same */
.ce-bar__text {
  flex-shrink: 0;
  width: calc(301.6 * var(--u));
  font-family: var(--font-text);
  font-weight: 800;
  font-size: calc(32.6 * var(--u));
  line-height: 1;
  text-transform: uppercase;
  color: var(--soft-white);
  white-space: nowrap;
}

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

.ce-bar__price {
  font-family: var(--font-text);
  font-weight: 900;
  font-size: calc(76.5 * 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 */
  white-space: nowrap;
}

.ce-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);
}

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

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

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

.ce-bar__clock {
  margin-top: calc(10 * 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 */
.ce-bar__clock span {
  display: inline-block;
  min-width: 1.1em;
  text-align: center;
}

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

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

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

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

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

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

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

  .ce-bar__text {
    width: auto;
    font-size: 16px;
  }

  .ce-bar__pricebox {
    width: 140px;
    height: auto;
    aspect-ratio: 292.6 / 113.5;
    margin-left: 0;
  }

  .ce-bar__price {
    font-size: 34px;
  }

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

  .ce-bar__label {
    font-size: 16px;
  }

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

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

  .ce-bar__cm {
    display: inline-block;
    margin-right: 2px;
    font-family: var(--font-text);
    font-weight: 900;
    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;
  }

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

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

  .ce-bar__text {
    font-size: 14px;
  }

  .ce-bar__pricebox {
    width: 124px;
  }

  .ce-bar__price {
    font-size: 30px;
  }

  .ce-bar__label {
    font-size: 14px;
  }

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

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