/**
 * WBF ATTPPF Guide - guidance rail styling.
 * Scoped under body.wbf-guide-on (added by the JS only on desktop widths),
 * so nothing here affects the page when the guide is inactive.
 */

:root {
  --wbf-guide-red: #e1251b;
  --wbf-guide-red-deep: #c01910;
  --wbf-guide-green: #2e9e4f;
  --wbf-guide-grey: #cfcfcf;
  --wbf-guide-line: #e3e3e3;
  --wbf-pinfo-width: 550px;
  /* width of the strip reserved on the right of ciclu component forms so the
     embedded rail's dots sit beside the controls instead of over them */
  --wbf-sol-rail-strip: 60px;
}

/* Free a strip on the right of the customization column (desktop only).
   Note: page-product is a class ON <body>, so it is chained, not descended. */
body.wbf-guide-on.page-product .product-information {
  width: var(--wbf-pinfo-width);
  max-width: var(--wbf-pinfo-width);
}

body.wbf-guide-on .single-product-summary {
  position: relative;
}

/* Safety: never narrow below the desktop breakpoint, even if the class lingers. */
@media (max-width: 1199px) {
  body.wbf-guide-on.page-product .product-information {
    width: auto;
    max-width: none;
  }
}

/* Ciclu / wbf_solutions pages: the embedded guide pins its rail inside each
   component form. Reserve a strip on the right (desktop only) so the dots sit
   beside the controls rather than overlapping the buttons/inputs. The form is
   set position:relative by the JS, so the absolutely-positioned rail aligns to
   this padded box. */
body.wbf-guide-sol-on form.add-to-cart-or-refresh.wbf-guide-form-on {
  padding-right: var(--wbf-sol-rail-strip);
}

@media (max-width: 1199px) {
  body.wbf-guide-sol-on form.add-to-cart-or-refresh.wbf-guide-form-on {
    padding-right: 0;
  }
}

/* ----- rail ----- */
.wbf-guide-rail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 6;
}

.wbf-guide-spine {
  position: absolute;
  right: 20px;
  width: 2px;
  background: var(--wbf-guide-line);
  z-index: 1;
}

.wbf-guide-pt {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  pointer-events: auto;
  transition: top 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
  z-index: 2;
}

.wbf-guide-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 12px/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #fff;
  background: var(--wbf-guide-grey);
  position: relative;
  transition: background 0.25s, transform 0.25s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.wbf-guide-pt.is-todo .wbf-guide-dot {
  background: var(--wbf-guide-grey);
}

.wbf-guide-pt.is-todo {
  opacity: 0.65;
}

.wbf-guide-pt.is-done .wbf-guide-dot {
  background: var(--wbf-guide-green);
}

.wbf-guide-pt.is-current .wbf-guide-dot {
  background: var(--wbf-guide-red);
  transform: scale(1.12);
}

/* pulsing ring on the current step */
.wbf-guide-pt.is-current .wbf-guide-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--wbf-guide-red);
  opacity: 0.5;
  z-index: -1;
  animation: wbfGuidePulse 1.6s ease-out infinite;
}

@keyframes wbfGuidePulse {
  0% { transform: scale(1); opacity: 0.5; }
  70% { transform: scale(2.4); opacity: 0; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wbf-guide-pt.is-current .wbf-guide-dot::after { animation: none; opacity: 0; }
}

/* ----- close "x" after the last step (dismisses the guide for the session) ----- */
.wbf-guide-close {
  position: absolute;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--wbf-guide-line);
  border-radius: 50%;
  background: #fff;
  color: #9a9a9a;
  font: 400 16px/18px "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
  transform: translateY(-50%);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 2;
}

.wbf-guide-close:hover {
  background: var(--wbf-guide-red);
  border-color: var(--wbf-guide-red);
  color: #fff;
}

/* message box beside the close "x" (opens to the right, like step popovers) */
.wbf-guide-close-pop {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 10px;
  width: max-content;
  max-width: 190px;
  background: #fff;
  border: 1px solid var(--wbf-guide-line);
  border-radius: 8px;
  padding: 7px 11px;
  font: 600 11.5px/1.35 "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #6a6a6a;
  text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  z-index: 4;
}

.wbf-guide-close-pop::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 7px 7px 7px 0;
  border-style: solid;
  border-color: transparent #fff transparent transparent;
  filter: drop-shadow(-1px 0 0 var(--wbf-guide-line));
}

/* ----- current-step popover (opens to the right of the dot; JS sets left) ----- */
.wbf-guide-popover {
  position: absolute;
  transform: translateY(-50%);
  background: #fff;
  border: 1px solid var(--wbf-guide-line);
  border-radius: 8px;
  padding: 9px 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  z-index: 3;
}

/* left-pointing arrow toward the current dot */
.wbf-guide-popover::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 7px 7px 7px 0;
  border-style: solid;
  border-color: transparent #fff transparent transparent;
  filter: drop-shadow(-1px 0 0 var(--wbf-guide-line));
}

.wbf-guide-pop-title {
  display: block;
  font: 700 12.5px/1.35 "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--wbf-guide-red-deep);
  letter-spacing: 0.1px;
}

.wbf-guide-pop-desc {
  display: block;
  margin-top: 3px;
  font: 400 11px/1.45 "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #8a8a8a;
}

/* ----- testing reset button (devReset only) ----- */
.wbf-guide-reset {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  padding: 8px 14px;
  border: 1px solid var(--wbf-guide-red);
  border-radius: 20px;
  background: #fff;
  color: var(--wbf-guide-red-deep);
  font: 600 12.5px/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(225, 37, 27, 0.22);
  transition: background 0.15s, color 0.15s;
}

.wbf-guide-reset:hover {
  background: var(--wbf-guide-red);
  color: #fff;
}

/* ----- mobile horizontal stepper (shown below the desktop breakpoint) ----- */
.wbf-guide-hbar {
  display: none;
  position: relative;
  margin: 0 0 16px;
  padding: 12px 32px 10px 4px;
  border: 1px solid var(--wbf-guide-line);
  border-radius: 8px;
  background: #fff;
}

.wbf-guide-hbar-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--wbf-guide-line);
  border-radius: 50%;
  background: #fff;
  color: #9a9a9a;
  font: 400 16px/18px "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-align: center;
  cursor: pointer;
}

.wbf-guide-hbar-close:hover {
  background: var(--wbf-guide-red);
  border-color: var(--wbf-guide-red);
  color: #fff;
}

.wbf-guide-hbar--noclose {
  padding-right: 4px;
}

.wbf-guide-hbar-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0 6px;
}

/* connecting line behind the chips */
.wbf-guide-hbar-track::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--wbf-guide-line);
  z-index: 0;
}

.wbf-guide-chip {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

.wbf-guide-chip-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font: 700 12px/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #fff;
  background: var(--wbf-guide-grey);
  box-shadow: 0 0 0 3px #fff;
}

.wbf-guide-chip.is-todo { opacity: 0.6; }
.wbf-guide-chip.is-done .wbf-guide-chip-dot { background: var(--wbf-guide-green); }
.wbf-guide-chip.is-current .wbf-guide-chip-dot { background: var(--wbf-guide-red); transform: scale(1.1); }

.wbf-guide-hbar-cap {
  margin-top: 10px;
  text-align: center;
  font: 700 13px/1.3 "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--wbf-guide-red-deep);
}
