/* ================================================================
   MAINSHOP.CSS — 전설의쿠지샵 구매샵 전용 스타일
   완전 독립 CSS (style.css 의존 없음)
   ================================================================ */

/* ── 리셋 & 기본 ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --brand:       #5046e5;
  --brand-dark:  #3730a3;
  --brand-light: #818cf8;
  --accent:      #7c3aed;
  --surface:     #ffffff;
  --surface-2:   #f8fafc;
  --border:      #e2e8f0;
  --border-2:    #cbd5e1;
  --text-1:      #0f172a;
  --text-2:      #334155;
  --text-3:      #64748b;
  --text-4:      #94a3b8;
  --danger:      #ef4444;
  --success:     #22c55e;
  --warn:        #f59e0b;
  --nav-h:       60px;
  --bottom-nav:  56px;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:      0 4px 16px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:   0 10px 40px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.06);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR',
               -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  margin: 0; padding: 0;
  background: #f1f5f9;
  color: var(--text-1);
  min-height: 100vh;
  /* top padding = sticky header height (60px, JS로 동적 보정) */
  padding-top: var(--nav-h);
  /* bottom padding = bottom nav (56px) + safe area */
  padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom, 0px));
}

img { max-width: 100%; height: auto; }
a  { text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }

/* ── 유틸 ────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ================================================================
   1) 상단 헤더 (sticky)
   ================================================================ */
.ms-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border), 0 2px 12px rgba(80,70,229,.06);
}
/* 헤더 하단 퍼플 액센트 라인 */
.ms-header::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 50%, transparent 100%);
  opacity: .5;
}

.ms-header-inner {
  flex: 1;
  max-width: 1200px; margin: 0 auto;
  width: 100%; padding: 0 24px;
  height: 60px;
  display: flex; align-items: center; gap: 16px;
}

/* 로고 */
.ms-logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-1); flex-shrink: 0;
}
.ms-logo-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; font-weight: 900;
  box-shadow: 0 4px 16px rgba(99,102,241,.5), 0 1px 3px rgba(0,0,0,.15),
              inset 0 1px 0 rgba(255,255,255,.2);
  flex-shrink: 0;
  overflow: hidden;
  transition: box-shadow .2s, transform .15s;
}
.ms-logo:hover .ms-logo-mark {
  box-shadow: 0 6px 22px rgba(99,102,241,.65), 0 2px 6px rgba(0,0,0,.15),
              inset 0 1px 0 rgba(255,255,255,.25);
  transform: translateY(-1px);
}
.ms-logo-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.ms-logo-words { min-width: 0; }
.ms-logo-name {
  font-size: 15px; font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -.4px;
  line-height: 1;
}
.ms-logo-tagline {
  font-size: 9.5px; font-weight: 600;
  color: var(--text-4); margin-top: 3px; letter-spacing: .02em;
}

.ms-header-gap { flex: 1; }

/* 헤더 우측 사용자 영역 */
.ms-header-actions {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.ms-header-username {
  font-size: 13px; font-weight: 700; color: var(--text-2);
}
.ms-header-cart-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(80,70,229,.35);
  transition: opacity .15s, transform .1s;
  position: relative;
}
.ms-header-cart-btn:hover { opacity: .9; transform: translateY(-1px); }
.ms-header-cart-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid #fff;
}

/* 사업자 정보 바 — 헤더에서 제거됨 (푸터로 통합) */
.ms-info-bar { display: none !important; }
.ms-info-bar-sep { display: none !important; }

/* The header height is dynamic (auto), so JS adjusts body padding-top */

/* ================================================================
   2) 히어로 배너
   ================================================================ */
.ms-hero {
  background: linear-gradient(145deg,
    #0f172a 0%,
    #1e1b4b 40%,
    #312e81 75%,
    #4338ca 100%
  );
  position: relative; overflow: hidden;
  padding: 56px 24px 52px;
}
.ms-hero::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 15% 40%,
      rgba(99,102,241,.3) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 85% 20%,
      rgba(139,92,246,.25) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 50% 90%,
      rgba(79,70,229,.2) 0%, transparent 60%);
}
/* 장식 원 */
.ms-hero::after {
  content: '';
  position: absolute; top: -100px; right: -80px;
  width: 400px; height: 400px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.06);
  pointer-events: none;
}

.ms-hero-inner {
  max-width: 1200px; margin: 0 auto;
  position: relative; z-index: 1;
}

.ms-hero-label {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,.8);
  font-size: 10.5px; font-weight: 800;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 5px 14px; border-radius: 20px;
  margin-bottom: 18px;
}

.ms-hero-title {
  font-size: 42px; font-weight: 900;
  color: #fff; margin: 0 0 12px;
  line-height: 1.1; letter-spacing: -.8px;
}
.ms-hero-title em {
  font-style: normal;
  background: linear-gradient(90deg, #a5b4fc, #c4b5fd);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ms-hero-sub {
  font-size: 16px; color: rgba(255,255,255,.65);
  margin: 0 0 28px; line-height: 1.65; max-width: 540px;
}

.ms-hero-trust {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 32px;
}
.ms-hero-trust-item {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(6px);
  color: rgba(255,255,255,.9);
  font-size: 12px; font-weight: 700;
  padding: 7px 14px; border-radius: 8px;
}

.ms-hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; font-size: 14px; font-weight: 800;
  box-shadow: 0 6px 24px rgba(80,70,229,.5);
  transition: transform .15s, box-shadow .15s;
}
.ms-hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(80,70,229,.6);
}

/* ================================================================
   3) 이용방법 섹션 (How to Use)
   ================================================================ */
.ms-how {
  background: var(--surface);
  padding: 48px 24px;
  border-bottom: 1px solid var(--border);
}
.ms-how-inner {
  max-width: 1200px; margin: 0 auto;
}

