/* ── 배너 드래그 ── */
.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;
}
/* 소셜프루프(신뢰 지표) 배지 — b2b.asp 담당자 블록 */
.tag-pill.trust {
  background: var(--color-primary-light, #FEF0E6);
  color: var(--color-primary-dark, #C46840);
  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;
}
/* 소분류 개수만큼 늘어나야 한다. 300px 고정이던 시절 침대(전체보기+9개 = 약 380px)에서
   마지막 항목(모션베드)이 overflow:hidden 에 잘려 안 보이는 문제가 있었다.
   카테고리가 더 늘어도 잘리지 않도록 여유를 두고, 화면을 넘기면 내부 스크롤로 접근한다. */
.drawer-cat.open .drawer-sub { max-height: 70vh; overflow-y: auto; }

.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); }

/* ═══════════════════════════════════════════════════════════
   메인 이용후기 캐러셀
   PC(pc_asp)는 4열 그리드지만 모바일은 폭이 좁아 카드를 한 장씩 꽉 채우고
   좌우 스와이프로 넘긴다. scroll-snap 으로 카드가 딱 맞게 멈춘다.
   ═══════════════════════════════════════════════════════════ */
.rv-teaser { margin: 0 0 18px; }
.rv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rv-head h2 { font-size: 17px; font-weight: 700; color: #333; }
.rv-swipe { flex-shrink: 0; font-size: 10.5px; font-weight: 500; color: #bbb; }
.rv-swipe i { font-size: 9px; }

/* 메인 배너(.banner-wrap)와 같은 방식 — 네이티브 overflow 스크롤이 아니라
   transform 이동 + 직접 구현한 드래그를 쓴다. .phone * 의 overscroll-behavior 제약과
   PC 마우스 드래그 부재를 둘 다 피할 수 있고, 이미 배너에서 검증된 방식이다. */
.rv-view { overflow: hidden; cursor: grab; }
.rv-view.drag { cursor: grabbing; }
.rv-view.drag a { pointer-events: none; }   /* 드래그가 링크 클릭으로 이어지지 않게 */
.rv-track { display: flex; gap: 8px; will-change: transform; }

/* 카드 폭을 좀게 잡아 다음 카드가 크게 보이게 한다 — 스와이프할 거리가 있다는 게 바로 보인다.
   1:1 사진은 폭이 곷 높이라, 폭을 줄여야 카드 전체가 커지지 않는다. */
.rv-card {
  flex: 0 0 62%;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid #f0f0f0; border-radius: 12px;
  overflow: hidden; box-shadow: 0 1px 5px rgba(0,0,0,.04);
}

/* 후기 사진은 세로/가로 비율이 제각각이라 cover 로 채우면 인물·제품이 잘려 나갔다.
   → 같은 사진을 배경으로 깔아 흐리게 만들고, 그 위에 원본을 contain 으로 얹는다.
     (레터박스가 배경과 자연스럽게 섞여 잘림 없이 카드 높이는 일정하게 유지된다) */
.rv-photo {
  position: relative; width: 100%; aspect-ratio: 1/1; overflow: hidden;
  background-color: #f2f2f2; background-size: cover; background-position: center;
}
.rv-photo::after {
  content: ''; position: absolute; inset: 0;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  background: rgba(255,255,255,.28);
}
.rv-photo img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.rv-photo.noimg { display: none; }   /* CDN 에 사진이 없으면 사진 영역째로 접는다 */

.rv-body { padding: 8px 10px 9px; display: flex; flex-direction: column; gap: 4px; }
.rv-top { display: flex; align-items: center; gap: 6px; }
.rv-cat {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  color: var(--color-primary-dark, #C46840); background: var(--color-primary-light, #FEF0E6);
}
.rv-stars { font-size: 10px; color: #FFB400; letter-spacing: -0.5px; }
/* 2줄 고정 — 후기 길이가 제각각이면 캐러셀에서 카드 높이가 들쭉날쭉해진다 */
.rv-text {
  font-size: 12.5px; line-height: 1.5; color: #555;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 37px;
}
.rv-meta { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: #aaa; min-width: 0; }
.rv-meta .nm { font-weight: 600; color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-meta .who { flex-shrink: 0; }

.rv-dots { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
.rv-dots span { width: 5px; height: 5px; border-radius: 50%; background: #ddd; transition: all .2s; }
.rv-dots span.on { width: 14px; border-radius: 3px; background: var(--color-primary, #D97B50); }

/* ═══════════════════════════════════════════════════════════
   이용후기 상세 바텀시트 (모바일)
   카드를 누르면 제품 상세로 이동해 버려 "후기를 읽으려던" 맥락이 끊겼다
   → 전문·사진을 이 자리에서 보여주고, 제품으로 가는 건 안에서 고르게 한다.
   동작/z-index 는 공유 바텀시트(#shareSheet)와 같은 규약을 따른다.
   ═══════════════════════════════════════════════════════════ */
.rvs-dim {
  position: fixed; inset: 0; background: rgba(0,0,0,0);
  pointer-events: none; transition: background .25s; z-index: 8000;
}
.rvs-dim.open { background: rgba(0,0,0,0.45); pointer-events: auto; }

.rvs-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8001;
  max-width: 390px; margin: 0 auto;
  background: #fff; border-radius: 20px 20px 0 0;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  display: flex; flex-direction: column; max-height: 88dvh;
}
.rvs-sheet.open { transform: translateY(0); }

.rvs-grip { width: 36px; height: 4px; background: #e0e0e0; border-radius: 2px; margin: 10px auto 4px; flex-shrink: 0; }
.rvs-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 18px 10px; flex-shrink: 0;
}
.rvs-title { font-size: 15px; font-weight: 700; color: #222; }
.rvs-close { border: none; background: none; font-size: 22px; line-height: 1; color: #999; padding: 2px 4px; cursor: pointer; }

/* 본문만 스크롤 — 하단 CTA 는 항상 보이게 고정한다 */
.rvs-body { overflow-y: auto; padding: 0 18px 16px; -webkit-overflow-scrolling: touch; }
.rvs-photo {
  width: 100%; border-radius: 12px; overflow: hidden; margin-bottom: 12px;
  background: #f4f4f4; max-height: 46dvh; display: flex; align-items: center; justify-content: center;
}
.rvs-photo img { width: 100%; height: auto; max-height: 46dvh; object-fit: contain; display: block; }
.rvs-photo.noimg { display: none; }

.rvs-top { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.rvs-cat {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  color: var(--color-primary-dark, #C46840); background: var(--color-primary-light, #FEF0E6);
}
.rvs-stars { font-size: 11.5px; color: #FFB400; letter-spacing: -0.5px; }
.rvs-date { margin-left: auto; font-size: 11px; color: #aaa; }
/* 후기 전문 — 줄바꿈을 살린다 */
.rvs-text { font-size: 14px; line-height: 1.7; color: #444; white-space: pre-line; }
.rvs-who { margin-top: 10px; font-size: 12px; font-weight: 600; color: #888; }

.rvs-foot {
  flex-shrink: 0; border-top: 1px solid #f0f0f0;
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
}
.rvs-pwrap { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rvs-plabel { font-size: 10.5px; color: #aaa; }
.rvs-pname { font-size: 13px; font-weight: 700; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rvs-go {
  margin-left: auto; flex-shrink: 0; padding: 12px 20px; border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary, #D97B50), var(--color-primary-dark, #C46840));
  color: #fff; font-size: 13.5px; font-weight: 700; white-space: nowrap;
}
