/* Countdown bar for the coming flash sale (template-parts/hg/countdown.php), from the
   Shopify theme's announcement countdown: the accent red band above the announcement bar,
   the time until the start on darker red tiles and a black button. One row on wide screens;
   on phones the text takes the first line and the tiles and button share the second.
   Loaded only while the countdown runs (inc/header.php). */

/* Above the sticky header (z-index 60), like the announcement bar, and scrolls away with it. */
.hg-countdown {
  /* Accent red, and the same red darkened for the tiles. */
  --hg-countdown-bg: var(--hg-accent);
  --hg-countdown-tile: #7a161a;
  position: relative;
  z-index: 61;
  background: var(--hg-countdown-bg);
  color: #fff;
  font-family: var(--hg-font-body);
}
.hg-countdown__inner {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
  min-height: 48px;
  max-width: 1300px;
  margin-inline: auto;
  padding: 6px 16px;
}
.hg-countdown__text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 2px 10px;
  min-width: 0;
  margin: 0;
  text-align: center;
}
.hg-countdown__title {
  min-width: 0;
  font-family: var(--hg-font-heading);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.hg-countdown__when {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}
.hg-countdown__timer {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.hg-countdown__lead {
  margin-inline-end: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Fixed-width tiles, so the digits change without moving anything. */
.hg-countdown__unit {
  box-sizing: border-box;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  min-width: 42px;
  padding: 4px 6px;
  border-radius: 4px;
  background: var(--hg-countdown-tile);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}
.hg-countdown__label {
  margin-inline-start: 1px;
  font-size: 11px;
  font-weight: 500;
}
/* Two classes so the Ecomus link colours stay out. */
.hg-countdown .hg-countdown__btn {
  box-sizing: border-box;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 4px;
  background: #000;
  color: #fff;
  font-family: var(--hg-font-heading);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.hg-countdown .hg-countdown__btn:hover {
  background: #fff;
  color: #000;
}
.hg-countdown .hg-countdown__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* The countdown holds the announcement bar back while it runs; header.css lays it out as flex. */
.hg-announce[hidden] {
  display: none;
}

@media (max-width: 749px) {
  .hg-countdown__inner {
    gap: 6px 8px;
    padding: 8px 12px;
  }
  .hg-countdown__text {
    flex-basis: 100%;
    gap: 0 8px;
  }
  .hg-countdown__title {
    font-size: 13px;
  }
  .hg-countdown__when {
    font-size: 12px;
  }
  .hg-countdown__lead {
    margin-inline-end: 2px;
  }
  .hg-countdown__unit {
    min-width: 38px;
    padding: 4px;
    font-size: 13px;
  }
  /* A full 44px tap target on touch screens. */
  .hg-countdown .hg-countdown__btn {
    min-height: 44px;
    padding-inline: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hg-countdown__unit--s {
    display: none;
  }
  .hg-countdown .hg-countdown__btn {
    transition: none;
  }
}
