/* 고객 포털 플로팅 팝업 — 전환형 커머스 UI + TDS */
.client-popup-trigger {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  opacity: 0;
}

.client-floating-popup-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--client-popup-sidebar, var(--sidebar-width, 280px));
  z-index: 1190;
  background: rgba(2, 9, 19, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.client-floating-popup-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

.client-floating-popup {
  --client-popup-blue: var(--tds-blue500, #3182f6);
  --client-popup-blue-hover: var(--tds-blue600, #1b64da);
  --client-popup-blue-soft: rgba(49, 130, 246, 0.12);
  --client-popup-text: var(--tds-grey900, #191f28);
  --client-popup-sub: var(--tds-grey600, #6b7684);
  --client-popup-muted: var(--tds-grey500, #8b95a1);
  --client-popup-surface: #ffffff;
  --client-popup-border: rgba(2, 9, 19, 0.06);
  --client-popup-grey50: var(--tds-grey50, #f9fafb);
  --client-popup-grey100: var(--tds-grey100, #f2f4f6);
  --client-popup-shadow: 0 18px 48px rgba(2, 9, 19, 0.16), 0 2px 8px rgba(2, 9, 19, 0.06);
  /* app-main 영역 기준 (사이드바 제외) */
  --client-popup-sidebar: var(--sidebar-width, 280px);
  --client-popup-main-width: calc(100vw - var(--client-popup-sidebar));
  --client-popup-main-center: calc(var(--client-popup-sidebar) + var(--client-popup-main-width) / 2);

  position: fixed;
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.28s ease,
    visibility 0.28s ease;
  color: var(--client-popup-text);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  letter-spacing: -0.025em;
  -webkit-font-smoothing: antialiased;
}

.client-floating-popup.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.client-floating-popup__inner {
  position: relative;
  background: var(--client-popup-surface);
  border: 1px solid var(--client-popup-border);
  box-shadow: var(--client-popup-shadow);
  overflow: hidden;
}

.client-floating-popup__media {
  flex-shrink: 0;
  overflow: hidden;
  background: var(--client-popup-grey100);
}

.client-floating-popup__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.client-floating-popup__body {
  min-width: 0;
}

.client-floating-popup__accent {
  margin: 0 0 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--client-popup-blue-soft);
  color: var(--client-popup-blue);
  font-size: 0.75rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.client-floating-popup__title {
  margin: 0;
  font-weight: 800;
  color: var(--client-popup-text);
  letter-spacing: -0.03em;
}

.client-floating-popup__subtitle {
  margin: 0.3rem 0 0;
  color: var(--client-popup-sub);
  font-weight: 500;
}

.client-floating-popup__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 0.75rem;
  background: var(--client-popup-blue);
  color: #fff !important;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none !important;
  box-shadow: 0 8px 20px rgba(49, 130, 246, 0.28);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.client-floating-popup__cta:hover {
  background: var(--client-popup-blue-hover);
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(49, 130, 246, 0.34);
}

.client-floating-popup__cta:active {
  transform: scale(0.98);
}

.client-floating-popup__close {
  position: absolute;
  z-index: 2;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--client-popup-muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(2, 9, 19, 0.08);
  transition: background 0.15s ease, color 0.15s ease;
}

.client-floating-popup__close:hover {
  background: #fff;
  color: var(--client-popup-text);
}

/* ── corner: 우측 하단 프로모 카드 ── */
.client-floating-popup--corner {
  right: 1.25rem;
  bottom: 1.25rem;
  left: auto;
  width: min(340px, calc(100vw - 1.5rem));
  transform: translateY(1.4rem) scale(0.98);
}

.client-floating-popup--corner.is-visible {
  transform: translateY(0) scale(1);
}

.client-floating-popup--corner .client-floating-popup__inner {
  display: flex;
  flex-direction: column;
  border-radius: 1.35rem;
  padding: 0;
}

.client-floating-popup--corner .client-floating-popup__media {
  width: 100%;
  height: 168px;
  border: 0;
}

.client-floating-popup--corner .client-floating-popup__body {
  padding: 1rem 1.1rem 0.25rem;
}

.client-floating-popup--corner .client-floating-popup__inner--text-only .client-floating-popup__body {
  padding-top: 1.2rem;
}

.client-floating-popup--corner .client-floating-popup__title {
  font-size: 1.125rem;
  line-height: 1.4;
}

.client-floating-popup--corner .client-floating-popup__subtitle {
  font-size: 0.8125rem;
  line-height: 1.45;
}

.client-floating-popup--corner .client-floating-popup__cta {
  margin: 0.9rem 1.1rem 1.1rem;
  min-height: 2.75rem;
  width: calc(100% - 2.2rem);
  font-size: 0.9375rem;
  border-radius: 0.85rem;
}

.client-floating-popup--corner .client-floating-popup__close {
  top: 0.7rem;
  right: 0.7rem;
}

/* ── bar: app-main 중앙 하단 전환 막대 ── */
.client-floating-popup--bar {
  left: var(--client-popup-main-center);
  right: auto;
  bottom: 1.15rem;
  width: min(760px, calc(var(--client-popup-main-width) - 1.25rem));
  transform: translate(-50%, 1.25rem);
}

.client-floating-popup--bar.is-visible {
  transform: translate(-50%, 0);
}

.client-floating-popup--bar .client-floating-popup__media {
  display: none !important;
}

.client-floating-popup--bar .client-floating-popup__inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 3.65rem;
  padding: 0.65rem 3rem 0.65rem 1.15rem;
  border-radius: 999px;
  background: linear-gradient(105deg, #191f28 0%, #2b3340 55%, #243447 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(2, 9, 19, 0.28);
  color: #fff;
}

.client-floating-popup--bar .client-floating-popup__body {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  padding-right: 0.25rem;
  min-width: 0;
}

.client-floating-popup--bar .client-floating-popup__accent {
  margin: 0;
  background: rgba(49, 130, 246, 0.22);
  color: #8ec2ff;
  font-size: 0.72rem;
}

.client-floating-popup--bar .client-floating-popup__title {
  color: #fff;
  font-size: 0.9375rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-floating-popup--bar .client-floating-popup__subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-floating-popup--bar .client-floating-popup__cta {
  flex-shrink: 0;
  margin: 0;
  min-height: 2.35rem;
  padding: 0 1.05rem;
  border-radius: 999px;
  font-size: 0.875rem;
  box-shadow: 0 8px 18px rgba(49, 130, 246, 0.35);
}

.client-floating-popup--bar .client-floating-popup__close {
  top: 50%;
  right: 0.7rem;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  box-shadow: none;
}

.client-floating-popup--bar .client-floating-popup__close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ── toast: app-main 중앙 하단 알림 ── */
.client-floating-popup--toast {
  left: var(--client-popup-main-center);
  right: auto;
  bottom: 1.25rem;
  width: min(400px, calc(var(--client-popup-main-width) - 1.5rem));
  transform: translate(-50%, 1.25rem);
}

.client-floating-popup--toast.is-visible {
  transform: translate(-50%, 0);
}

.client-floating-popup--toast .client-floating-popup__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 36px rgba(2, 9, 19, 0.14);
}

.client-floating-popup--toast .client-floating-popup__inner--text-only {
  grid-template-columns: 1fr auto;
}

.client-floating-popup--toast .client-floating-popup__media {
  width: 48px;
  height: 48px;
  border-radius: 0.85rem;
}

.client-floating-popup--toast .client-floating-popup__body {
  padding-right: 0;
}

.client-floating-popup--toast .client-floating-popup__accent {
  margin-bottom: 0.2rem;
  font-size: 0.7rem;
}

.client-floating-popup--toast .client-floating-popup__title {
  font-size: 0.9375rem;
  line-height: 1.3;
}

.client-floating-popup--toast .client-floating-popup__subtitle {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  line-height: 1.35;
}

.client-floating-popup--toast .client-floating-popup__cta {
  margin: 0;
  min-height: 2.15rem;
  padding: 0 0.85rem;
  border-radius: 0.7rem;
  font-size: 0.8125rem;
  box-shadow: none;
}

.client-floating-popup--toast .client-floating-popup__close {
  top: 0.45rem;
  right: 0.45rem;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--client-popup-grey100);
  box-shadow: none;
}

/* ── modal: app-main 중앙 쿠폰/혜택 모달 ── */
.client-floating-popup--modal {
  left: var(--client-popup-main-center);
  top: 50%;
  right: auto;
  bottom: auto;
  width: min(380px, calc(var(--client-popup-main-width) - 2rem));
  transform: translate(-50%, calc(-48%)) scale(0.96);
  z-index: 1205;
}

.client-floating-popup--modal.is-visible {
  transform: translate(-50%, -50%) scale(1);
}

.client-floating-popup--modal .client-floating-popup__inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border-radius: 1.5rem;
  text-align: center;
}

.client-floating-popup--modal .client-floating-popup__media {
  width: 100%;
  height: 180px;
  border: 0;
}

.client-floating-popup--modal .client-floating-popup__body {
  padding: 1.25rem 1.35rem 0.15rem;
}

.client-floating-popup--modal .client-floating-popup__inner--text-only .client-floating-popup__body {
  padding-top: 2rem;
}

.client-floating-popup--modal .client-floating-popup__accent {
  margin: 0 auto 0.55rem;
}

.client-floating-popup--modal .client-floating-popup__title {
  font-size: 1.35rem;
  line-height: 1.35;
}

.client-floating-popup--modal .client-floating-popup__subtitle {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.client-floating-popup--modal .client-floating-popup__cta {
  margin: 1.15rem 1.35rem 1.35rem;
  width: calc(100% - 2.7rem);
  min-height: 3rem;
  font-size: 1rem;
  border-radius: 0.95rem;
}

.client-floating-popup--modal .client-floating-popup__close {
  top: 0.85rem;
  right: 0.85rem;
}

/* ── top: app-main 상단 공지 바 ── */
.client-floating-popup--top {
  top: 0;
  left: var(--client-popup-sidebar);
  width: var(--client-popup-main-width);
  max-width: none;
  transform: translateY(-110%);
  padding-top: env(safe-area-inset-top, 0px);
}

.client-floating-popup--top.is-visible {
  transform: translateY(0);
}

.client-floating-popup--top .client-floating-popup__media {
  display: none;
}

.client-floating-popup--top .client-floating-popup__inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem 2.75rem 0.85rem 1.15rem;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--client-popup-text);
  box-shadow: 0 10px 28px rgba(2, 9, 19, 0.18);
}

.client-floating-popup--top .client-floating-popup__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}

.client-floating-popup--top .client-floating-popup__accent {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(49, 130, 246, 0.22);
  color: #8ab4ff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.client-floating-popup--top .client-floating-popup__title {
  margin: 0;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.client-floating-popup--top .client-floating-popup__subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.client-floating-popup--top .client-floating-popup__cta {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.55rem 0.95rem;
  border-radius: 0.75rem;
  background: var(--client-popup-blue);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}

.client-floating-popup--top .client-floating-popup__cta:hover {
  background: var(--client-popup-blue-hover);
}

.client-floating-popup--top .client-floating-popup__close {
  top: calc(50% + env(safe-area-inset-top, 0px) / 2);
  right: 0.85rem;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
}

.client-floating-popup--top .client-floating-popup__close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

@media (max-width: 768px) {
  .client-floating-popup,
  .client-floating-popup-backdrop {
    --client-popup-sidebar: 0px;
  }

  .client-floating-popup-backdrop {
    left: 0;
  }

  .client-floating-popup--top {
    left: 0;
    width: 100%;
  }

  /* corner: 더 컴팩트한 카드 */
  .client-floating-popup--corner {
    right: 0.65rem;
    left: 0.65rem;
    width: auto;
    max-width: 280px;
    margin-left: auto;
    bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  }

  .client-floating-popup--corner .client-floating-popup__media {
    height: 112px;
  }

  .client-floating-popup--corner .client-floating-popup__inner {
    border-radius: 1rem;
  }

  .client-floating-popup--corner .client-floating-popup__body {
    padding: 0.7rem 0.85rem 0.15rem;
  }

  .client-floating-popup--corner .client-floating-popup__inner--text-only .client-floating-popup__body {
    padding-top: 0.85rem;
  }

  .client-floating-popup--corner .client-floating-popup__title {
    font-size: 0.9375rem;
    line-height: 1.35;
  }

  .client-floating-popup--corner .client-floating-popup__subtitle {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  .client-floating-popup--corner .client-floating-popup__accent {
    font-size: 0.6875rem;
    padding: 0.15rem 0.45rem;
  }

  .client-floating-popup--corner .client-floating-popup__cta {
    margin: 0.65rem 0.85rem 0.85rem;
    min-height: 2.35rem;
    width: calc(100% - 1.7rem);
    font-size: 0.8125rem;
    border-radius: 0.7rem;
  }

  .client-floating-popup--corner .client-floating-popup__close {
    top: 0.5rem;
    right: 0.5rem;
    width: 1.6rem;
    height: 1.6rem;
    font-size: 1rem;
  }

  /* toast */
  .client-floating-popup--toast {
    left: 50%;
    width: calc(100vw - 1.5rem);
    max-width: 340px;
    bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  }

  .client-floating-popup--toast .client-floating-popup__inner {
    grid-template-columns: 64px 1fr;
    gap: 0.55rem;
    padding: 0.65rem;
    border-radius: 0.95rem;
  }

  .client-floating-popup--toast .client-floating-popup__inner--text-only {
    grid-template-columns: 1fr;
  }

  .client-floating-popup--toast .client-floating-popup__media {
    width: 64px;
    height: 64px;
  }

  .client-floating-popup--toast .client-floating-popup__title {
    font-size: 0.875rem;
  }

  .client-floating-popup--toast .client-floating-popup__subtitle {
    font-size: 0.75rem;
  }

  .client-floating-popup--toast .client-floating-popup__cta {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 2.25rem;
    font-size: 0.8125rem;
  }

  /* modal */
  .client-floating-popup--modal {
    width: calc(100vw - 2rem);
    max-width: 300px;
  }

  .client-floating-popup--modal .client-floating-popup__media {
    height: 120px;
  }

  .client-floating-popup--modal .client-floating-popup__body {
    padding: 0.85rem 0.9rem 0.2rem;
  }

  .client-floating-popup--modal .client-floating-popup__title {
    font-size: 1rem;
  }

  .client-floating-popup--modal .client-floating-popup__subtitle {
    font-size: 0.75rem;
  }

  .client-floating-popup--modal .client-floating-popup__cta {
    margin: 0.7rem 0.9rem 0.9rem;
    min-height: 2.4rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 640px) {
  .client-floating-popup--bar {
    width: calc(100vw - 1.1rem);
    max-width: none;
    bottom: calc(0.55rem + env(safe-area-inset-bottom, 0px));
  }

  .client-floating-popup--bar .client-floating-popup__inner {
    border-radius: 0.95rem;
    flex-wrap: wrap;
    padding: 0.7rem 0.75rem;
    gap: 0.5rem;
    min-height: 0;
  }

  .client-floating-popup--bar .client-floating-popup__body {
    width: 100%;
    padding-right: 1.5rem;
    gap: 0.2rem 0.45rem;
  }

  .client-floating-popup--bar .client-floating-popup__title {
    font-size: 0.8125rem;
    white-space: normal;
  }

  .client-floating-popup--bar .client-floating-popup__subtitle {
    font-size: 0.72rem;
    white-space: normal;
  }

  .client-floating-popup--bar .client-floating-popup__accent {
    font-size: 0.6875rem;
  }

  .client-floating-popup--bar .client-floating-popup__cta {
    width: 100%;
    min-height: 2.25rem;
    font-size: 0.8125rem;
    padding: 0.45rem 0.75rem;
  }

  .client-floating-popup--bar .client-floating-popup__close {
    top: 0.55rem;
    right: 0.55rem;
    transform: none;
    width: 1.5rem;
    height: 1.5rem;
  }

  .client-floating-popup--top .client-floating-popup__inner {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 0.65rem 2.15rem 0.65rem 0.85rem;
    gap: 0.4rem;
  }

  .client-floating-popup--top .client-floating-popup__body {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .client-floating-popup--top .client-floating-popup__title {
    font-size: 0.8125rem;
    line-height: 1.3;
  }

  .client-floating-popup--top .client-floating-popup__subtitle {
    font-size: 0.72rem;
  }

  .client-floating-popup--top .client-floating-popup__accent {
    font-size: 0.65rem;
    padding: 0.12rem 0.4rem;
  }

  .client-floating-popup--top .client-floating-popup__cta {
    width: 100%;
    text-align: center;
    min-height: 2.15rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }

  .client-floating-popup--top .client-floating-popup__close {
    top: calc(0.55rem + env(safe-area-inset-top, 0px));
    right: 0.55rem;
    transform: none;
    width: 1.5rem;
    height: 1.5rem;
  }
}
