@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;900&display=swap');

:root {
  --bg: #FAFAF8;
  --card: #FFFFFF;
  --ink: #1C1C1C;
  --muted: #6B6B63;
  --border: #E5E1D8;
  --teal: #0F5C4A;
  --teal-dark: #0A4136;
  --amber: #C98A1F;
  --amber-soft: #FBF0DD;
  --danger: #B3402C;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(28,28,28,0.06);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font-family: 'Noto Sans KR', sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display { font-family: 'Noto Sans KR', sans-serif; font-weight: 900; letter-spacing: -0.01em; margin: 0; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px 100px; }
.notice, .site-footer { max-width: 680px; margin-left: auto; margin-right: auto; }

/* ---------- Header ---------- */
.site-header {
  padding: 34px 20px 24px; text-align: center;
  border-bottom: 1px solid var(--border); background: var(--card);
  position: relative;
}
.site-header .eyebrow { font-size: 12px; letter-spacing: 0.18em; color: var(--teal); font-weight: 700; margin-bottom: 10px; }
.site-header h1 { font-size: 24px; }
.cart-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  background: var(--teal); color: #fff; border: none; border-radius: 999px;
  padding: 14px 20px; font-weight: 700; font-size: 14px; box-shadow: 0 6px 18px rgba(15,92,74,0.35);
  display: flex; align-items: center; gap: 8px;
}
.cart-fab .count {
  background: #fff; color: var(--teal); border-radius: 999px; padding: 1px 8px; font-size: 12px;
}

/* ---------- Ended banner ---------- */
.ended-banner {
  margin: 20px 0; padding: 16px 18px; background: #F3E7E3; border: 1px solid #E4C6BC;
  color: var(--danger); border-radius: var(--radius); font-size: 14px; font-weight: 700; text-align: center;
}

/* ---------- Notice ---------- */
.notice {
  margin: 24px 0; padding: 18px 20px; background: var(--amber-soft); border: 1px solid #EFD9A8;
  border-radius: var(--radius); font-size: 14px; line-height: 1.7; color: #5C4315; white-space: pre-wrap;
}
.notice .notice-title { font-weight: 700; color: var(--amber); display: block; margin-bottom: 6px; font-size: 13px; }