.ms-section-title {
  font-size: 24px; font-weight: 900;
  color: var(--text-1); margin: 0 0 6px;
  letter-spacing: -.4px;
}
.ms-section-sub {
  font-size: 14px; color: var(--text-3);
  margin: 0 0 32px;
}

.ms-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.ms-step {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  position: relative;
  transition: box-shadow .2s, transform .2s;
}
.ms-step:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.ms-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; font-size: 16px; font-weight: 900;
  margin-bottom: 14px;
  box-shadow: 0 4px 10px rgba(80,70,229,.35);
}
.ms-step-title {
  font-size: 15px; font-weight: 800; color: var(--text-1);
  margin: 0 0 8px; letter-spacing: -.2px;
}
.ms-step-desc {
  font-size: 13px; color: var(--text-3); line-height: 1.6;
  margin: 0;
}

/* 화살표 구분자 (데스크톱) */
.ms-step-arrow {
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--border-2);
  align-self: center;
}
@media (max-width: 767px) {
  .ms-step-arrow { display: none; }
}

/* ================================================================
   4) 신뢰 지표 배너 (Trust Strip)
   ================================================================ */
.ms-trust-strip {
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  padding: 28px 24px;
}
.ms-trust-strip-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.ms-trust-item {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,.9);
}
.ms-trust-item-ico {
  font-size: 28px; flex-shrink: 0;
}
.ms-trust-item-label {
  font-size: 14px; font-weight: 800; color: #fff;
  margin-bottom: 2px;
}
.ms-trust-item-desc {
  font-size: 11.5px; color: rgba(255,255,255,.7);
}

/* ================================================================
   5) 상품 목록 섹션
   ================================================================ */
.ms-shop-section {
  max-width: 1200px; margin: 0 auto;
  padding: 28px 20px 0;
}

.ms-shop-header {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.ms-shop-header-left {
  display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0;
}
.ms-shop-header-title {
  font-size: 20px; font-weight: 900;
  color: var(--text-1); letter-spacing: -.4px;
  margin: 0;
}
.ms-shop-header-count {
  font-size: 12px; font-weight: 700; color: var(--text-4);
}

.ms-shop-sort select,
#sortSelectBuyShop {
  padding: 8px 32px 8px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--text-2); font-family: inherit;
  outline: none; cursor: pointer; transition: border-color .15s;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
}
.ms-shop-sort select:focus,
#sortSelectBuyShop:focus { border-color: var(--brand); }

/* ── 상품 그리드 ── */
.ms-product-grid, .shop-grid, #shopBuy {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding-bottom: 32px;
}
@media (min-width: 480px) {
  .ms-product-grid, .shop-grid, #shopBuy {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}
@media (min-width: 640px) {
  .ms-product-grid, .shop-grid, #shopBuy {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 900px) {
  .ms-product-grid, .shop-grid, #shopBuy {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 1200px) {
  .ms-product-grid, .shop-grid, #shopBuy {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ══════════════════════════════════════════════
   상품 카드 (완전 재설계)
══════════════════════════════════════════════ */
.ms-product-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .22s, transform .22s, border-color .22s;
  cursor: pointer;
  position: relative;
}
.ms-product-card:hover {
  box-shadow: 0 8px 32px rgba(80,70,229,.13), 0 2px 8px rgba(0,0,0,.06);
  transform: translateY(-4px);
  border-color: rgba(80,70,229,.25);
}
.ms-product-card.is-sold {
  opacity: .75;
}
.ms-product-card.is-sold:hover {
  transform: none;
  box-shadow: none;
}

/* 이미지 영역 */
.ms-pc-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  overflow: hidden; cursor: pointer;
}
.ms-pc-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
  display: block;
}
.ms-product-card:hover .ms-pc-img {
  transform: scale(1.06);
}

/* 품절 오버레이 */
.ms-pc-sold-overlay {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.6);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.ms-pc-sold-overlay span {
  font-size: 17px; font-weight: 900; color: #fff;
  letter-spacing: 1px; text-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* 호버 이미지 확대 힌트 */
.ms-pc-img-hover {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.45);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  color: #fff; font-size: 12px; font-weight: 700;
  opacity: 0; transition: opacity .22s;
  backdrop-filter: blur(1px);
  pointer-events: none;
}
.ms-product-card:hover .ms-pc-img-hover {
  opacity: 1;
}

/* 결제 뱃지 */
.ms-pc-badge-pay {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(15,23,42,.75);
  backdrop-filter: blur(4px);
  color: #fff; font-size: 10px; font-weight: 700;
  border: 1px solid rgba(255,255,255,.15);
  white-space: nowrap;
}

/* 장바구니 담긴 수량 뱃지 */
.ms-pc-badge-cart {
  position: absolute; top: 8px; right: 8px;
  min-width: 22px; height: 22px; border-radius: 11px;
  background: var(--brand);
  color: #fff; font-size: 11px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 8px rgba(80,70,229,.5);
  border: 2px solid #fff;
}

