/* Slogan picker screen/popup: preset carousel and custom-text field. */

/* Wraps the panel/hint/back-button as one unit. As a plain screen it just
   fills the stage (matches what its position:static parent used to give
   them for free) so the group's own top:Npx offsets keep meaning the same
   thing; in popup mode (see layout.css/interactions.js) it instead becomes
   a fixed-size flex item that its now-viewport-fixed parent can center as a
   whole, since those offsets are tuned relative to each other, not to a
   container height. */
.br-slogan-popup-body {
  position: absolute;
  inset: 0;
}
.br-screen.br-is-popup .br-slogan-popup-body {
  position: relative;
  inset: auto;
  width: 879px;
  height: 850px;
}

.br-slogan-panel {
  position: absolute;
  left: 50%;
  top: 80px;
  transform: translateX(-50%);
  width: 879px;
  height: 613px;
  background: url("../../images/panel-slogans.png") center / 100% 100% no-repeat;
  padding: 76px 100px 60px 100px;
}
.br-slogan-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.br-slogan-carousel::-webkit-scrollbar { display: none; }
.br-slogan-page {
  flex: 0 0 100%;
  scroll-snap-align: start;
}
.br-slogan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.br-slogan-item {
  position: relative;
  min-height: 60px;
  height: auto;
  background: url("../../images/slogan-row.png") center / 100% 100% no-repeat;
  display: flex;
  align-items: center;
  padding: 10px 24px 10px 62px;
  cursor: pointer;
  color: #0070ff;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  transition: filter .15s ease;
}
.br-slogan-item:hover { filter: brightness(1.05); }
.br-slogan-item .br-tick {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background: url("../../images/dot.png") center / contain no-repeat;
}
.br-slogan-item.br-is-selected .br-tick {
  background-image: url("../../images/check.png");
}
.br-slogan-item.br-is-selected {
  background: url("../../images/slogan-row-active.png") center / 100% 100% no-repeat;
  color: #0031c5;
}
.br-slogan-item.br-slogan-item--custom input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  color: inherit;
  border-bottom: 1px solid rgba(0,112,255,0.4);
  padding: 4px 0;
}
.br-slogan-item.br-slogan-item--custom input::placeholder {
  color: #0070ff;
  opacity: 1;
}

.br-slogan-pager {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}
.br-slogan-pager .br-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #0070ff;
  cursor: pointer;
}
.br-slogan-pager .br-dot.br-is-active { background: #74edff; }

@media (min-width: 721px) {
  .br-slogan-pager {
    gap: 14px;
  }
  .br-slogan-pager .br-dot {
    width: 16px;
    height: 16px;
    border-width: 2px;
  }
}

.br-slogan-confirm {
  position: absolute;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.br-slogan-back {
  position: absolute;
  left: 50%;
  top: 742px;
  transform: translateX(-50%);
}
/* As a popup, clicking outside already closes it (see interactions.js) - a
   dedicated back button is redundant there and was the thing colliding with
   the dimmed backdrop's own Chốt đơn/Quay lại underneath. Full-screen mode
   still needs it (no "outside" to click on a real page). */
.br-screen.br-is-popup .br-slogan-back {
  display: none;
}
/* The shared .br-btn:hover/:active rules set `transform` outright, which would
   blow away this button's own translateX(-50%) centering and make it visibly
   jump sideways on hover - recompose both instead of just replacing. */
.br-slogan-back:hover  { transform: translateX(-50%) translateY(-2px); }
.br-slogan-back:active { transform: translateX(-50%) translateY(1px); }
.br-screen.br-is-popup .br-slogan-back:hover,
.br-screen.br-is-popup .br-slogan-back:active {
  transform: translateX(-50%);
}

/* Character-limit warning for the custom slogan field - same pill treatment as
   the photo upload hint, hidden until the field actually hits its limit. */
.br-slogan-hint {
  display: none;
  position: absolute;
  left: 50%;
  top: 705px;
  transform: translateX(-50%);
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 3px 10px rgba(0, 49, 197, 0.18);
  font-size: 11px;
  font-weight: 700;
  color: #c0392b;
  white-space: nowrap;
}
.br-slogan-hint.br-is-visible {
  display: inline-flex;
}

@media (max-width: 720px) {
  .br-slogan-popup-body,
  .br-screen.br-is-popup .br-slogan-popup-body {
    position: static;
    inset: auto;
    width: auto;
    height: auto;
  }
  .br-slogan-panel {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-width: 360px;
    height: auto;
    margin: 20px auto 0;
    padding: 40px 24px 100px;
    background-size: 100% 100%;
  }
  .br-slogan-item { font-size: 13px; min-height: 46px; height: auto; padding: 8px 14px 8px 48px; background-image: url("../../images/slogan-row-mobile.png"); }
  .br-slogan-item.br-is-selected,
  .br-slogan-item.br-slogan-item--custom.br-is-selected { background-image: url("../../images/slogan-row-active-mobile.png"); }
  .br-slogan-item .br-tick { left: 16px; width: 18px; height: 18px; }
  .br-slogan-confirm {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
  }
  .br-slogan-back {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    display: block;
    text-align: center;
    margin: 16px auto 32px;
  }
  .br-slogan-hint {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    width: auto;
    max-width: 280px;
    margin: 12px auto 0;
    white-space: normal;
    text-align: center;
  }
  /* display:flex (not inline-flex) so it's a block-level box - margin:auto only
     centers block-level boxes, the same pitfall the photo hint pill had. */
  .br-slogan-hint.br-is-visible {
    display: flex;
  }
}
