/* ── 배너 드래그 ── */
.banner-wrap { user-select: none; -webkit-user-drag: none; }
.banner-wrap img { pointer-events: none; -webkit-user-drag: none; user-select: none; }

/* ── 전체 배경 (폰 프레임 바깥) ── */
body {
  background: linear-gradient(135deg, #f2d4bc 0%, #e8c4a0 100%);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-family: var(--font-base, 'Noto Sans KR', sans-serif);
}

/* ── 폰 래퍼 ── */
.phone {
  width: 100%;
  max-width: 390px;
  height: 100dvh;
  background: var(--color-surface, #FEF5EE);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* iOS flex 자식 스크롤 보장 */
.phone > * { min-height: 0; }

/* .phone 내 모든 세로 스크롤 컨테이너 수평 바운스 방지 */
.phone, .phone * {
  overscroll-behavior-x: none;
}


/* 스크롤바 숨기기 + 터치 스크롤 활성화 */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

/* 카드 호버 */
.store-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.store-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}

/* 입장하기 버튼 */
.btn-enter {
  background: linear-gradient(135deg, var(--color-primary, #D97B50), var(--color-primary-dark, #C46840));
  transition: opacity 0.15s;
}
.btn-enter:active { opacity: 0.85; }

/* 하트 애니메이션 */
.heart-btn { transition: transform 0.15s ease; }
.heart-btn:active { transform: scale(1.35); }

/* 카테고리 칩 — 터치 수평 스크롤 허용 */
.chip { transition: all 0.15s ease; touch-action: manipulation; }
.chip:active { transform: scale(0.96); }

/* 칩 컨테이너: 터치로 pan-x 가능하게 */
.chip-wrap {
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

/* 이미지 skeleton shimmer */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.img-skeleton {
  background: linear-gradient(90deg, #f5e2d4 25%, #fce9da 50%, #f5e2d4 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}
.img-frame {
  border: 1px solid #e8e8e8;
}

/* 태그 pill */
.tag-pill {
  border: 1.5px solid var(--color-primary, #D97B50);
  color: var(--color-primary, #D97B50);
  font-size: 0.68rem;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 500;
}
/* 12개월 반값 — "이달의 특가" 스타일 */
.tag-pill.promo-half {
  background: #FFF0EE;
  color: #E84040;
  border: none;
}
/* 타사보상 */
.tag-pill.promo-comp {
  background: #EEF2FF;
  color: #3B6FE0;
  border: none;
}
/* 신규/런칭 */
.tag-pill.promo-new {
  background: #E6F9F2;
  color: #0E7A56;
  border: none;
}
/* 한정/특가 */
.tag-pill.promo-hot {
  background: #FFF4E0;
  color: #C07000;
  border: none;
}
/* 베스트/추천 */
.tag-pill.promo-best {
  background: #F3EEFF;
  color: #6B21A8;
  border: none;
}

/* 네비 버튼 고정 높이 — 아이콘 종류 무관하게 일정 */
nav button {
  height: 52px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
nav button svg,
nav button i {
  display: block;
  flex-shrink: 0;
}

/* 네비 아이콘 active dot */
.nav-active { color: var(--color-primary, #D97B50); }
.nav-active .nav-dot {
  display: block;
  width: 4px; height: 4px;
  background: var(--color-primary, #D97B50);
  border-radius: 50%;
  margin: 2px auto 0;
}
.nav-dot { display: none; }

/* 상단 status bar 여백 */
.status-bar { height: env(safe-area-inset-top, 44px); }

/* 글래스 헤더 */
.glass-header {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--color-surface, #FEF5EE);
  transition: padding 0.35s ease, box-shadow 0.3s ease;
}

/* 슬림 전환 대상들 */
#logoNormal {
  overflow: hidden;
  max-height: 60px;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.3s ease;
}
#logoSlim {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.35s ease;
}

/* 슬림 모드는 JS inline style로 직접 제어 (CSS 충돌 방지) */

/* ── 카테고리 드로어 ── */
.drawer-cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.drawer-cat-btn:active { background: var(--color-primary-light, #FEF0E6); }

.drawer-chevron {
  font-size: 11px;
  color: #bbb;
  transition: transform 0.25s ease;
}
.drawer-cat.open .drawer-chevron { transform: rotate(180deg); color: var(--color-primary, #D97B50); }

.drawer-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #FAFAFA;
}
.drawer-cat.open .drawer-sub { max-height: 300px; }

.drawer-sub-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 1rem 0.6rem 3.5rem;
  font-size: 13px;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  position: relative;
}
.drawer-sub-btn::before {
  content: '';
  position: absolute;
  left: 2.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-primary, #D97B50);
  opacity: 0.5;
}
.drawer-sub-btn:active { color: var(--color-primary, #D97B50); background: var(--color-primary-light, #FEF0E6); }

/* ── 최근 본 제품: 플로팅 버튼 ── */
.recent-fab {
  position: fixed;
  bottom: 136px;
  right: calc(50% - 175px);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 2px 14px rgba(0,0,0,0.15);
  z-index: 48;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.recent-fab:active { transform: scale(0.92); }
.recent-fab img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
}
.recent-fab .recent-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  background: var(--color-primary, #D97B50);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

/* ── 최근 본 제품: 바텀시트 오버레이 ── */
.recent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 1000; /* 챗봇(990) 위로 */
  pointer-events: none;
  transition: background 0.3s ease;
}
.recent-overlay.open {
  background: rgba(0,0,0,0.45);
  pointer-events: auto;
}

/* ── 최근 본 제품: 바텀시트 패널 ── */
.recent-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 390px;
  max-height: 70vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 1001; /* 챗봇(990) 위로 */
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.12);
}
.recent-overlay.open + .recent-sheet,
.recent-sheet.open {
  transform: translate(-50%, 0);
}
.recent-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  flex-shrink: 0;
}
.recent-sheet-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  margin: 0;
}
.recent-sheet-header button {
  font-size: 12px;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
}
.recent-sheet-header button:active { color: var(--color-primary, #D97B50); }
.recent-sheet-handle {
  width: 36px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}
.recent-sheet-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 20px;
  -webkit-overflow-scrolling: touch;
}

/* 바텀시트 제품 카드 */
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
}
.recent-item:last-child { border-bottom: none; }
.recent-item:active { background: var(--color-surface, #FEF5EE); }
.recent-item-img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #f5f5f5;
  flex-shrink: 0;
}
.recent-item-info {
  flex: 1;
  min-width: 0;
}
.recent-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-item-code {
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}
.recent-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary, #D97B50);
  margin-top: 4px;
}
.recent-item-price span {
  font-size: 11px;
  font-weight: 400;
  color: #999;
}
.recent-item-del {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f5f5f5;
  color: #bbb;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.recent-item-del:active { background: #eee; color: #888; }

/* 빈 상태 */
.recent-empty {
  text-align: center;
  padding: 40px 0;
  color: #bbb;
  font-size: 13px;
}

/* ── 메인 베스트 카테고리 탭 ── */
.best-tab-wrap {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
.best-tab-wrap::-webkit-scrollbar { display: none; }
.best-tab {
  flex-shrink: 0;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1.5px solid var(--color-primary-light, #FEF0E6);
  background: var(--color-primary-light, #FEF0E6);
  color: var(--color-primary-dark, #C46840);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.best-tab.active {
  background: var(--color-primary, #D97B50);
  border-color: var(--color-primary, #D97B50);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.best-tab:active { opacity: 0.85; }
.best-empty {
  text-align: center;
  padding: 30px 20px;
  color: #aaa;
  font-size: 13px;
}

/* ============================================================
   스타일 패키지 4종 (Phase 7)
   body class에 pack-* 가 붙으면 토큰 6종을 :root에 오버라이드
   - DB style_pack 값이 우선이지만, 개별 토큰(radius_card 등)이 NULL이면 패키지 기본값 사용
   - admin/site_design 페이지에서 패키지 카드 선택 시 즉시 적용
   ============================================================ */

/* ── Classic: 정돈된 기본 (웅진프라자 외관 = 현재값) ── */
body.pack-classic {
  --radius-card:  18px;
  --radius-btn:   999px;
  --shadow-card:  0 2px 12px rgba(0,0,0,0.06);
}

/* ── Friendly: 친근·캐릭터 (또또렌탈 추천) ── */
body.pack-friendly {
  --radius-card:  20px;
  --radius-btn:   999px;
  --shadow-card:  0 8px 28px rgba(0,0,0,0.10);
}
body.pack-friendly .product-card { padding: 16px; }

/* ── Modern: 비즈니스·미니멀 ── */
body.pack-modern {
  --radius-card:  6px;
  --radius-btn:   8px;
  --shadow-card:  0 4px 16px rgba(0,0,0,0.08);
}
body.pack-modern .product-card { border: 1px solid #eee; }

/* ── Sharp: 강한·인더스트리얼 ── */
body.pack-sharp {
  --radius-card:  0;
  --radius-btn:   4px;
  --shadow-card:  none;
}
body.pack-sharp .product-card { border: 2px solid var(--color-primary, #D97B50); }

