/* PC 몰 — kinetic badge (공통) + 맨 위로 · 히어로 CTA */
@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@500&display=swap");

/* ── kinetic badge 공통 (원형 회전 텍스트 + 중앙 아이콘) ── */
.kinetic-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  margin: 0;
  padding: 0;
  border: none;
  text-decoration: none;
  color: #1a1a1a;
  font-family: "Oswald", sans-serif;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
}

.kinetic-badge .badge-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 100%;
  height: 100%;
  background-color: #1a1a1a;
  border-radius: 50%;
  transition: transform 0.6s cubic-bezier(0.85, 0, 0.15, 1);
  z-index: 1;
}

.kinetic-badge:hover .badge-bg,
.kinetic-badge:focus-visible .badge-bg {
  transform: translate(-50%, -50%) scale(1);
}

.kinetic-badge .badge-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  animation: mall-kinetic-spin-slow 10s linear infinite;
  transition: color 0.4s ease;
}

.kinetic-badge .badge-text svg {
  overflow: visible;
}

.kinetic-badge:hover .badge-text,
.kinetic-badge:focus-visible .badge-text {
  color: #f4f4f4;
  animation: mall-kinetic-spin-slow 3s linear infinite;
}

.kinetic-badge .badge-icon {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  /* 기본 ~10시 → 호버 12시(위) */
  transform: rotate(-60deg);
  transform-origin: center center;
  transition:
    transform 0.55s cubic-bezier(0.85, 0, 0.15, 1),
    color 0.4s ease;
  color: #1a1a1a;
}

.kinetic-badge:hover .badge-icon,
.kinetic-badge:focus-visible .badge-icon {
  transform: rotate(0deg) translateY(-2px) scale(1.06);
  color: #f4f4f4;
}

/* 히어로 CTA — 아래 화살표 (back to top 의 거울) */
.kinetic-badge .badge-icon--down {
  transform: rotate(60deg);
}

.kinetic-badge:hover .badge-icon--down,
.kinetic-badge:focus-visible .badge-icon--down {
  transform: rotate(0deg) translateY(2px) scale(1.06);
}

.kinetic-badge:focus-visible {
  outline: none;
}

.kinetic-badge:focus-visible .badge-bg {
  box-shadow: 0 0 0 3px rgba(46, 172, 57, 0.45);
}

@keyframes mall-kinetic-spin-slow {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ── PC 맨 위로 (우측 하단 고정) ── */
.mall-back-to-top.kinetic-badge {
  position: fixed;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  z-index: 55;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.92);
  pointer-events: none;
  transition:
    opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.4s,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.mall-back-to-top.kinetic-badge.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

@media (max-width: 900px) {
  .mall-back-to-top.kinetic-badge {
    display: none !important;
  }
}

/* ── PC 히어로 — 스크롤 유도 (표시만 · 배너 밝기에 따라 색 전환) ── */
#mallWrap .mall-hero-scroll-cue {
  --mall-scroll-cue-ink: #1a1a1a;
  position: absolute;
  left: 50%;
  bottom: clamp(28px, 4.5vh, 52px);
  z-index: 12;
  display: block;
  padding-top: 68px;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}

#mallWrap .mall-hero-scroll-cue--on-light {
  --mall-scroll-cue-ink: #1a1a1a;
}

#mallWrap .mall-hero-scroll-cue--on-dark {
  --mall-scroll-cue-ink: #f4f4f4;
}

#mallWrap .mall-hero-scroll-cue.is-visible {
  opacity: 0.92;
  visibility: visible;
}

#mallWrap .mall-hero-scroll-cue::before {
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -1.25px;
  width: 2.5px;
  height: 68px;
  background: var(--mall-scroll-cue-ink);
  content: "";
  animation: mall-scroll-cue-elasticus 1.2s cubic-bezier(1, 0, 0, 1) infinite;
  transform-origin: 0 0;
}

#mallWrap .mall-hero-scroll-cue__arrow {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto 8px;
}

#mallWrap .mall-hero-scroll-cue__arrow::after {
  content: "";
  display: block;
  width: 11px;
  height: 11px;
  margin: 0 auto;
  border-top: 2.5px solid var(--mall-scroll-cue-ink);
  border-right: 2.5px solid var(--mall-scroll-cue-ink);
  transform: rotate(135deg);
}

