/* styles.css - Clean, Minimalist High-End Design System */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
  --primary-accent: #2563eb;
  --kakaopay-yellow: #FEE500;
  --kakaopay-black: #191919;
}

* {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 부드러운 테마 전환 및 가로 스크롤 방지 */
html {
  scroll-behavior: smooth;
  transition: background-color 0.2s ease, color 0.2s ease;
  overflow-x: hidden;
  width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

/* 정갈한 스크롤바 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* 헤더 글래스모피즘 - 미니멀하고 투명감 있게 */
.clean-header {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.dark .clean-header {
  background-color: rgba(10, 15, 29, 0.85);
  border-bottom: 1px solid rgba(30, 41, 59, 0.8);
}
html:not(.dark) .clean-header {
  background-color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(241, 245, 249, 1);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02);
}

/* 미니멀 카드 호버 */
.clean-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.clean-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.06);
}
.dark .clean-card:hover {
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.3);
}

/* 장바구니 드로어 */
.drawer-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
.drawer-panel {
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer-backdrop.active .drawer-panel {
  transform: translateX(0);
}

/* 모달 애니메이션 */
.modal-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  transform: scale(0.97) translateY(8px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Q&A 아코디언 애니메이션 */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.accordion-content.expanded {
  max-height: 800px;
}

/* 토스트 알림 */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  opacity: 0;
  transform: translateY(0.75rem) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 카카오페이 */
.bg-kakaopay {
  background-color: var(--kakaopay-yellow);
}
.text-kakaopay {
  color: var(--kakaopay-black);
}

/* ==================== 플로팅 윙바 반응형 최적화 ==================== */
#floating-wing-bar {
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15), 0 0 1px 1px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}
.dark #floating-wing-bar {
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.08);
}

/* 모바일 딤 배경 오버레이 */
#wing-mobile-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#wing-mobile-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* 모바일 및 태블릿 (< 1024px): 본문을 침범하지 않도록 기본 슬라이드-아웃 상태 */
@media (max-width: 1023px) {
  #floating-wing-bar {
    right: 0 !important;
    top: 50% !important;
    transform: translate3d(100%, -50%, 0) !important;
    z-index: 45;
  }
  
  /* 사용자가 퀵메뉴 탭을 클릭하여 열었을 때 */
  #floating-wing-bar.mobile-open {
    transform: translate3d(0, -50%, 0) !important;
    box-shadow: -8px 0 35px rgba(0, 0, 0, 0.4);
  }

  #floating-wing-bar.mobile-open #wing-toggle-arrow {
    transform: rotate(180deg);
  }
}

/* 데스크톱 화면 (>= 1024px): 항상 우측 여백에 고정 */
@media (min-width: 1024px) {
  #floating-wing-bar {
    transform: translateY(-50%) !important;
    right: 1rem !important;
  }
  #wing-toggle-btn {
    display: none !important;
  }
  #wing-mobile-backdrop {
    display: none !important;
  }
}

/* 카테고리 플라이아웃 메뉴 (Image 3) */
#category-menu {
  animation: categoryFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes categoryFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 쇼케이스 칩 스크롤바 숨김 */
.scrollbar-none::-webkit-scrollbar {
  display: none;
}
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