/* ---------- Product Card ---------- */
.product-list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 24px;
}
@media (min-width: 640px) { .product-list { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .product-list { grid-template-columns: repeat(5, 1fr); gap: 16px; } }
.product-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  cursor: pointer; transition: transform 0.12s, box-shadow 0.12s;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(28,28,28,0.1); }
.product-thumb { position: relative; }
.product-thumb img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #EFEDE6; display: block; }
.product-thumb .no-img {
  width: 100%; aspect-ratio: 1/1; background: #EFEDE6; display: flex; align-items: center;
  justify-content: center; color: var(--muted); font-size: 12px;
}
.discount-badge {
  position: absolute; top: 8px; left: 8px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px;
}
.product-body { padding: 12px 12px 14px; display: flex; flex-direction: column; flex: 1; }
.product-body .brand-tag { margin-bottom: 6px; align-self: flex-start; }
.brand-tag {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--teal);
  background: #E6F0EC; padding: 3px 9px; border-radius: 999px; margin-bottom: 8px;
}
.product-body .name {
  font-size: 13px; font-weight: 700; margin-bottom: 8px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-body .price-block { margin-bottom: 10px; margin-top: auto; }
.product-body .price-normal { font-size: 12px; }
.product-body .price-creator { font-size: 16px; }
.btn-detail {
  width: 100%; padding: 9px; background: var(--teal); color: #fff; border: none;
  border-radius: 8px; font-size: 13px; font-weight: 700;
}
.btn-detail:hover { background: var(--teal-dark); }
.btn-detail:disabled { background: #C6C2B7; cursor: not-allowed; }

/* ---------- 상품 상세 모달 ---------- */
.detail-modal { max-width: 460px; }
.detail-image img { width: 100%; border-radius: 12px; margin-bottom: 14px; background: #EFEDE6; }
.detail-image .no-img {
  width: 100%; aspect-ratio: 1/1; background: #EFEDE6; border-radius: 12px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px;
}
.detail-desc {
  font-size: 14px; line-height: 1.8; color: #4A4A44; white-space: pre-wrap;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
}
.price-block { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.price-normal { text-decoration: line-through; color: var(--muted); font-size: 14px; }
.price-creator { color: var(--teal); font-size: 20px; font-weight: 900; }
.discount-pct { font-size: 12px; font-weight: 700; color: #fff; background: var(--danger); padding: 2px 7px; border-radius: 6px; }
.shipping-note { font-size: 12px; color: var(--muted); margin-bottom: 14px; }

.btn-row { display: flex; gap: 8px; }
.btn-row .btn-primary, .btn-row .btn-secondary, .btn-row .btn-danger { flex: 1; padding: 12px; }
.btn-cart, .btn-buy {
  flex: 1; padding: 12px; border-radius: 10px; font-size: 14px; font-weight: 700; border: none;
}
.btn-cart { background: #fff; color: var(--teal); border: 1px solid var(--teal); }
.btn-buy { background: var(--teal); color: #fff; }
.btn-cart:disabled, .btn-buy:disabled { background: #C6C2B7; border-color: #C6C2B7; color: #fff; cursor: not-allowed; }

/* ---------- Modal (shared: product qty / cart / checkout) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(28,28,28,0.5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 100;
}
@media (min-width: 640px) { .modal-overlay { align-items: center; } }
.modal {
  background: var(--card); width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 26px 24px 30px;
}
@media (min-width: 640px) { .modal { border-radius: 18px; } }
.modal h2 { font-size: 19px; margin-bottom: 16px; }
.modal .close-x { float: right; background: none; border: none; font-size: 22px; color: var(--muted); line-height: 1; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 15px; background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

.product-check-list {
  border: 1px solid var(--border); border-radius: 10px; max-height: 260px; overflow-y: auto; background: #fff;
}
.product-check-list .pcl-brand {
  padding: 8px 12px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--bg);
  position: sticky; top: 0;
}
.product-check-list label {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 14px; font-weight: 400;
  border-top: 1px solid var(--border); cursor: pointer; margin-bottom: 0;
}
.product-check-list label:first-child { border-top: none; }
.product-check-list input[type="checkbox"] { width: auto; }

.qty-control { display: flex; align-items: center; gap: 10px; }
.qty-control button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-size: 17px; font-weight: 700; }
.qty-control span { min-width: 26px; text-align: center; font-weight: 700; }

.summary-box { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 16px 0; }
.price-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); padding: 3px 0; }
.price-row .val { font-weight: 600; color: var(--ink); }
.price-row.total { color: var(--ink); font-weight: 700; font-size: 16px; border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 10px; }
.price-row.total .val { color: var(--teal); font-size: 19px; }

.cart-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: center; }
.cart-line img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #EFEDE6; }
.cart-line .info { flex: 1; }
.cart-line .info .name { font-size: 14px; font-weight: 700; }
.cart-line .info .price { font-size: 13px; color: var(--muted); }
.cart-line .remove { background: none; border: none; color: var(--danger); font-size: 12px; font-weight: 700; }
.cart-empty { text-align: center; color: var(--muted); padding: 40px 0; }

.bank-info-box {
  background: var(--amber-soft); border: 1px solid #EFD9A8; border-radius: 10px;
  padding: 16px 18px; font-size: 14px; line-height: 1.8; margin-bottom: 16px; white-space: pre-wrap;
}
.btn-submit { width: 100%; padding: 15px; background: var(--teal); color: #fff; border: none; border-radius: 10px; font-size: 16px; font-weight: 700; margin-top: 4px; }
.btn-submit:disabled { background: #C6C2B7; }
.error-text { color: var(--danger); font-size: 13px; margin-top: 6px; }
.help-text { color: var(--muted); font-size: 12px; margin-top: 6px; }

.confirm-icon { text-align: center; font-size: 40px; margin-bottom: 8px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- Footer (seller info) ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 40px; padding: 24px 20px 60px;
  text-align: center; font-size: 12px; color: var(--muted); line-height: 2;
}
.site-footer .seller-name { font-weight: 700; color: var(--ink); }

/* ---------- Admin ---------- */
.admin-shell { max-width: 960px; margin: 0 auto; padding: 32px 20px 80px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.admin-header h1 { font-size: 22px; }
.tab-bar { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab-btn { background: none; border: none; padding: 12px 6px; margin-right: 18px; font-size: 15px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; }
.tab-btn.active { color: var(--teal); border-color: var(--teal); }
.panel { display: none; }
.panel.active { display: block; }
.card-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.btn-primary { background: var(--teal); color: #fff; border: none; border-radius: 8px; padding: 10px 18px; font-weight: 700; font-size: 14px; }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: 10px 18px; font-weight: 700; font-size: 14px; }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid var(--danger); border-radius: 8px; padding: 8px 14px; font-weight: 700; font-size: 13px; }
.link-btn { background: none; border: none; padding: 0; color: var(--teal); font-weight: 700; text-decoration: underline; cursor: pointer; font-size: inherit; font-family: inherit; }
.btn-small { padding: 6px 12px; font-size: 12px; border-radius: 6px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 700; font-size: 12px; }
.table-scroll { overflow-x: auto; }

.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-pending { background: #FBF0DD; color: var(--amber); }
.status-paid { background: #E6F0EC; color: var(--teal); }
.status-cancelled { background: #F3E7E3; color: var(--danger); }
.status-active { background: #E6F0EC; color: var(--teal); }
.status-ended { background: #F3E7E3; color: var(--danger); }

.product-row-img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: #EFEDE6; }

.link-copy-box {
  display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--muted); margin-top: 4px;
}
.link-copy-box input { flex: 1; border: none; background: none; font-size: 12px; color: var(--ink); font-family: monospace; }

.login-shell { max-width: 360px; margin: 100px auto; padding: 0 20px; }

.settlement-result { margin-top: 18px; }
.settlement-figure { font-size: 32px; font-weight: 900; color: var(--teal); }
.settlement-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* ---------- 주문 완료 영수증 ---------- */
.order-receipt { margin-bottom: 16px; }
.receipt-no {
  text-align: center; font-weight: 700; font-size: 14px; color: var(--teal);
  background: #E6F0EC; border-radius: 8px; padding: 8px; margin-bottom: 12px;
}
.receipt-info {
  font-size: 13px; line-height: 1.9; color: var(--muted);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
}
.receipt-info b { color: var(--ink); display: inline-block; min-width: 54px; }

/* ---------- 헤더 주문조회 링크 ---------- */
.header-link {
  position: absolute; right: 16px; top: 18px;
  background: none; border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font-size: 12px; font-weight: 700; color: var(--muted);
}
.header-link:hover { color: var(--teal); border-color: var(--teal); }

/* ---------- 이메일 받기 ---------- */
.mail-request-box {
  border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px;
  background: var(--bg);
}
.mail-request-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.mail-request-row { display: flex; gap: 8px; }
.mail-request-row input {
  flex: 1; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px;
  font-family: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
.mail-request-row input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.btn-mail-send {
  padding: 11px 20px; background: var(--teal); color: #fff; border: none;
  border-radius: 9px; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.btn-mail-send:disabled { background: #C6C2B7; }

/* ---------- 주문조회 결과 ---------- */
.lookup-status { text-align: center; margin-bottom: 14px; }
.btn-cancel-order {
  width: 100%; padding: 14px; background: #fff; color: var(--danger);
  border: 1px solid var(--danger); border-radius: 10px; font-size: 15px; font-weight: 700;
}
.btn-cancel-order:disabled { color: #C6C2B7; border-color: #C6C2B7; }

/* ---------- 주문조회 목록 ---------- */
.order-block {
  border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  margin-bottom: 14px; background: #fff;
}
.order-block-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.order-block-date { font-size: 12px; color: var(--muted); }
.order-block .receipt-no { font-size: 13px; }
.order-block .summary-box { margin: 10px 0; }
.order-block .receipt-info { margin-bottom: 12px; }