#mallWrap .mall-hero-scroll-cue__title {
  display: block;
  text-transform: uppercase;
  color: var(--mall-scroll-cue-ink);
  font-family: "Oswald", "Pretendard Variable", Pretendard, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.2;
}

@keyframes mall-scroll-cue-elasticus {
  0% {
    transform-origin: 0 0;
    transform: scaleY(0);
  }
  50% {
    transform-origin: 0 0;
    transform: scaleY(1);
  }
  50.1% {
    transform-origin: 0 100%;
    transform: scaleY(1);
  }
  100% {
    transform-origin: 0 100%;
    transform: scaleY(0);
  }
}

@media (max-width: 900px) {
  #mallWrap .mall-hero-scroll-cue {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #mallWrap .mall-hero-scroll-cue::before {
    animation: none;
    transform: scaleY(1);
    opacity: 0.75;
  }
  #mallWrap .mall-hero-scroll-cue {
    transition: none;
  }
}

/* ── PC 필터 FAB (좌측 하단 · back to top 과 대칭) ── */
.mall-filter-fab {
  position: fixed;
  left: max(20px, env(safe-area-inset-left, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(20, 24, 22, 0.1);
  border-radius: 50%;
  cursor: pointer;
  color: var(--mall-brand, #2eac39);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 18px rgba(15, 22, 18, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.92);
  pointer-events: none;
  transition:
    opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.4s,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-tap-highlight-color: transparent;
}

.mall-filter-fab svg {
  width: 22px;
  height: 22px;
}

.mall-filter-fab.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mall-filter-fab:hover,
.mall-filter-fab:focus-visible {
  color: #fff;
  background: var(--mall-brand, #2eac39);
  border-color: transparent;
  box-shadow: 0 6px 22px rgba(46, 172, 57, 0.28);
}

.mall-filter-fab:focus-visible {
  outline: none;
  box-shadow:
    0 6px 22px rgba(46, 172, 57, 0.28),
    0 0 0 3px rgba(46, 172, 57, 0.35);
}

.mall-filter-fab:active {
  transform: translateY(0) scale(0.96);
}

@media (max-width: 900px) {
  .mall-filter-fab,
  #mallWrap .mall-filter-modal {
    display: none !important;
  }
}

/* ── PC 필터 모달 (좌측 시트 · cart-drawer 와 동일 easing) ── */
#mallWrap .mall-filter-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  visibility: hidden;
}

#mallWrap .mall-filter-modal:not(.hidden) {
  visibility: visible;
}

#mallWrap .mall-filter-modal.is-open {
  pointer-events: auto;
}

#mallWrap .mall-filter-modal__backdrop {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  cursor: pointer;
  background: rgba(12, 20, 36, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-sheet, 0.34s) var(--ease-sheet, cubic-bezier(0.32, 0.72, 0, 1));
}

#mallWrap .mall-filter-modal.is-open .mall-filter-modal__backdrop {
  opacity: 1;
  pointer-events: auto;
}

#mallWrap .mall-filter-modal__panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 24px));
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  background: linear-gradient(180deg, #fff 0%, var(--mall-warm, #f3f2ef) 100%);
  border-right: 1px solid var(--mall-linesoft, rgba(42, 47, 53, 0.06));
  box-shadow: 8px 0 30px rgba(15, 27, 51, 0.14);
  transform: translate3d(-100%, 0, 0);
  backface-visibility: hidden;
  transition:
    transform var(--dur-sheet, 0.34s) var(--ease-sheet, cubic-bezier(0.32, 0.72, 0, 1)),
    box-shadow var(--dur-sheet, 0.34s) var(--ease-soft, cubic-bezier(0.22, 1, 0.36, 1));
  overflow: hidden;
}

#mallWrap .mall-filter-modal.is-open .mall-filter-modal__panel {
  transform: translate3d(0, 0, 0);
}

#mallWrap .mall-filter-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: max(18px, env(safe-area-inset-top, 0px) + 12px) 16px 14px max(18px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--mall-linesoft, rgba(42, 47, 53, 0.06));
  background: rgba(255, 255, 255, 0.92);
}

#mallWrap .mall-filter-modal__head-copy {
  min-width: 0;
}

#mallWrap .mall-filter-modal__kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mall-muted, #767d86);
}

#mallWrap .mall-filter-modal__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--mall-ink, #2a2f36);
  line-height: 1.25;
}

#mallWrap .mall-filter-modal__close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--mall-warm, #f3f2ef);
  border: 1px solid var(--mall-linesoft, rgba(42, 47, 53, 0.06));
}