/* 텍스트 영역 */
.ms-pc-body {
  padding: 12px 12px 8px;
  flex: 1; display: flex; flex-direction: column; gap: 4px;
}
.ms-pc-category {
  font-size: 10.5px; font-weight: 700;
  color: var(--brand); letter-spacing: .03em;
  text-transform: uppercase;
}
.ms-pc-name {
  font-size: 13.5px; font-weight: 800; color: var(--text-1);
  line-height: 1.4; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.ms-pc-price-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 6px;
  margin-top: 4px;
}
.ms-pc-price {
  font-size: 17px; font-weight: 900; color: var(--text-1);
  letter-spacing: -.5px;
}
.ms-pc-price-unit {
  font-size: 12px; font-weight: 600; color: var(--text-3);
  margin-left: 1px;
}
.ms-pc-stock {
  font-size: 10.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
  white-space: nowrap;
}
.ms-pc-stock--ok   { background: rgba(34,197,94,.1);  color: #16a34a; }
.ms-pc-stock--mid  { background: rgba(245,158,11,.1);  color: #d97706; }
.ms-pc-stock--low  { background: rgba(239,68,68,.1);   color: var(--danger); }
.ms-pc-stock--sold { background: var(--surface-2);     color: var(--text-4); }

/* 버튼 영역 */
.ms-pc-actions {
  display: flex; gap: 6px;
  padding: 8px 12px 12px;
}
.ms-pc-btn-cart,
.ms-pc-btn-buy {
  flex: 1; display: inline-flex; align-items: center;
  justify-content: center; gap: 5px;
  padding: 9px 6px; border-radius: 10px;
  font-size: 12px; font-weight: 800;
  border: none; cursor: pointer; font-family: inherit;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}

.ms-pc-btn-cart {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text-2);
}
.ms-pc-btn-cart:hover:not(:disabled) {
  background: var(--border); border-color: var(--border-2);
}
.ms-pc-btn-cart.active {
  background: rgba(80,70,229,.1);
  border-color: rgba(80,70,229,.3);
  color: var(--brand);
}
.ms-pc-btn-cart:disabled {
  opacity: .45; cursor: not-allowed;
}

.ms-pc-btn-buy {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  box-shadow: 0 3px 12px rgba(80,70,229,.3);
}
.ms-pc-btn-buy:hover:not(:disabled) {
  opacity: .92; transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(80,70,229,.4);
}
.ms-pc-btn-buy:active:not(:disabled) { transform: translateY(0); }
.ms-pc-btn-buy:disabled {
  background: var(--border); color: var(--text-4);
  box-shadow: none; cursor: not-allowed;
}

/* 구버전 .product 카드 호환 — 숨김 */
.product { /* 기존 스타일 유지하되 ms-product-card로 대체됨 */ }

/* ── 로딩 / 빈 상태 ── */
.ms-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px; gap: 14px;
  color: var(--text-4); font-size: 14px;
}
.ms-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  animation: ms-spin .7s linear infinite;
}
@keyframes ms-spin { to { transform: rotate(360deg); } }

.ms-empty, .ms-empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-4); font-size: 14px;
  grid-column: 1 / -1;
}
.ms-empty-ico { font-size: 48px; margin-bottom: 14px; }

/* ================================================================
   6) 정책 섹션 (Policy Cards)
   ================================================================ */
.ms-policy {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  margin-top: 32px;
}
.ms-policy-inner {
  max-width: 1200px; margin: 0 auto;
}
.ms-policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.ms-policy-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.ms-policy-card-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.ms-policy-card-ico {
  font-size: 20px;
}
.ms-policy-card-title {
  font-size: 14px; font-weight: 800; color: var(--text-1);
}
.ms-policy-card ul {
  margin: 0; padding: 0 0 0 16px;
  list-style: disc;
}
.ms-policy-card li {
  font-size: 12.5px; color: var(--text-3);
  line-height: 1.65; margin-bottom: 4px;
}

/* ================================================================
   7) 사이트 푸터 — 깔끔한 사업자 정보 바
   ================================================================ */
.ms-footer {
  background: #0f172a;
  border-top: 1px solid #1e293b;
  padding: 0;
  margin-top: 0;
}
.ms-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 20px;
}

/* 상단 행: 브랜드 + 링크 */
.ms-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 14px;
}

/* 브랜드 로고 */
.ms-footer-brand {
  display: flex; align-items: center; gap: 9px;
}
.ms-footer-brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff; font-weight: 900;
  flex-shrink: 0;
}
.ms-footer-brand-name {
  font-size: 14px; font-weight: 900; color: #e2e8f0;
}
.ms-footer-brand-sub {
  font-size: 10.5px; color: #475569; margin-top: 1px;
}

/* 링크 그룹 */
.ms-footer-links {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
}
.ms-footer-links a {
  font-size: 11.5px; color: #475569;
  transition: color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.ms-footer-links a:hover { color: #94a3b8; text-decoration: underline; }

/* 사업자 정보 그리드 */
.ms-footer-biz {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 4px 24px;
  margin-bottom: 14px;
}
.ms-footer-biz-item {
  display: flex; align-items: baseline; gap: 5px;
  font-size: 11.5px; color: #475569; line-height: 1.8;
}
.ms-footer-biz-item strong {
  color: #64748b; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
  font-size: 10.5px; letter-spacing: .02em;
}

/* 카피라이트 + 결제 */
.ms-footer-copy {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  font-size: 11px; color: #334155;
  padding-top: 12px; border-top: 1px solid #1e293b;
}
.ms-footer-pg {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 6px;
  background: #1e293b; border: 1px solid #334155;
  font-size: 10.5px; color: #64748b; font-weight: 600;
}

/* 쿠지 관련 잔여 UI 강제 숨김 */
#okTearResultOverlay,
#okPrizeDetailModal,
#okResultModal,
.ok-tear-result-overlay,
.ok-result-modal {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ================================================================
   8) 하단 탭 네비게이션 (2탭: 피규어·굿즈 / 내 정보)
   ================================================================ */
#bottomNavBar, .ms-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 600;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 16px rgba(0,0,0,.08);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(var(--bottom-nav) + env(safe-area-inset-bottom, 0px));
}
.ms-bnav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  padding: 8px 4px 7px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 700;
  color: var(--text-4); transition: color .18s;
  position: relative;
}
.ms-bnav-btn::after {
  content: '';
  position: absolute; top: 0; left: 20%; right: 20%;
  height: 2.5px; border-radius: 0 0 3px 3px;
  background: var(--brand);
  transform: scaleX(0); transition: transform .18s;
}
.ms-bnav-btn.active::after {
  transform: scaleX(1);
}
.ms-bnav-btn.active { color: var(--brand); }
.ms-bnav-btn:hover  { color: var(--brand); }

