/* 전역 리셋 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================= */
/* 공통 헤더 스타일 - 피그마 디자인 */
/* ============================= */

/* 앱 헤더 (56px) - 단일 줄 구조 */
.app-header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background-color: #ffffff;
  position: relative;
}

/* 헤더 버튼 공통 */
.header-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* 버튼 placeholder (뒤로가기 없을 때 공간 유지) */
.header-btn-placeholder {
  width: 28px;
  height: 28px;
}

/* 헤더 제목 - 중앙 정렬 */
.app-header-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-family: 'Noto Sans', 'Noto Sans KR', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #171717;
  letter-spacing: -0.32px;
  line-height: 24px;
  text-align: center;
  white-space: nowrap;
}

/* 오른쪽 버튼 그룹 */
.header-right-btns {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 햄버거 메뉴 버튼 */
.hamburger-menu {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* 레거시 헤더 스타일 (기존 페이지 호환용) */
.header {
  height: clamp(48px, 5.2vh, 56px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 480px;
  height: 100%;
  margin: 0 auto;
  background-color: #ffffff;
  box-shadow: inset 0 -1px 0 #f2f5f8;
  position: relative;
}

@media (min-width: 769px) {
  .header-inner { max-width: 420px; }
}

.header-brand .header-inner {
  justify-content: space-between;
}

.header-nav .header-inner {
  justify-content: center;
}

/* 로고 */
.logo {
  color: #0065ff;
  font-size: clamp(12px, 3.5vw, 16px);
  font-weight: 900;
  letter-spacing: -0.27px;
  line-height: 21px;
  margin-top: 6px;
  margin-bottom: 6px;
  padding-left: 12px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* 레거시 햄버거 라인 스타일 */
.hamburger-line {
  width: clamp(18px, 4.5vw, 24px);
  height: clamp(2.5px, 0.8vw, 3.5px);
  background-color: #0065ff;
  border-radius: 1.5px;
}

/* 레거시 뒤로가기 버튼 */
.header-back-button {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.back-icon {
  width: 24px;
  height: 24px;
  background-image: url('/images/arrow_back_ios_24dp.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: block;
}

/* 레거시 페이지 타이틀 */
.header-title {
  margin: 0;
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 900;
  color: #383838;
  letter-spacing: -0.304px;
  line-height: 24px;
  text-align: center;
}

@media (min-width: 769px) {
  .header { height: 52px; }
  .logo { font-size: 14px; }
  .header-title { font-size: 16px; }
}


/* ============================= */
/* 공통 유틸리티 & 컴포넌트       */
/* ============================= */

/* 오프캔버스 사이드 메뉴 */
.side-menu__backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35); backdrop-filter: saturate(140%) blur(0.5px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 9998;
}
.side-menu {
  position: fixed; top: 0; right: 0; width: 78vw; max-width: 360px; height: 100vh; background: #fff;
  transform: translateX(100%); transition: transform .28s ease; z-index: 9999; box-shadow: none;
  display: flex; flex-direction: column;
}
.side-menu.open { transform: translateX(0); box-shadow: -8px 0 20px rgba(0,0,0,.12); }
.side-menu__backdrop.open { opacity: 1; pointer-events: auto; }
.side-menu__header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #f0f2f5; }
.side-menu__title { font-weight: 900; color: #2d2d2d; }
.side-menu__close { background: transparent; border: none; font-size: 22px; line-height: 1; padding: 6px 8px; cursor: pointer; color: #405469; }
.side-menu__body { padding: 6px 8px; overflow-y: auto; }
.side-menu__body ul { list-style: none; padding: 0; margin: 0; }
.side-link { display: block; width: 100%; text-align: left; padding: 14px 12px; border-radius: 8px; color: #2d2d2d; text-decoration: none; font-weight: 800; }
.side-link:hover { background: #f6f8fb; }
.btn-plain { background: transparent; border: none; cursor: pointer; font: inherit; color: inherit; }

/* 1) 레이아웃/컨테이너 */
.app-container { width: 100%; max-width: 100vw; margin: 0 auto; }
.max-w-1200 { max-width: 1200px; }
.w-100 { width: 100%; }

/* Grid/Flex */
.grid { display: grid; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.grid-gap-24 { gap: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-12 { gap: 12px; }
.gap-24 { gap: 24px; }

/* Spacing */
.p-16 { padding: 16px; }
.px-24 { padding-left: 24px; padding-right: 24px; }
.py-24 { padding-top: 24px; padding-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* 2) 타이포/컬러 */
.text-title { color: #405469; font-weight: 900; letter-spacing: -0.3px; }
.text-price { color: #2d2d2d; font-weight: 800; letter-spacing: -0.34px; }
.text-primary { color: #0065ff; }
.text-muted { color: #7090b0; }
.text-inverse { color: #ffffff; }
.text-gradient-primary {
  background: linear-gradient(90deg, #0065ff 0%, #0416a4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 3) 버튼 */
.btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.btn-block { display: block; width: 100%; }
.btn-round { border-radius: 24px; }
.btn-primary { background-color: #0065ff; color: #ffffff; }
.btn-primary:hover { background-color: #0052cc; }
.btn-secondary { background-color: #f3f3f3; color: #405469; }
.btn-secondary:hover { background-color: #e8e8e8; }
.btn-outline { background-color: #ffffff; color: #0065ff; border: 1px solid #0065ff; }
.btn-outline:hover { background-color: #eef4ff; }

/* 4) 카드/미디어 */
.card { background-color: #ffffff; border-radius: 12px; overflow: hidden; }
.card-shadow { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
/* .card--product - 제품 카드 전용 여지는 페이지 CSS에서 정의 */

.media { position: relative; width: 100%; height: 100%; overflow: hidden; }
.media-cover { width: 100%; height: 100%; object-fit: cover; }
.media-contain { width: 100%; height: 100%; object-fit: contain; }
.img-rounded { border-radius: 12px; }
.img-circle { border-radius: 50%; }
.no-user-drag { -webkit-user-drag: none; user-select: none; }

/* 5) 배지 */
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; }
.badge--reward { background-color: #0065ff; color: #ffffff; }
.badge-text-sm { font-size: 12px; font-weight: 700; }
.badge-text-md { font-size: 14px; font-weight: 800; }
.badge-text-lg { font-size: 16px; font-weight: 900; }

/* 6) 캐러셀(슬라이더) */
.carousel { display: flex; gap: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.carousel--snap-x { scroll-snap-type: x mandatory; }
.carousel__card { scroll-snap-align: center; scroll-snap-stop: always; flex-shrink: 0; }
.snap-center { scroll-snap-align: center; }
.snap-stop-always { scroll-snap-stop: always; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.overscroll-contain { overscroll-behavior-x: contain; }
.touch-pan-x { touch-action: pan-y pan-x; }
.cursor-grab { cursor: grab; }
.cursor-grabbing { cursor: grabbing; }

/* 7) 탭(언더라인) */
.tabs { position: relative; }
.tab { background: transparent; border: none; cursor: pointer; }
.tab--active { color: #313131; }
.tabs__underline { position: relative; height: 2px; background-color: transparent; display: block; }

/* 8) 정보 패널/메타 */
.info-panel { padding: 16px; }
.info-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }

/* 9) 칩(해시태그) */
.chip { display: inline-flex; align-items: center; border-radius: 24px; padding: 10px 14px; font-weight: 900; }
.chip--hash { background-color: #f2f5f8; color: #7090b0; }

/* 10) 아코디언 */
.accordion { background: #ffffff; }
.accordion__item { border-bottom: 1px solid #e0e0e0; }
.accordion__trigger { width: 100%; background-color: #f3f3f3; padding: 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.accordion__trigger[aria-expanded="true"] { background-color: #eef2f7; }
.accordion__panel[hidden] { display: none; }
.accordion__panel { background: #fff; }
.accordion__title { font-weight: 800; margin: 6px 0 8px; }

/* ============================= */
/* 푸터 스타일                    */
/* ============================= */

.site-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e5e7eb;
  padding: clamp(24px, 6vw, 40px) clamp(16px, 4vw, 24px);
  margin-top: clamp(40px, 10vw, 60px);
  width: 100%;
}

.footer-content {
  max-width: 480px;
  margin: 0 auto;
}

@media (min-width: 769px) {
  .footer-content {
    max-width: 420px;
  }
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.5vw, 8px);
}

.footer-line {
  color: #6b7280;
  font-size: clamp(11px, 2.8vw, 13px);
  font-weight: 400;
  line-height: clamp(16px, 4vw, 20px);
  letter-spacing: -0.02em;
  margin: 0;
}

.footer-line strong {
  color: #4b5563;
  font-weight: 600;
}

/* ============================= */
/* 공통 메시지 모달               */
/* ============================= */

.popup_layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.popup_layer.show {
  display: flex;
}

.popup_box {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.popup_cont {
  margin-bottom: 20px;
  text-align: center;
}

.popup_cont p {
  font-size: 16px;
  line-height: 1.5;
  color: #111;
}

.btn-area {
  display: flex;
  gap: 8px;
}

.btn-48 {
  flex: 1;
  height: 48px;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.type-fill__samga-pri {
  background: #0065ff;
  color: #fff;
}

.type-fill__samga-sec {
  background: #f3f4f6;
  color: #666;
}

.txt-body01 {
  font-size: 16px;
}

.txt-body02 {
  font-size: 14px;
}

.bold {
  font-weight: 700;
}
