/* =========================================================
   체리블러쉬 — style.css
   주 컬러: 파스텔 분홍 · 파스텔 핑크 / 포인트: 블러쉬 로즈
   ========================================================= */
:root {
  --pink-50: #FFF7F9;
  --pink-100: #FFEDF2;   /* 파스텔 분홍 (배경) */
  --pink-200: #FFD6E0;   /* 파스텔 핑크 (주 컬러) */
  --pink-300: #FFB8CB;
  --pink-400: #F99BB5;
  --point: #EC5F86;      /* 포인트 컬러 */
  --point-dark: #D6456E;
  --ink: #4A3540;
  --ink-2: #7D6871;
  --ink-3: #AE9AA3;
  --line: #F5DDE4;
  --white: #FFFFFF;
  --radius: 20px;
  --radius-l: 28px;
  --shadow: 0 10px 30px rgba(236, 95, 134, .14);
  --shadow-s: 0 2px 10px rgba(74, 53, 64, .06);
  --font: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; scroll-behavior: smooth; scroll-padding-top: 130px; }
body { overflow-x: hidden; font-family: var(--font); color: var(--ink); background: var(--pink-50); line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
body.lock { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: 15px; transition: background .2s, transform .1s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-point { background: var(--point); color: #fff; box-shadow: 0 6px 16px rgba(236, 95, 134, .3); }
.btn-point:hover { background: var(--point-dark); }
.btn-soft { background: var(--pink-200); }
.btn-soft:hover { background: var(--pink-300); }
.btn-line { background: #fff; border: 1.5px solid var(--line); }
.btn-line:hover { border-color: var(--pink-400); }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 50; background: rgba(255, 247, 249, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { height: 70px; display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-text { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.logo-text b { color: var(--point); }
.search { flex: 1; max-width: 420px; margin-left: auto; position: relative; min-width: 0; }
.search input { width: 100%; height: 42px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; padding: 0 44px 0 18px; font-size: 14px; outline: none; }
.search input:focus { border-color: var(--pink-400); }
.search button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.header-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn:hover { background: var(--pink-100); }
.cart-count { position: absolute; top: 1px; right: -1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--point); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--pink-50); }
.cart-count[hidden] { display: none; }
.user-chip { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); font-size: 13px; font-weight: 700; max-width: 220px; }
.user-chip .grade { background: var(--pink-200); border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.user-chip .pt { color: var(--point); }
.nav-inner { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 10px; scrollbar-width: none; }
.nav-inner::-webkit-scrollbar { display: none; }
.nav-inner button { flex-shrink: 0; height: 36px; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.nav-inner button:hover { background: var(--pink-100); }
.nav-inner button.active { background: var(--pink-200); color: var(--ink); }

/* ---------- Hero (crossfade) ---------- */
.hero { padding-top: 20px; }
.slider { position: relative; aspect-ratio: 1600 / 680; min-height: 400px; border-radius: var(--radius-l); overflow: hidden; background: var(--pink-100); box-shadow: var(--shadow); }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 1.2s ease, visibility 1.2s; }
.slide.is-active { opacity: 1; visibility: visible; }
.slide img { width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.slide-copy { position: absolute; left: 6%; top: 50%; transform: translateY(-50%); max-width: 480px; }
.slide-copy > * { opacity: 0; transform: translateY(14px); transition: opacity .6s .3s, transform .6s .3s; }
.slide.is-active .slide-copy > * { opacity: 1; transform: none; }
.eyebrow { display: inline-block; background: #fff; color: var(--point); font-weight: 800; font-size: 12px; letter-spacing: 2px; padding: 6px 14px; border-radius: 999px; }
.slide-copy h2 { font-size: clamp(30px, 4.4vw, 56px); line-height: 1.2; letter-spacing: -1px; margin: 16px 0 12px; }
.slide-copy h2 em { font-style: normal; color: var(--point); }
.slide-copy p { color: var(--ink-2); font-size: clamp(15px, 1.4vw, 18px); margin-bottom: 24px; }
.slider-ui { position: absolute; left: 6%; bottom: 28px; display: flex; align-items: center; gap: 12px; }
.arrow { width: 40px; height: 40px; border-radius: 50%; background: #fff; font-size: 24px; line-height: 1; box-shadow: var(--shadow-s); }
.arrow:hover { background: var(--pink-200); }
.dots { display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 5px; background: rgba(74, 53, 64, .2); transition: width .3s, background .3s; }
.dot.is-active { width: 30px; background: var(--point); }

/* ---------- Section ---------- */
.section { padding-top: 70px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.kicker { color: var(--point); font-weight: 800; font-size: 12px; letter-spacing: 3px; }
.section-head h3 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.5px; }
.sub { color: var(--ink-2); margin-top: 4px; }
.sub b { color: var(--point); }

/* ---------- Category cards ---------- */
.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cat { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-s); text-align: left; transition: transform .2s, box-shadow .2s; min-width: 0; }
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cat img { width: 72px; height: 72px; border-radius: 14px; flex-shrink: 0; }
.cat strong { display: block; font-size: 17px; }
.cat span { font-size: 13px; color: var(--ink-2); }

/* ---------- Products ---------- */
.sort-wrap select { height: 44px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; padding: 0 16px; font-weight: 600; outline: none; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
.card { min-width: 0; }
.card-media { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--pink-100); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-media img { transform: scale(1.05); }
.badge { position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--point); color: #fff; }
.badge.new { background: #fff; color: var(--point); }
.badge.soldout { background: var(--ink); }
.card.is-soldout .card-media img { opacity: .55; }
.card-body { padding: 12px 2px 0; }
.card-cat { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.card-name { display: block; text-align: left; font-weight: 700; font-size: 16px; margin: 2px 0 4px; }
.card-price { font-weight: 800; font-size: 17px; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-2); margin-top: 4px; flex-wrap: wrap; }
.card-meta b { color: var(--point); }
.low { color: var(--point-dark); font-weight: 700; }
.empty { grid-column: 1 / -1; text-align: center; padding: 50px 0; color: var(--ink-2); }

/* ---------- Grades ---------- */
.grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grade-card { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-s); border: 2px solid transparent; }
.grade-card.mine { border-color: var(--point); }
.grade-card .lv { font-size: 12px; font-weight: 800; color: var(--ink-3); }
.grade-card h4 { font-size: 20px; margin: 4px 0 8px; }
.grade-card .rate { font-size: 32px; font-weight: 800; color: var(--point); }
.grade-card p { font-size: 13px; color: var(--ink-2); }
.grade-card .me { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 800; background: var(--pink-200); padding: 3px 10px; border-radius: 999px; }

/* ---------- Infos ---------- */
.infos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.infos li { background: var(--pink-200); border-radius: var(--radius); padding: 22px; }
.infos strong { display: block; font-size: 17px; }
.infos span { font-size: 14px; color: var(--ink-2); }

/* ---------- Footer ---------- */
.footer { margin-top: 80px; background: var(--ink); color: #F3E3E9; padding: 40px 0; font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer .logo-text { color: #fff; margin-bottom: 8px; }
.footer .biz, .footer .copy { opacity: .7; }

/* ---------- Layers ---------- */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(74, 53, 64, .45); opacity: 0; pointer-events: none; transition: opacity .25s; }
.overlay.show { opacity: 1; pointer-events: auto; }
.modal { position: fixed; left: 50%; top: 50%; z-index: 100; width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; overflow-x: hidden; background: #fff; border-radius: var(--radius-l); transform: translate(-50%, -46%); opacity: 0; pointer-events: none; transition: all .25s; }
.modal.wide { width: min(900px, calc(100% - 24px)); }
.modal.show { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; background: #fff; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 20px; }
.close { width: 36px; height: 36px; border-radius: 50%; background: var(--pink-100); font-size: 20px; line-height: 1; flex-shrink: 0; }
.modal-body { padding: 20px 22px 24px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 100; width: min(400px, 100%); background: #fff; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .3s; }
.drawer.show { transform: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.drawer-foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); background: var(--pink-50); }

/* ---------- Forms ---------- */
.field { margin-bottom: 12px; min-width: 0; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.field input, .field select { width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; padding: 0 14px; font-size: 15px; outline: none; }
.field input:focus, .field select:focus { border-color: var(--pink-400); box-shadow: 0 0 0 3px var(--pink-100); }
.field input.invalid { border-color: var(--point); background: var(--pink-50); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 8px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--point); flex-shrink: 0; }
.error { min-height: 18px; font-size: 13px; color: var(--point-dark); margin: 4px 0 8px; }
.notice { background: var(--pink-100); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.notice b { color: var(--point); }
.seg { display: flex; background: var(--pink-100); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.seg button { flex: 1; height: 38px; border-radius: 999px; font-weight: 700; color: var(--ink-2); }
.seg button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-s); }
.box { background: var(--pink-50); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.box h4 { font-size: 15px; margin-bottom: 10px; }
.pays { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pays label { display: flex; align-items: center; justify-content: center; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 14px; font-weight: 700; cursor: pointer; text-align: center; }
.pays input { position: absolute; opacity: 0; pointer-events: none; }
.pays input:checked + span { color: var(--point-dark); }
.pays label:has(input:checked) { border-color: var(--point); background: var(--pink-100); }
.sum { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 4px 0; }
.sum.total { border-top: 1.5px dashed var(--pink-300); margin-top: 8px; padding-top: 10px; font-size: 18px; font-weight: 800; }
.sum.total b, .minus { color: var(--point); }
.earn { background: var(--pink-200); border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 700; margin-top: 10px; }

/* ---------- Detail ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.detail-media { border-radius: var(--radius); overflow: hidden; background: var(--pink-100); }
.detail h2 { font-size: 24px; line-height: 1.3; margin: 6px 0 8px; }
.detail .price { font-size: 26px; font-weight: 800; }
.detail .desc { color: var(--ink-2); font-size: 14px; margin: 12px 0 16px; }
.stock { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.qty button { width: 36px; height: 36px; font-size: 18px; font-weight: 700; }
.qty button:hover { background: var(--pink-100); }
.qty span { min-width: 32px; text-align: center; font-weight: 800; }
.detail-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; margin: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-total b { font-size: 22px; color: var(--point); }
.detail-actions { display: flex; gap: 10px; margin-top: 14px; }
.detail-actions .btn { flex: 1; }

/* ---------- Cart & lists ---------- */
.cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 76px; height: 76px; border-radius: 12px; flex-shrink: 0; }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .name { font-weight: 700; font-size: 14px; }
.cart-item .unit { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.cart-item .bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cart-item .qty button { width: 30px; height: 30px; font-size: 15px; }
.remove { font-size: 12px; color: var(--ink-3); text-decoration: underline; align-self: flex-start; flex-shrink: 0; }
.cart-empty { text-align: center; padding: 60px 0; color: var(--ink-2); }
.mini { display: flex; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.mini img { width: 48px; height: 48px; border-radius: 10px; flex-shrink: 0; }
.mini .grow { flex: 1; min-width: 0; }
.mini .muted { color: var(--ink-3); font-size: 12px; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }

/* ---------- Done / My page ---------- */
.done { text-align: center; padding: 6px 0 16px; }
.done .icon { width: 76px; height: 76px; border-radius: 50%; background: var(--pink-200); display: grid; place-items: center; font-size: 34px; margin: 0 auto 12px; }
.done h4 { font-size: 22px; }
.order-no { display: inline-block; margin-top: 10px; background: var(--pink-100); border: 1px dashed var(--pink-400); border-radius: 10px; padding: 8px 14px; font-weight: 800; letter-spacing: .5px; }
.me-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: linear-gradient(120deg, var(--pink-100), var(--pink-300)); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; }
.me-card .grow { flex: 1; min-width: 160px; }
.me-card .points { text-align: right; }
.me-card .points b { display: block; font-size: 26px; color: var(--point-dark); }
.progress { height: 10px; background: rgba(255, 255, 255, .7); border-radius: 5px; overflow: hidden; margin: 8px 0 4px; }
.progress i { display: block; height: 100%; background: var(--point); border-radius: 5px; }
.subtitle { font-size: 16px; font-weight: 800; margin: 18px 0 8px; }
.order-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.order-card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.status { font-size: 12px; font-weight: 800; background: var(--pink-200); padding: 3px 10px; border-radius: 999px; }
.log li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.log .plus { color: var(--point); font-weight: 800; white-space: nowrap; }
.log .use { color: var(--ink-2); font-weight: 800; white-space: nowrap; }
.muted { color: var(--ink-3); font-size: 12px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; text-align: center; animation: toast .25s both; }
@keyframes toast { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cats, .grades { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  html { scroll-padding-top: 170px; }
  .header-inner { height: auto; flex-wrap: wrap; gap: 8px 10px; padding-top: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .header-tools { margin-left: auto; }
  .user-chip { max-width: 170px; padding: 0 10px; }
  .user-chip .nm { display: none; }
  .logo-text { font-size: 20px; }
  .slider { aspect-ratio: auto; height: 500px; min-height: 0; }
  .slide { background: linear-gradient(180deg, var(--pink-100), #FFE1EA); }
  .slide img { position: absolute; left: 0; right: 0; bottom: 0; height: 56%; object-position: 76% 50%; }
  .slide-copy { top: 26px; left: 20px; right: 20px; transform: none; }
  .slide-copy h2 { margin: 10px 0 6px; }
  .slide-copy p { margin-bottom: 14px; }
  .slider-ui { left: 20px; bottom: 18px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .cats { gap: 10px; }
  .cat { flex-direction: column; text-align: center; gap: 8px; padding: 12px 8px; }
  .cat img { width: 64px; height: 64px; }
  .grades { gap: 10px; }
  .grade-card { padding: 16px; }
  .grade-card .rate { font-size: 26px; }
  .infos { grid-template-columns: 1fr; }
  .detail, .checkout-grid { grid-template-columns: 1fr; gap: 16px; }
  .row { flex-direction: column; gap: 0; }
  .pays { grid-template-columns: 1fr 1fr; }
  .modal { top: auto; bottom: 0; left: 0; width: 100%; max-height: 92dvh; border-radius: var(--radius-l) var(--radius-l) 0 0; transform: translateY(30px); }
  .modal.wide { width: 100%; }
  .modal.show { transform: none; }
  .section { padding-top: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
