/* b4m_duo: official merch with a prop, on a prop's page by the gift card strip. A light shelf (the gift strip under
   it is the dark one): the offer on the left with a magenta percent seal, product cards on the right; stacked with
   a row that scrolls sideways on smaller screens. */
.b4m-duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "offer" "rail" "all" "note";
  gap: 0.85rem;
  margin: 0; /* the product page's own gap between blocks spaces it */
  padding: 1.1rem 1.1rem 1rem;
  background:
    radial-gradient(ellipse 46% 120% at 0% 0%, color-mix(in srgb, var(--b4m-magenta, #e51777) 10%, transparent), transparent 70%),
    radial-gradient(ellipse 40% 120% at 100% 100%, color-mix(in srgb, var(--b4m-cyan, #04c9ff) 13%, transparent), transparent 70%),
    var(--b4m-surface, #fff);
  border: 1px solid var(--b4m-border, #d5e0e8);
  border-radius: 1rem;
  box-shadow: 0 12px 28px -20px rgba(1, 17, 19, 0.4);
}

/* ---- The offer ---- */
.b4m-duo__side {
  display: contents; /* the offer and the button are placed by the layout; one column only on wide screens */
}

.b4m-duo__offer {
  grid-area: offer;
  min-width: 0;
}

.b4m-duo__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--b4m-magenta, #e51777);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* The percent: a small magenta pill by the kicker (it was a big round seal; the owner asked for leaner). */
.b4m-duo__pct {
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  background: var(--b4m-magenta, #e51777);
  color: var(--b4m-on-magenta, #fff);
  font-family: var(--b4m-font-display, inherit);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
}

.b4m-duo__title {
  margin: 0.3rem 0 0;
  color: var(--b4m-text, #13202a);
  font-family: var(--b4m-font-display, inherit);
  font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.6rem);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

.b4m-duo__text {
  margin: 0.3rem 0 0;
  color: var(--b4m-muted, #5a6e7e);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* ---- The button to all of the franchise's merch: the shop's own navy button (b4m-btn--navy, light letters),
   kept lean; this only places it and draws the count and the arrow ---- */
.b4m-duo__all {
  grid-area: all;
  justify-self: start;
  gap: 0.45rem;
  max-width: 100%;
  text-align: left;
  text-decoration: none;
}

.b4m-duo__all:hover,
.b4m-duo__all:focus-visible {
  text-decoration: none;
}

.b4m-duo__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--b4m-cyan, #04c9ff) 26%, transparent);
  font-family: var(--b4m-font-body, inherit);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
}

.b4m-duo__all svg {
  flex: none;
  width: 1rem;
  height: 1rem;
  color: var(--b4m-cyan, #04c9ff);
  transition: transform 0.16s ease;
}

.b4m-duo__all:hover svg {
  transform: translateX(3px);
}

/* ---- The products: one row that scrolls sideways with snap when it does not fit ---- */
.b4m-duo__shelf {
  grid-area: rail;
  position: relative;
  min-width: 0;
  margin: 0 -1.1rem;
}

.b4m-duo__rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(9.5rem, 44%);
  gap: 0.7rem;
  /* A box that scrolls sideways also cuts what leaves it downwards: the lifted card and its shadow get their room
     inside it (padding), and the same amount is taken back outside (margin), so the layout does not grow. */
  margin: -0.3rem 0 -1rem;
  padding: 0.5rem 1.1rem 1.25rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-left: 1.1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.b4m-duo__rail::-webkit-scrollbar {
  display: none;
}

/* Arrows: only where there is more to that side (duo.js), and only for a mouse. */
.b4m-duo__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: none;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  color: var(--b4m-navy, #253b52);
  background: var(--b4m-surface, #fff);
  border: 1px solid var(--b4m-border, #d5e0e8);
  border-radius: 50%;
  box-shadow: 0 8px 18px -8px rgba(1, 17, 19, 0.45);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.16s ease, transform 0.16s ease;
}

.b4m-duo__nav svg {
  width: 1.15rem;
  height: 1.15rem;
}

.b4m-duo__nav--prev {
  left: 0.35rem;
}

.b4m-duo__nav--next {
  right: 0.35rem;
}

.b4m-duo__nav:hover {
  background: color-mix(in srgb, var(--b4m-cyan, #04c9ff) 22%, #fff);
  transform: translateY(-50%) scale(1.06);
}

@media (hover: hover) and (min-width: 700px) {
  .b4m-duo__nav:not([hidden]) {
    display: grid;
  }
}

.b4m-duo__card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.5rem 0.55rem 0.6rem;
  background: var(--b4m-surface, #fff);
  border: 1px solid var(--b4m-border, #d5e0e8);
  border-radius: 0.9rem;
  scroll-snap-align: start;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.b4m-duo__card:hover,
.b4m-duo__card:focus-within {
  border-color: color-mix(in srgb, var(--b4m-cyan, #04c9ff) 75%, var(--b4m-border, #d5e0e8));
  box-shadow: 0 10px 16px -12px rgba(1, 17, 19, 0.5);
  transform: translateY(-3px);
}

/* One frame for every photo, whatever its own background is. */
.b4m-duo__img {
  display: block;
  aspect-ratio: 1 / 1;
  padding: 0.4rem;
  border-radius: 0.65rem;
  background: var(--b4m-paper, #f3f6f8);
  overflow: hidden;
}

.b4m-duo__img img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0.45rem;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.25s ease;
}

.b4m-duo__card:hover .b4m-duo__img img {
  transform: scale(1.04);
}

.b4m-duo__name {
  display: -webkit-box;
  min-height: 2.5em;
  margin: 0.55rem 0.1rem 0.5rem;
  overflow: hidden;
  color: var(--b4m-text, #13202a);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.b4m-duo__name:hover {
  color: var(--b4m-link, #253b52);
  text-decoration: underline;
}

.b4m-duo__buy {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.4rem;
  margin: auto 0.1rem 0;
}

.b4m-duo__prices {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  line-height: 1.1;
}

.b4m-duo__now {
  color: var(--b4m-magenta, #e51777);
  font-family: var(--b4m-font-display, inherit);
  font-size: 1.2rem;
  font-weight: 700;
}

.b4m-duo__now--plain {
  color: var(--b4m-text, #13202a);
}

.b4m-duo__was {
  color: var(--b4m-muted, #5a6e7e);
  font-size: 0.82rem;
}

.b4m-duo__add {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: var(--b4m-on-cyan, #011113);
  background: color-mix(in srgb, var(--b4m-cyan, #04c9ff) 22%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--b4m-cyan, #04c9ff) 70%, var(--b4m-border, #d5e0e8));
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.b4m-duo__add svg {
  width: 1.15rem;
  height: 1.15rem;
}

.b4m-duo__tick {
  display: none;
}

.b4m-duo__add:hover:not(:disabled),
.b4m-duo__add:focus-visible {
  background: var(--b4m-cyan, #04c9ff);
  border-color: var(--b4m-cyan, #04c9ff);
  transform: scale(1.08);
}

/* A prop with versions: the same round button, as a link to its page. */
.b4m-duo__add--go,
.b4m-duo__add--go:hover {
  text-decoration: none;
}

.b4m-duo__add.is-busy {
  opacity: 0.55;
  cursor: progress;
}

.b4m-duo__add.is-done {
  color: #fff;
  background: #2fbf71;
  border-color: #2fbf71;
  cursor: default;
  opacity: 1;
  transform: none;
}

.b4m-duo__add.is-done .b4m-duo__plus {
  display: none;
}

.b4m-duo__add.is-done .b4m-duo__tick {
  display: block;
}

/* The last tile: how many more there are. */
.b4m-duo__card--more {
  padding: 0;
  background: transparent;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--b4m-cyan, #04c9ff) 55%, var(--b4m-border, #d5e0e8));
}

.b4m-duo__card--more a {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.8rem 0.7rem;
  color: var(--b4m-navy, #253b52);
  text-align: center;
  text-decoration: none;
}

.b4m-duo__card--more strong {
  font-family: var(--b4m-font-display, inherit);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}

.b4m-duo__card--more span {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}

.b4m-duo__note {
  grid-area: note;
  margin: 0;
  min-height: 0;
  color: #17703f;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.4;
}

.b4m-duo__note:empty {
  display: none;
}

.b4m-duo__note.is-bad {
  color: #b42318;
}

@media (max-width: 699.98px) {
  .b4m-duo__all {
    justify-self: stretch;
    justify-content: center;
  }
}

/* Tablet: the offer and the button share the top line. */
@media (min-width: 700px) {
  .b4m-duo {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "offer all" "rail rail" "note note";
    align-items: end;
    padding: 1.25rem 1.4rem 1.1rem;
  }

  .b4m-duo__shelf {
    margin-inline: -1.4rem;
  }

  .b4m-duo__rail {
    grid-auto-columns: minmax(10rem, 23%);
    padding-inline: 1.4rem;
    scroll-padding-left: 1.4rem;
  }
}

/* Wide: the offer and its button are one column on the left, the products fill the right; both centred on one
   line, so the button never hangs below the cards. */
@media (min-width: 1200px) {
  .b4m-duo {
    grid-template-columns: minmax(15rem, 19.5rem) minmax(0, 1fr);
    grid-template-areas: "side rail" "note note";
    gap: 0.6rem 1.5rem;
    align-items: center;
    padding: 1.15rem 1.4rem 1.05rem;
  }

  .b4m-duo__side {
    grid-area: side;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    min-width: 0;
  }

  .b4m-duo__title {
    font-size: 1.55rem;
  }

  .b4m-duo__shelf {
    margin: 0;
  }

  /* As many as fit at a comfortable width; the rest a scroll (or an arrow) away. */
  .b4m-duo__rail {
    grid-auto-columns: minmax(10.25rem, 13.5rem);
    gap: 0.8rem;
    padding: 0.5rem 0.4rem 1.25rem;
    scroll-padding-left: 0.4rem;
  }

  .b4m-duo__nav--prev {
    left: -0.9rem;
  }

  .b4m-duo__nav--next {
    right: -0.9rem;
  }
}

/* ---- Premium edition pages (the dark room with the gold edge, .b4m-pdp--premium): the page's colour tokens are
   swapped there, so most follows; what was drawn in navy or cyan-on-white is redrawn in light and gold ---- */
.b4m-pdp--premium .b4m-duo {
  background:
    radial-gradient(ellipse 46% 120% at 0% 0%, color-mix(in srgb, var(--b4m-magenta, #e51777) 14%, transparent), transparent 70%),
    radial-gradient(ellipse 40% 120% at 100% 100%, color-mix(in srgb, var(--b4m-gold, #e2c06b) 10%, transparent), transparent 70%),
    var(--b4m-surface, #2a2d33);
  border-color: color-mix(in srgb, var(--b4m-gold, #e2c06b) 28%, var(--b4m-border, #3a3f47));
}

.b4m-pdp--premium .b4m-duo__card:hover,
.b4m-pdp--premium .b4m-duo__card:focus-within {
  border-color: color-mix(in srgb, var(--b4m-gold, #e2c06b) 70%, transparent);
}

.b4m-pdp--premium .b4m-duo__img {
  background: #fff; /* the photos have white backgrounds: one clean white frame in the dark room */
}

.b4m-pdp--premium .b4m-duo__img img {
  mix-blend-mode: normal;
}

.b4m-pdp--premium .b4m-duo__add {
  color: var(--b4m-gold, #e2c06b);
  background: transparent;
  border-color: color-mix(in srgb, var(--b4m-gold, #e2c06b) 60%, transparent);
}

.b4m-pdp--premium .b4m-duo__add:hover:not(:disabled),
.b4m-pdp--premium .b4m-duo__add:focus-visible {
  color: #1f2227;
  background: var(--b4m-gold, #e2c06b);
  border-color: var(--b4m-gold, #e2c06b);
}

.b4m-pdp--premium .b4m-duo__add.is-done {
  color: #fff;
  background: #2fbf71;
  border-color: #2fbf71;
}

.b4m-pdp--premium .b4m-duo__card--more {
  border-color: color-mix(in srgb, var(--b4m-gold, #e2c06b) 50%, transparent);
}

.b4m-pdp--premium .b4m-duo__card--more a {
  color: var(--b4m-text, #e4e7eb);
}

.b4m-pdp--premium .b4m-duo__card--more strong {
  color: var(--b4m-gold, #e2c06b);
}

.b4m-pdp--premium .b4m-duo__all {
  color: var(--b4m-gold, #e2c06b);
  background: transparent;
  border-color: color-mix(in srgb, var(--b4m-gold, #e2c06b) 65%, transparent);
}

.b4m-pdp--premium .b4m-duo__all:hover,
.b4m-pdp--premium .b4m-duo__all:focus-visible {
  color: #1f2227;
  background: var(--b4m-gold, #e2c06b);
  border-color: var(--b4m-gold, #e2c06b);
}

.b4m-pdp--premium .b4m-duo__all svg {
  color: currentColor;
}

.b4m-pdp--premium .b4m-duo__count {
  background: color-mix(in srgb, var(--b4m-gold, #e2c06b) 24%, transparent);
}

.b4m-pdp--premium .b4m-duo__nav {
  color: var(--b4m-text, #e4e7eb);
  background: #2e3238;
  border-color: color-mix(in srgb, var(--b4m-gold, #e2c06b) 40%, transparent);
}

.b4m-pdp--premium .b4m-duo__note {
  color: #6fdc9d;
}

@media (prefers-reduced-motion: reduce) {
  .b4m-duo__card,
  .b4m-duo__add,
  .b4m-duo__all,
  .b4m-duo__all svg,
  .b4m-duo__nav,
  .b4m-duo__img img {
    transition: none;
  }

  .b4m-duo__rail {
    scroll-behavior: auto;
  }

  .b4m-duo__card:hover,
  .b4m-duo__card:hover .b4m-duo__img img,
  .b4m-duo__add:hover:not(:disabled),
  .b4m-duo__all:hover {
    transform: none;
  }
}
