﻿:root {
  --color-border-floating: #DCDCDE;
}

body {
  min-width: 320px;
}

button {
  font: inherit;
}

/* m_expense.css: body.modal-open { position:fixed; top:0 } 이 스크롤을 0으로 리셋하는 원인.
   position:fixed 만 무효화하고 overflow:hidden 은 유지 →
   모달 열리는 동안 부모 스크롤 숨김, 닫히면 scrollY 위치 그대로 복원. */
body.modal-open {
  position: static !important;
  top: auto !important;
  height: auto !important;
  overflow: hidden !important;
}

.standalone-page {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 0;
  background: #F3F3F6;
}

/* silbi/reset.css의 universal `border:0`이 Tailwind preflight(:where, specificity=0)를 이겨
   border-style이 none으로 굳어지는 문제를 보정. */
.standalone-page .border {
  border-style: solid;
}

@media (max-width: 768px) {
  .standalone-page {
    padding: 0;
  }
}

.tooltip-bubble-motion {
  animation: prd-dtl-tooltip-bob 1.8s ease-in-out infinite;
  will-change: transform;
}

@keyframes prd-dtl-tooltip-bob {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tooltip-bubble-motion {
    animation: none;
  }
}

/* top button 추가 */
.floating-top-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 998;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, bottom 0.3s ease;
}

.floating-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* overflow-x:hidden 부모가 scroll container를 만들어 sticky를 깨는 문제 방어.
   clip은 hidden과 달리 scroll container를 생성하지 않아 sticky가 정상 동작함. */
main:has(.standalone-page),
.page-container:has(.standalone-page) {
  overflow-x: clip !important;
}

.floating-top-btn.has-lpd-cta-bar {
  bottom: 108px;
}

.floating-top-btn__button {
  position: relative;
  display: flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s ease;
}

.floating-top-btn__button:hover {
  transform: scale(1.05);
}

.floating-top-btn__button:active {
  transform: scale(0.95);
}

.floating-top-btn__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border: 1px solid var(--color-border-floating);
  border-radius: 9999px;
  background: #fff;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.floating-top-btn__icon {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.floating-top-btn__icon svg {
  width: 12px;
  height: 15px;
}

@media (min-width: 768px) {
  .floating-top-btn {
    right: 40px;
  }
}

@media (min-width: 1440px) {
  .floating-top-btn {
    right: 80px;
  }
}

/* ===== Premium Counter (Non 페이지 롤링 보험료) ===== */
.premium-counter {
  position: relative;
  display: inline-flex;
  min-width: 74px;
  height: 28px;
  align-items: center;
  justify-content: center;
  overflow: visible;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.premium-counter__slots,
.premium-counter__final {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.18s ease;
}

.premium-counter__slots {
  overflow-x: visible;
  overflow-y: hidden;
  opacity: 0;
}

.premium-counter__slots::before,
.premium-counter__slots::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  z-index: 1;
  height: 7px;
  pointer-events: none;
}

.premium-counter__slots::before {
  top: 0;
  background: linear-gradient(180deg, rgba(243, 243, 246, 0.98) 0%, rgba(243, 243, 246, 0) 100%);
}

.premium-counter__slots::after {
  bottom: 0;
  background: linear-gradient(180deg, rgba(243, 243, 246, 0) 0%, rgba(243, 243, 246, 0.98) 100%);
}

.premium-counter__final {
  opacity: 1;
}

.premium-counter.is-spinning .premium-counter__slots { opacity: 1; }
.premium-counter.is-spinning .premium-counter__final  { opacity: 0; }
.premium-counter.is-complete .premium-counter__slots  { opacity: 0; }
.premium-counter.is-complete .premium-counter__final  { opacity: 1; }

.premium-counter__display,
.premium-counter__final-display {
  display: flex;
  height: 28px;
  align-items: center;
  justify-content: center;
}

.premium-counter__window {
  display: flex;
  height: 28px;
  overflow-x: visible;
  overflow-y: hidden;
}

.premium-counter__reel {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.premium-counter__digit,
.premium-counter__comma {
  display: inline-flex;
  height: 28px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 28px;
  white-space: nowrap;
  color: #1d1d1f;
  flex: 0 0 auto;
}

.premium-counter__digit {
  width: 0.66em;
  min-width: 0.66em;
}

.premium-counter__comma {
  width: 0.32em;
  min-width: 0.32em;
}

@media (prefers-reduced-motion: reduce) {
  .premium-counter__slots { display: none; }
}