#mallWrap .mall-filter-modal__close svg {
  width: 18px;
  height: 18px;
}

#mallWrap .mall-filter-modal__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px max(18px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
}

#mallWrap .mall-filter-modal__body .filters--premium {
  position: static;
  top: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  gap: 12px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#mallWrap .mall-filter-modal__body .filters--premium .filters-title,
#mallWrap .mall-filter-modal__body .filter-section--search .filter-section-heading {
  display: none;
}

#mallWrap .mall-filter-modal__body .filter-section {
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--mall-linesoft, rgba(42, 47, 53, 0.06));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

#mallWrap .mall-filter-modal__body .filter-section--search {
  padding-top: 12px;
  padding-bottom: 12px;
}

#mallWrap .mall-filter-modal__body .filter-reset {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: 4px;
  padding-top: 14px;
  padding-bottom: 4px;
  background: linear-gradient(180deg, transparent 0%, var(--mall-warm, #f3f2ef) 28%);
}

/* 필터를 모달로 옮겨도 카탈로그 2열 폭 유지 — 뒤 화면이 넓어지며 ‘확대’된 것처럼 보이지 않게 */
#mallWrap .mall-filter-sidebar-spacer {
  display: block;
  width: 100%;
  min-height: 1px;
  visibility: hidden;
  pointer-events: none;
}

/* 모바일 /m/ — 심플 FAB (kinetic 없음, m-motion.js) */
.m-back-to-top {
  position: fixed;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--m-back-to-top-bottom, 20px) + var(--m-safe-bottom, 0px));
  /* 하단 탭(50)·CTA(55) 위 — [hidden] display:none 과 분리해 is-visible 만으로 토글 */
  z-index: 58;
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--mall-line, rgba(15, 22, 18, 0.1));
  border-radius: 50%;
  cursor: pointer;
  color: var(--mall-charcoal-deep, #353a42);
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--mall-card-border, rgba(42, 47, 53, 0.1));
  box-shadow: var(--mall-card-shadow, 0 4px 16px rgba(42, 47, 53, 0.08));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 0.32s ease,
    visibility 0.32s,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-tap-highlight-color: transparent;
}

.m-back-to-top.is-visible {
  display: flex;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.m-back-to-top:active {
  transform: translateY(0) scale(0.96);
}

.m-back-to-top:focus-visible {
  outline: none;
  box-shadow:
    var(--mall-card-shadow, 0 4px 16px rgba(42, 47, 53, 0.08)),
    0 0 0 3px var(--mall-focus-ring, rgba(46, 172, 57, 0.28));
}

html.m-app-root.m-app--has-nav {
  --m-back-to-top-bottom: calc(var(--m-bottom-nav-h, 62px) + 14px);
}

html.m-app-root.m-app--has-cta {
  --m-back-to-top-bottom: calc(var(--m-nav-offset, 62px) + var(--m-cta-stack, 68px) + 10px);
}

html.m-app-root.m-app--has-cta:not(.m-app--has-nav) {
  --m-back-to-top-bottom: calc(var(--m-cta-stack, 68px) + 14px);
}

html.m-app-root:has(.m-view[data-view="checkout"].is-active) {
  --m-back-to-top-bottom: calc(72px + 8px);
}

@media (prefers-reduced-motion: reduce) {
  .m-back-to-top,
  .m-back-to-top.is-visible {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mall-filter-fab,
  .mall-filter-fab.is-visible,
  #mallWrap .mall-filter-modal__backdrop,
  #mallWrap .mall-filter-modal__panel {
    transition: none !important;
  }

  #mallWrap .mall-filter-modal.is-open .mall-filter-modal__panel {
    transform: translate3d(0, 0, 0);
  }

  .kinetic-badge .badge-text {
    animation: none;
  }

  .kinetic-badge:hover .badge-text,
  .kinetic-badge:focus-visible .badge-text {
    animation: none;
  }

  .mall-back-to-top.kinetic-badge,
  .mall-back-to-top.kinetic-badge.is-visible {
    transition: none;
  }

  .kinetic-badge .badge-icon,
  .kinetic-badge:hover .badge-icon,
  .kinetic-badge:focus-visible .badge-icon,
  .kinetic-badge .badge-icon--down,
  .kinetic-badge:hover .badge-icon--down,
  .kinetic-badge:focus-visible .badge-icon--down {
    transform: rotate(0deg);
    transition: none;
  }
}