/* SVG 아이콘 */
.ms-bnav-svg {
  width: 22px; height: 22px;
  stroke: currentColor; flex-shrink: 0;
}
.ms-bnav-ico { font-size: 20px; line-height: 1; }

/* 메인 탭 패널 */
.ms-tab-panel { width: 100%; }

/* ================================================================
   9) 모달 공통 (기존 모달과 공존)
   ================================================================ */
.ms-modal-backdrop {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 600px) {
  .ms-modal-backdrop { align-items: center; }
}
.ms-modal {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 600px) {
  .ms-modal { border-radius: 20px; }
}
.ms-modal-header {
  display: flex; align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.ms-modal-title {
  flex: 1; font-size: 16px; font-weight: 900; color: var(--text-1);
}
.ms-modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-3);
  transition: background .15s;
}
.ms-modal-close:hover { background: var(--border); }

/* ── 장바구니 플로팅 버튼 ── */
/* cartFloatBtn — 헤더에 장바구니 버튼 있으므로 숨김 */
#cartFloatBtn { display: none !important; }
.cart-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid #fff;
}

/* ================================================================
   10) 이미지 줌 모달
   ================================================================ */
.img-zoom-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.9); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.img-zoom-modal img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 8px; object-fit: contain;
}
.img-zoom-close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2);
  color: #fff; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s;
}
.img-zoom-close:hover { background: rgba(255,255,255,.25); }

/* ================================================================
   11) 공지 모달
   ================================================================ */
