/* 공용 쇼핑몰 엔진 고객 화면 (색은 config shop.theme 이 :root 변수로 덮어써요) */
:root {
  --bg: #FFFFFF; --soft: #F6F5F1; --line: #E6E3DA; --text: #1B1F1D; --muted: #666B67;
  --brand: #B8860B; --brand-dark: #8A6508; --logo: #0A3D62; --accent: #1C5D4B; --danger: #B83232; --warn-bg: #FFF4E0;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; font-size: 15px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.top { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--logo); white-space: nowrap; letter-spacing: -0.01em; }
.logo img { width: 28px; height: auto; display: block; }
.search { flex: 1; display: flex; max-width: 460px; }
.search input { flex: 1; height: 40px; border: 1.5px solid var(--brand); border-right: 0; border-radius: 20px 0 0 20px; padding: 0 16px; min-width: 0; }
.search button { height: 40px; border: 0; background: var(--brand); color: #fff; border-radius: 0 20px 20px 0; padding: 0 16px; cursor: pointer; }
.top-links { display: flex; gap: 14px; align-items: center; font-size: 14px; white-space: nowrap; }
.top-links form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; font-size: 14px; }
.cart-count { background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; margin-left: 2px; }
.cats { background: var(--soft); border-bottom: 1px solid var(--line); }
.cats .wrap { display: flex; gap: 18px; overflow-x: auto; height: 44px; align-items: center; font-size: 14px; }
.cats a { white-space: nowrap; color: var(--muted); }
.cats a.on, .cats a:hover { color: var(--text); font-weight: 700; }
.cats { position: relative; }
.all-cats summary { list-style: none; cursor: pointer; white-space: nowrap; font-weight: 700; color: var(--text); }
.all-cats summary::-webkit-details-marker { display: none; }
.all-cats .mega { position: absolute; left: 0; right: 0; top: 44px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 8px 20px rgba(0,0,0,.08); z-index: 30; max-height: 70vh; overflow-y: auto; }
.all-cats .mega .wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 16px; height: auto; padding: 18px 16px; align-items: start; overflow: visible; }
.mega-col { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.mega-col a { white-space: normal; }
.mega-col .mega-sub { padding-left: 10px; color: var(--muted); font-size: 12.5px; }
.mega-col .mega-top { color: var(--text); font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.crumbs { font-size: 13px; color: var(--muted); margin: 18px 0 -8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chips a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); background: #fff; }
.chips a.on, .chips a:hover { border-color: var(--logo); color: var(--logo); font-weight: 700; }

.notice-bar { background: var(--warn-bg); font-size: 13px; color: #7A4B00; }
.notice-bar .wrap { padding: 8px 16px; }
main { padding: 24px 0 64px; }
.section-title { font-size: 20px; font-weight: 700; margin: 8px 0 14px; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.alert.ok { background: #E3F2EA; color: #15613B; }
.alert.error { background: #FBE7E7; color: var(--danger); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 16px; }
.card .thumb { aspect-ratio: 1/1; background: var(--soft); border-radius: 12px; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .name { margin-top: 8px; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .price { font-weight: 800; margin-top: 2px; }
.card .soldout { color: var(--danger); font-size: 13px; font-weight: 700; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filters select { height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; }
.pager { margin-top: 24px; }

.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.gallery .main-img { aspect-ratio: 1/1; background: var(--soft); border-radius: 14px; overflow: hidden; }
.gallery .main-img img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery .thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.gallery .thumbs img.on { border-color: var(--brand); }
.info h1 { font-size: 22px; line-height: 1.4; }
.info .price { font-size: 26px; font-weight: 800; margin: 10px 0 4px; }
.info .summary { color: var(--muted); margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], select.full {
  width: 100%; height: 44px; border: 1px solid #CFCCC2; border-radius: 10px; padding: 0 12px; background: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid #CFCCC2; background: #fff; cursor: pointer; font-weight: 700; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.block { width: 100%; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.guide-box { background: var(--soft); border-radius: 12px; padding: 14px 16px; font-size: 13px; color: #444; margin-top: 16px; }
.guide-box strong { color: var(--text); }
.guide-box ul { margin: 6px 0 0; padding-left: 18px; }
.desc { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 24px; white-space: pre-line; }

.box { max-width: 440px; margin: 0 auto; }
.box h1 { font-size: 24px; margin-bottom: 18px; }
.social-buttons { display: grid; gap: 8px; margin-bottom: 14px; }
.btn.social { gap: 8px; }
.btn.social .mark { font-weight: 800; }
.btn.social.naver { background: #03C75A; border-color: #03C75A; color: #fff; }
.btn.social.kakao { background: #FEE500; border-color: #FEE500; color: #191919; }
.btn.social.google { background: #fff; border-color: #DADCE0; color: #1F1F1F; }
.btn.social.google .mark { color: #4285F4; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 6px 0 16px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: #E4E1D8; }
.account-tabs { display: flex; gap: 4px; border-bottom: 1px solid #E4E1D8; margin-bottom: 20px; }
.account-tabs a { padding: 10px 12px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.account-tabs a.on { color: var(--logo); font-weight: 700; border-bottom-color: var(--logo); }
.agree { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 16px 0; font-size: 14px; }
.agree label { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; }
.agree a { color: var(--accent); text-decoration: underline; }

.cart-table { width: 100%; border-collapse: collapse; }
.cart-table td, .cart-table th { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
.cart-table th { font-size: 13px; color: var(--muted); font-weight: 500; }
.cart-table .num { text-align: right; white-space: nowrap; }
.cart-table img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.cart-sum { margin-top: 20px; display: flex; justify-content: flex-end; }
.cart-sum .box2 { min-width: 300px; background: var(--soft); border-radius: 12px; padding: 16px; }
.cart-sum .row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.cart-sum .total { font-size: 20px; font-weight: 800; }

.legal { max-width: 760px; }
.legal h1 { font-size: 24px; margin-bottom: 8px; }
.legal h2 { font-size: 17px; margin: 22px 0 6px; }
.legal p, .legal li { color: #333; }
.draft-flag { background: #FBE7E7; color: var(--danger); padding: 8px 12px; border-radius: 8px; font-size: 13px; margin: 10px 0 18px; }

.foot { background: var(--soft); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot .wrap { padding: 24px 16px 40px; }
.foot .links { display: flex; gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.foot .links a { color: var(--muted); }
.foot .links a:hover { text-decoration: underline; }
/* 개인정보처리방침은 법상 다른 고지와 구분되게 보여야 해서 색만 조금 진하게 둬요(굵게는 안 함). */
.foot .links a.privacy { color: var(--text); }
.foot p { margin: 2px 0; }

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .detail { grid-template-columns: 1fr; gap: 20px; }
  .top .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .top-links { margin-left: auto; }
  .cart-table .hide-m { display: none; }
}
