/* Cyber Monday floating bar - Tyne Academy. Design: cmday-26-main/floating-bars/ta/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/univers-55-roman.woff2   -> text
 *   fonts/magnolia-script.woff2    -> price
 * Until they're there, the fallbacks are Roboto and Playfair Display Italic.
 */
@font-face {
  font-family: "Univers";
  src: local("Univers LT Pro 55 Roman"),
       local("UniversLTPro-55Roman");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Magnolia Script";
  src: local("Magnolia Script"),
       local("Magnolia-Script");
  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.
 */
.ta-bar {
  --u: min(1px, calc(100vw / 1440));
  --cyan: #00f0ff;
  --price-yellow: #ffc223;
  --soft-white: #e8e0e0;
  --bg-opacity: 0.34;
  --font-text: "Univers", "Roboto", Arial, sans-serif;
  --font-price: "Magnolia Script", "Playfair Display", Georgia, 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;
}

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

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

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

.ta-bar__deco--title {
  left: calc(13.8 * var(--u));
  top: calc(16.9 * var(--u));
  width: calc(521.2 * var(--u));
}

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

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

.ta-bar__text {
  flex-shrink: 0;
  width: calc(249.6 * var(--u));
  font-family: var(--font-text);
  font-weight: 400;
  font-size: calc(32.8 * var(--u));
  line-height: 1;
  color: var(--soft-white);
  white-space: nowrap;
}

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

.ta-bar__price {
  font-family: var(--font-price);
  font-size: calc(62.3 * var(--u));
  line-height: 1;
  /* Canva "Splice" effect (Thickness 1, Offset 28, Direction -48):
     white outline with no fill, yellow 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;
}

.ta-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(--price-yellow);
  -webkit-text-stroke: 0;
  transform: translate(0.026em, 0.0234em);
}

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

.ta-bar__label,
.ta-bar__clock {
  font-family: "Bree Serif", Georgia, serif;
  font-weight: 400;
  color: #fff;
}

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

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

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

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

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

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

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

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

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

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

  .ta-bar__text {
    width: auto;
    font-size: 18px;
  }

  .ta-bar__pricebox {
    width: 140px;
    height: auto;
    aspect-ratio: 272 / 111.3;
    margin-left: 0;
  }

  .ta-bar__price {
    font-size: 32px;
  }

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

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

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

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

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

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

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

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

  .ta-bar__pricebox {
    width: 124px;
  }

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

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

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

  .ta-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 #ffc223;
  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: #ffc223; 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; }
}