.notice-modal {
  position: fixed; inset: 0; z-index: 800;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.notice-modal.open,
.notice-modal.show { opacity: 1; pointer-events: auto; }
.notice-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
}
.notice-card {
  position: relative; z-index: 1;
  background: var(--surface); border-radius: 16px;
  width: min(480px, 92vw); max-height: 70vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.notice-header {
  display: flex; align-items: center;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.notice-header .title {
  flex: 1; font-size: 15px; font-weight: 800; color: var(--text-1);
}
.notice-close {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.notice-body {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  font-size: 14px; color: var(--text-2); line-height: 1.65;
}

/* ================================================================
   12) 툴바 (기존 코드 호환)
   ================================================================ */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 0 16px;
}
.toolbar label {
  font-size: 13px; font-weight: 700; color: var(--text-3);
  white-space: nowrap;
}
.toolbar .select,
.toolbar select {
  padding: 8px 32px 8px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--text-2); font-family: inherit;
  outline: none; cursor: pointer;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
  transition: border-color .15s;
}
.toolbar .select:focus,
.toolbar select:focus { border-color: var(--brand); }

/* ================================================================
   13) 반응형 조정
   ================================================================ */
@media (max-width: 600px) {
  .ms-hero { padding: 36px 16px 32px; }
  .ms-hero-title { font-size: 28px; }
  .ms-hero-sub   { font-size: 14px; }

  .ms-how, .ms-policy { padding: 32px 16px; }

  .ms-shop-section { padding: 18px 14px 0; }
  .ms-shop-header { gap: 10px; margin-bottom: 14px; }
  .ms-shop-header-title { font-size: 17px; }

  .ms-product-grid, .shop-grid, #shopBuy {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .ms-pc-name { font-size: 12.5px; }
  .ms-pc-price { font-size: 15px; }

  .ms-trust-strip { padding: 20px 16px; }
  .ms-trust-strip-inner { grid-template-columns: 1fr 1fr; gap: 12px; }
  .ms-trust-item-ico { font-size: 22px; }
  .ms-trust-item-label { font-size: 12.5px; }

  .ms-footer { padding: 28px 16px 16px; }
}

@media (max-width: 380px) {
  .ms-product-grid, .shop-grid, #shopBuy {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .ms-pc-actions { padding: 6px 10px 10px; gap: 5px; }
  .ms-pc-btn-cart, .ms-pc-btn-buy { font-size: 11px; padding: 8px 4px; }
}

/* ================================================================
   14) 기존 코드 호환성 스타일 (JS에서 참조하는 클래스들)
   ================================================================ */

/* 숨김 처리 요소들 */
.lk-topbar,
.lk-brand-block,
.shop-page-header,
.userline,
#userlineBadge,
[id^="queueDot"],
[id^="queueText"],
.point-shop-bal,
.kuji-shop-bal,
.event-shop-bal,
.queue-status-wrap {
  display: none !important;
}

/* goodsSection wrapper */
#goodsSection { margin: 0; padding: 0; }
#buyShopPanel { }

/* 호환용 패널 */
#pointShopPanel,
#kujiShopPanel,
#shopNormal,
#shopKuji,
#shopSection,
#kujiSection { display: none !important; }

/* 기존 shop-page-header 숨김 */
.shop-page-header { display: none !important; }

/* 기존 wrap 오버라이드 */
.wrap {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
}

/* ================================================================
   15) 장바구니 / 구매 확인 모달 (기존 마크업 재스타일링)
   ================================================================ */
/* ================================================================
   장바구니 드로어 (우측 슬라이드)
   ================================================================ */
.cart-backdrop {
  position: fixed; inset: 0; z-index: 900;
  display: none;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
#cartModal { /* alias */ }
.cart-backdrop.open { display: block; }

/* 드로어 패널 */
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 40px rgba(0,0,0,.18);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  z-index: 901;
  overflow: hidden;
}
.cart-backdrop.open .cart-drawer {
  transform: translateX(0);
}

/* 드로어 헤더 */
.cart-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
  background: #fff;
}
.cart-drawer-header-left {
  display: flex; align-items: center; gap: 9px;
  color: #1e293b;
}
.cart-drawer-title {
  font-size: 17px; font-weight: 900; color: #1e293b;
  letter-spacing: -.3px;
}
.cart-drawer-count {
  font-size: 12px; font-weight: 700;
  background: var(--brand); color: #fff;
  padding: 2px 8px; border-radius: 999px;
}
.cart-drawer-close {
  width: 36px; height: 36px; border-radius: 10px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; transition: background .15s, color .15s;
  flex-shrink: 0;
}
.cart-drawer-close:hover { background: #f1f5f9; color: #1e293b; }

/* 스크롤 바디 */
.cart-drawer-body {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.cart-drawer-body::-webkit-scrollbar { width: 4px; }
.cart-drawer-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

/* 빈 카트 */
.cart-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 24px; text-align: center;
  color: #94a3b8;
}
.cart-empty-ico { margin-bottom: 14px; }
.cart-empty-title { font-size: 15px; font-weight: 700; color: #475569; margin: 0 0 6px; }
.cart-empty-sub   { font-size: 13px; color: #94a3b8; margin: 0; }

/* ── 상품 카드 ── */
.ci-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1.5px solid #f1f5f9;
  border-radius: 14px;
  position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.ci-card:hover { border-color: #e2e8f0; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.ci-card-sold { opacity: .65; }

/* 썸네일 */
.ci-thumb-wrap {
  width: 80px; height: 80px; flex-shrink: 0;
  border-radius: 10px; overflow: hidden;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.ci-thumb {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .2s;
}
.ci-card:hover .ci-thumb { transform: scale(1.04); }
.ci-thumb-placeholder {
  font-size: 28px; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}

/* 배지 */
.ci-badge {
  position: absolute; top: 5px; left: 5px;
  font-size: 10px; font-weight: 800; line-height: 1;
  padding: 3px 6px; border-radius: 6px;
}
.ci-badge-sold { background: #dc2626; color: #fff; }
.ci-badge-low  { background: #f59e0b; color: #fff; }

/* 정보 */
.ci-info {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px;
}
.ci-name {
  font-size: 13.5px; font-weight: 700; color: #1e293b;
  margin: 0; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ci-unit-price {
  font-size: 12px; color: #94a3b8; font-weight: 500; margin: 0;
}
.ci-status-note { font-size: 11px; font-weight: 600; margin: 2px 0 0; }
.ci-note-sold { color: #ef4444; }
.ci-note-low  { color: #f59e0b; }

/* 수량 + 소계 행 */
.ci-bottom-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
}
.ci-qty-ctrl {
  display: flex; align-items: center; gap: 0;
  border: 1.5px solid #e2e8f0; border-radius: 8px;
  overflow: hidden;
}
.ci-qty-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: #f8fafc; border: none; cursor: pointer;
  color: #475569; transition: background .15s;
}
.ci-qty-btn:hover:not(:disabled) { background: #f1f5f9; color: var(--brand); }
.ci-qty-btn:disabled { opacity: .35; cursor: default; }
.ci-qty-num {
  min-width: 32px; text-align: center;
  font-size: 14px; font-weight: 800; color: #1e293b;
  background: #fff; display: flex; align-items: center; justify-content: center;
  height: 30px;
}
.ci-subtotal {
  font-size: 15px; font-weight: 900; color: var(--brand);
}

/* 삭제 버튼 */
.ci-del-btn {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 7px;
  background: transparent; border: none; cursor: pointer;
  color: #cbd5e1; display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.ci-del-btn:hover { background: #fee2e2; color: #ef4444; }

/* ── 결제 하단 영역 ── */
.cart-drawer-footer {
  flex-shrink: 0;
  padding: 16px 20px calc(env(safe-area-inset-bottom,0px) + 16px);
  border-top: 1px solid #f1f5f9;
  background: #fff;
}
.cart-summary-box {
  background: #f8fafc; border: 1px solid #f1f5f9;
  border-radius: 14px; padding: 14px 16px;
  margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px;
}
.cart-summary-row {
  display: flex; align-items: center; justify-content: space-between;
}
.cart-summary-label { font-size: 13px; color: #64748b; font-weight: 600; }
.cart-summary-val   { font-size: 13px; font-weight: 700; color: #1e293b; }
.cart-summary-val::after { content: '원'; font-weight: 500; font-size: 11px; margin-left: 1px; color: #94a3b8; }
.cart-summary-free  { font-size: 13px; font-weight: 700; color: #22c55e; }
.cart-summary-divider {
  height: 1px; background: #e2e8f0; margin: 4px 0;
}
.cart-summary-total .cart-summary-label-total {
  font-size: 14px; font-weight: 800; color: #1e293b;
}
.cart-summary-val-total {
  font-size: 20px; font-weight: 900; color: var(--brand);
}
.cart-checkout-btn {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; border: none; border-radius: 14px;
  font-size: 15px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 18px rgba(80,70,229,.35);
  cursor: pointer; transition: opacity .15s, transform .1s;
  letter-spacing: -.2px;
}
.cart-checkout-btn:hover:not(:disabled) { opacity: .92; transform: translateY(-1px); }
.cart-checkout-btn:disabled {
  background: #e2e8f0; color: #94a3b8;
  box-shadow: none; cursor: default; transform: none;
}
.cart-checkout-note {
  text-align: center; font-size: 11.5px; color: #94a3b8;
  margin: 10px 0 0; font-weight: 500;
}

/* 모바일: 드로어를 바텀 시트로 전환 */
@media (max-width: 480px) {
  .cart-drawer {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    transform: translateY(100%);
  }
  .cart-backdrop.open .cart-drawer { transform: translateY(0); }
}

/* ================================================================
   16) 구매 확인 모달 스타일
   ================================================================ */
#buyConfirmModal {
  position: fixed; inset: 0; z-index: 910;
  display: none;
  align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
}
#buyConfirmModal.open { display: flex; }
#buyConfirmModal > .bc-sheet {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 500px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
@media (min-width: 600px) {
  #buyConfirmModal { align-items: center; }
  #buyConfirmModal > .bc-sheet { border-radius: 20px; }
}

/* ================================================================
   17) 프로필 / 로그인 필요 모달 (기존 마크업)
   ================================================================ */
#profileIncompleteModal,
#loginRequiredModal {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
}

/* ================================================================
   18) 애니메이션
   ================================================================ */
@keyframes ms-fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes ms-slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

.ms-animate-in {
  animation: ms-slideUp .3s cubic-bezier(.22,.68,0,1.2) both;
}

/* ================================================================
   19) 헤더 — 사용자 영역 재설계 (로그인/로그아웃 버튼 + 닉네임 뱃지)
   ================================================================ */

/* ── 비로그인 상태 버튼 그룹 ── */
.ms-header-guest {
  display: flex; align-items: center; gap: 6px;
}
.ms-header-login-btn,
.ms-header-signup-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  white-space: nowrap; text-decoration: none;
  transition: all .15s; cursor: pointer;
}
.ms-header-login-btn {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text-2);
}
.ms-header-login-btn:hover {
  background: var(--border); border-color: var(--border-2);
  transform: translateY(-1px); color: var(--text-1);
}
.ms-header-signup-btn {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border: none;
  color: #fff;
  box-shadow: 0 3px 10px rgba(80,70,229,.3);
}
.ms-header-signup-btn:hover {
  opacity: .9; transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(80,70,229,.4);
}

/* ── 로그인 상태: 닉네임 뱃지 ── */
.ms-header-user-badge {
  display: flex; align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(80,70,229,.08), rgba(99,102,241,.06));
  border: 1.5px solid rgba(80,70,229,.18);
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.ms-header-user-badge:hover {
  background: linear-gradient(135deg, rgba(80,70,229,.14), rgba(99,102,241,.1));
  border-color: rgba(80,70,229,.3);
}

/* 아바타 — 제거됨 (닉네임만 표시) */
.ms-header-avatar { display: none !important; }
.ms-header-nick-wrap { display: none !important; }
.ms-header-nick-sub  { display: none !important; }

/* 닉네임 */
.ms-header-nick {
  font-size: 13px; font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap; line-height: 1;
}

/* ── 내 정보 버튼 ── */
.ms-header-myinfo-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text-2); font-size: 12.5px; font-weight: 700;
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.ms-header-myinfo-btn:hover {
  background: var(--border); border-color: var(--border-2);
  transform: translateY(-1px); color: var(--text-1);
}

/* ── 로그아웃 버튼 ── */
.ms-header-logout-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: var(--radius-sm);
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-3); font-size: 12.5px; font-weight: 700;
  transition: all .15s; white-space: nowrap;
}
.ms-header-logout-btn:hover {
  background: rgba(239,68,68,.06);
  border-color: rgba(239,68,68,.3);
  color: #ef4444;
  transform: translateY(-1px);
}

/* 예전 user-area 클래스는 hide */
.ms-header-user-area { display: none !important; }
.ms-header-user-info  { display: none !important; }
.ms-header-user-avatar { display: none !important; }
.ms-header-username   { display: none !important; }
.ms-header-user-sub   { display: none !important; }

/* ================================================================
   20) 배송지 / 개인정보 섹션 — 완전 재설계
   ================================================================ */
.ms-profile-section {
  background: #f1f5f9;
  border-top: 1px solid var(--border);
  padding: 48px 24px 56px;
  scroll-margin-top: 100px;
}
.ms-profile-inner {
  max-width: 780px; margin: 0 auto;
}

/* 섹션 헤더 */
.ms-profile-section-head {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 28px; flex-wrap: wrap;
}
.ms-profile-section-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(80,70,229,.35);
}
.ms-profile-section-titles { flex: 1; min-width: 0; }
.ms-profile-section-title {
  font-size: 21px; font-weight: 900; color: var(--text-1);
  margin: 0 0 5px; letter-spacing: -.3px;
}
.ms-profile-section-desc {
  font-size: 13px; color: var(--text-3); margin: 0;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}

/* 연동 뱃지 */
.ms-sync-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(80,70,229,.1);
  border: 1px solid rgba(80,70,229,.2);
  color: var(--brand); font-size: 11px; font-weight: 800;
  flex-shrink: 0;
}

/* 연동 상태 표시 */
.ms-profile-sync-status {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; font-weight: 700; color: var(--text-3);
  align-self: center;
  white-space: nowrap;
}
.ms-profile-sync-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-4); flex-shrink: 0;
  transition: background .3s;
}
.ms-profile-sync-dot.ok      { background: var(--success); }
.ms-profile-sync-dot.warn    { background: var(--warn); }
.ms-profile-sync-dot.error   { background: var(--danger); }
.ms-profile-sync-dot.syncing {
  background: var(--brand);
  animation: pulse-sync .8s ease-in-out infinite;
}
@keyframes pulse-sync {
  0%,100% { opacity: 1; } 50% { opacity: .4; }
}

/* ── 탭 네비게이션 ────────────────────────────── */
.ms-pf-tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.ms-pf-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  font-size: 13.5px; font-weight: 700; color: var(--text-3);
  background: none; border: none; cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px; /* overlap border-bottom */
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  position: relative;
}
.ms-pf-tab:hover { color: var(--brand); }
.ms-pf-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* 탭 알림 뱃지 */
.ms-pf-tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 900;
}

/* ── 탭 패널 ─────────────────────────────────── */
.ms-pf-panel { animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ── 배송지 미리보기 카드 ─────────────────────── */
.ms-delivery-preview {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  transition: border-color .2s;
}
.ms-delivery-preview-icon {
  font-size: 28px; flex-shrink: 0;
}
.ms-delivery-preview-content { flex: 1; min-width: 0; }
.ms-delivery-preview-name {
  font-size: 15px; font-weight: 800; color: var(--text-1);
  margin-bottom: 3px;
}
.ms-delivery-preview-addr {
  font-size: 13px; color: var(--text-2); margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ms-delivery-preview-phone {
  font-size: 12px; color: var(--text-4);
}
.ms-delivery-preview-status {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 800; color: var(--success);
  flex-shrink: 0;
}

/* ── 폼 카드 ─────────────────────────────────── */
.ms-pf-form-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.ms-pf-form-card-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 800; color: var(--text-1);
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── 필드 그리드 ──────────────────────────────── */
.ms-pf-fields-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 540px) {
  .ms-pf-fields-grid { grid-template-columns: 1fr; }
}

.ms-pf-field-group {
  display: flex; flex-direction: column; gap: 6px;
}
.ms-pf-label {
  font-size: 12px; font-weight: 700; color: var(--text-3);
  letter-spacing: .02em;
  display: flex; align-items: center; gap: 5px;
}
.ms-pf-req {
  font-size: 10px; font-weight: 800;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(239,68,68,.1); color: var(--danger);
}
.ms-pf-input {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-1);
  font-size: 14px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
  outline: none;
}
.ms-pf-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(80,70,229,.12);
  background: #fff;
}
.ms-pf-input[readonly] {
  background: var(--surface-2); color: var(--text-3);
  cursor: default;
}
.ms-pf-input::placeholder { color: var(--text-4); }
.ms-pf-hint {
  font-size: 11.5px; color: var(--text-4); margin-top: 2px;
}

/* 주소 검색 행 */
.ms-pf-addr-search-row {
  display: flex; gap: 8px; align-items: stretch;
  margin-bottom: 8px;
}
.ms-pf-postcode-input {
  width: 120px; flex-shrink: 0;
}
.ms-pf-addr-search-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; font-size: 13px; font-weight: 700;
  border: none; cursor: pointer; font-family: inherit;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.ms-pf-addr-search-btn:hover { opacity: .9; transform: translateY(-1px); }

.ms-pf-addr-main {
  margin-bottom: 8px;
}

/* ── 저장/새로고침 버튼 영역 ──────────────────── */
.ms-pf-actions {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-top: 20px;
}
.ms-pf-save-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 26px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; font-size: 14px; font-weight: 800;
  border: none; cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 16px rgba(80,70,229,.3);
  transition: opacity .15s, transform .1s, box-shadow .15s;
}
.ms-pf-save-btn:hover {
  opacity: .92; transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(80,70,229,.42);
}
.ms-pf-save-btn:active { transform: translateY(0); }
.ms-pf-save-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.ms-pf-refresh-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 10px 16px; border-radius: var(--radius);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text-3); font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background .15s, border-color .15s;
}
.ms-pf-refresh-btn:hover { background: var(--border); border-color: var(--border-2); }

/* ── 메시지 박스 ──────────────────────────────── */
.ms-pf-msg {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; margin-top: 14px;
}
.ms-pf-msg.success {
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.25);
  color: #16a34a;
}
.ms-pf-msg.error {
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2);
  color: var(--danger);
}

/* ── 이메일 인증 카드 ─────────────────────────── */
.ms-email-verified-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: rgba(34,197,94,.07);
  border: 1.5px solid rgba(34,197,94,.25);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.ms-email-verified-ico { font-size: 24px; flex-shrink: 0; }
.ms-email-verified-title {
  font-size: 13px; font-weight: 800; color: #16a34a; margin-bottom: 2px;
}
.ms-email-verified-addr {
  font-size: 13px; color: var(--text-2); font-weight: 600;
}
.ms-email-change-btn {
  margin-left: auto; flex-shrink: 0;
  padding: 6px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1.5px solid var(--border);
  color: var(--text-3); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.ms-email-change-btn:hover { background: var(--border); }

/* 이메일 입력 행 */
.ms-pf-email-row {
  display: flex; gap: 8px;
}
.ms-pf-email-send-btn,
.ms-pf-email-verify-btn {
  flex-shrink: 0; padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 700;
  cursor: pointer; border: none;
  white-space: nowrap; font-family: inherit;
  transition: opacity .15s;
}
.ms-pf-email-send-btn {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
}
.ms-pf-email-verify-btn {
  background: var(--success); color: #fff;
}
.ms-pf-email-send-btn:hover,
.ms-pf-email-verify-btn:hover { opacity: .88; }
.ms-pf-email-send-btn:disabled,
.ms-pf-email-verify-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 인증 코드 영역 */
.ms-pf-code-area {
  margin-top: 12px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ms-pf-code-input {
  letter-spacing: .2em; text-align: center; font-size: 18px; font-weight: 700;
}

/* 이메일 배지 영역 */
.ms-email-badge-area { margin-top: 6px; }
.ms-badge-warn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.2);
  color: var(--danger); font-size: 11px; font-weight: 800;
}

/* 이메일 정보 안내 박스 */
.ms-email-info-box {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px 16px;
  background: rgba(80,70,229,.05);
  border: 1px solid rgba(80,70,229,.15);
  border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-3); line-height: 1.5;
}

/* ── 모바일 반응형 ────────────────────────────── */
@media (max-width: 600px) {
  .ms-profile-section    { padding: 32px 16px 48px; }
  .ms-profile-section-title { font-size: 18px; }
  .ms-pf-actions         { flex-direction: column; }
  .ms-pf-save-btn        { width: 100%; justify-content: center; }
  .ms-pf-refresh-btn     { width: 100%; justify-content: center; }
  .ms-pf-tab             { padding: 10px 12px; font-size: 12.5px; }
  .ms-delivery-preview   { flex-wrap: wrap; }
  /* 모바일: 로고 텍스트 숨김 — 마크만 표시 */
  .ms-logo-words         { display: none !important; }
  .ms-logo-mark          { width: 36px; height: 36px; font-size: 17px; border-radius: 10px; }
  /* 모바일: 헤더 내데마 여백 축소 */
  .ms-header-inner       { padding: 0 12px; gap: 8px; }
  /* 모바일: 닉네임 뱃지 축소 */
  .ms-header-user-badge  { padding: 5px 11px; }
  /* 로그아웃: SVG 아이콘만 */
  .ms-header-logout-btn  { padding: 7px 9px; font-size: 0; gap: 0; }
  .ms-header-logout-btn svg { width: 16px; height: 16px; }
  /* 구매내역: 텍스트 숨김 아이콘만 */
  .ms-header-orders-btn  { padding: 7px 9px; font-size: 0; gap: 0; }
  .ms-header-orders-btn svg { width: 16px; height: 16px; }
}
@media (max-width: 480px) {
  .ms-header-myinfo-btn  { display: none !important; }
  .ms-header-login-btn span,
  .ms-header-signup-btn span { display: none; }
  .ms-header-login-btn,
  .ms-header-signup-btn { padding: 7px 10px; }
  .ms-header-inner       { padding: 0 10px; gap: 6px; }
  .ms-header-user-badge  { padding: 5px 10px; }
  .ms-header-nick        { font-size: 12px; }
}

/* ── 이미지 확대 모달 (okImgExpandModal) ──────── */
.ok-img-expand-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.ok-img-expand-modal.show {
  display: flex;
}
.ok-img-expand-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 1;
  transition: background .15s;
}
.ok-img-expand-close:hover { background: rgba(255,255,255,.3); }
.ok-img-expand-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
  cursor: default;
  pointer-events: none;
}

/* ══ 구매내역 버튼 (헤더) ══ */
.ms-header-orders-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg,#eef2ff,#e0e7ff);
  color: #4f46e5;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.ms-header-orders-btn:hover { background: linear-gradient(135deg,#e0e7ff,#c7d2fe); transform: scale(1.02); }

/* ══ 구매내역 드로어 ══ */
.orders-drawer { max-width: 440px; }

.order-card {
  background: #fff;
  border: 1.5px solid #e0e7ff;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(99,102,241,.07);
}
.order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.order-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #1e1b4b;
  line-height: 1.35;
  flex: 1;
}
.order-card-date {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  margin-top: 2px;
}
.order-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.order-card-price {
  font-size: 14px;
  font-weight: 800;
  color: #6366f1;
}
.order-card-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  border: 1.5px solid transparent;
}
.order-card-status-badge.status-preparing {
  background: #fef9c3; color: #92400e; border-color: #fde68a;
}
.order-card-status-badge.status-shipping {
  background: #dbeafe; color: #1d4ed8; border-color: #93c5fd;
}
.order-card-status-badge.status-delivered {
  background: #dcfce7; color: #166534; border-color: #86efac;
}
.order-card-status-badge.status-refunded {
  background: #fee2e2; color: #991b1b; border-color: #fca5a5;
}
.order-tracking-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1.5px solid #6366f1;
  border-radius: 8px;
  background: #fff;
  color: #6366f1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.order-tracking-btn:hover { background: #6366f1; color: #fff; }
.orders-empty {
  text-align: center;
  padding: 50px 20px;
  color: #94a3b8;
}
.orders-empty svg { opacity: .3; margin-bottom: 12px; }
.orders-empty p { font-size: 14px; font-weight: 600; }

/* ══ 배송현황 모달 ══ */
.shipping-status-box {
  position: relative;
  width: min(440px, 94vw);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(99,102,241,.2), 0 4px 20px rgba(0,0,0,.08);
  padding: 28px 28px 24px;
  border: 1.5px solid rgba(99,102,241,.15);
}
.shipping-status-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid #e0e7ff;
  background: #f8fafc;
  color: #6366f1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.shipping-status-close:hover { background: #e0e7ff; }
.shipping-status-title {
  font-size: 18px;
  font-weight: 900;
  color: #1e1b4b;
  margin-bottom: 4px;
}
.shipping-status-item-name {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
/* 도로 + 자동차 트래커 */
.ss-tracker {
  margin-bottom: 20px;
}
.ss-road {
  position: relative;
  height: 44px;
  margin: 0 16px 0 16px;
  display: flex;
  align-items: center;
}
.ss-road-line {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 8px;
  background: #e0e7ff;
  border-radius: 4px;
  overflow: hidden;
}
.ss-road-progress {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  border-radius: 4px;
  width: 0%;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.ss-car {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0%;
  transition: left .6s cubic-bezier(.4,0,.2,1);
  filter: drop-shadow(0 3px 6px rgba(99,102,241,.35));
  z-index: 2;
}
.ss-steps-row {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
.ss-step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.ss-node-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #e0e7ff;
  border: 2.5px solid #c7d2fe;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8;
  transition: background .3s, border-color .3s, color .3s;
}
.ss-step-node.active .ss-node-circle {
  background: linear-gradient(135deg,#6366f1,#818cf8);
  border-color: #4f46e5;
  color: #fff;
}
.ss-step-node.done .ss-node-circle {
  background: linear-gradient(135deg,#22c55e,#4ade80);
  border-color: #16a34a;
  color: #fff;
}
.ss-node-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  transition: color .3s;
}
.ss-step-node.active .ss-node-label,
.ss-step-node.done .ss-node-label {
  color: #4f46e5;
}
.ss-step-node.done .ss-node-label { color: #16a34a; }
/* 택배 정보 */
.ss-courier-box {
  background: #f8fafc;
  border: 1.5px solid #e0e7ff;
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 8px;
}
.ss-courier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}
.ss-courier-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}
.ss-courier-val {
  font-size: 13px;
  font-weight: 800;
  color: #1e1b4b;
}
.ss-no-tracking {
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  padding: 10px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #c7d2fe;
}
