/* 도매여기 — 따뜻한 어그 톤 */
:root {
    --cream: #faf6f0;
    --sand: #efe6d8;
    --sand-deep: #e2d3bd;
    --line: #e8dfd2;
    --ink: #2b211b;
    --ink-soft: #6f6258;
    --chestnut: #9a5b2e;
    --chestnut-deep: #7a4520;
    --espresso: #3a2a20;
    --radius: 14px;

    --bs-body-font-family: 'Pretendard', system-ui, -apple-system, sans-serif;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--cream);
    --bs-secondary-color: var(--ink-soft);
    --bs-border-color: var(--line);
    --bs-link-color-rgb: 154, 91, 46;
    --bs-link-hover-color-rgb: 122, 69, 32;
    --bs-primary-rgb: 154, 91, 46;
    --bs-dark-rgb: 58, 42, 32;
    --bs-light-rgb: 247, 241, 233;
    --bs-border-radius: 10px;
    --bs-border-radius-lg: var(--radius);
}

body { background: var(--cream); letter-spacing: -.01em; -webkit-font-smoothing: antialiased; }
.text-secondary { color: var(--ink-soft) !important; }
.text-primary { color: var(--chestnut) !important; }
.bg-light { background-color: #f7f1e9 !important; }
.table-light { --bs-table-bg: #f7f1e9; --bs-table-color: var(--ink-soft); }
::selection { background: var(--sand-deep); }

/* 버튼 */
.btn { font-weight: 600; border-radius: 10px; }
.btn-dark {
    --bs-btn-bg: var(--espresso); --bs-btn-border-color: var(--espresso);
    --bs-btn-hover-bg: var(--chestnut-deep); --bs-btn-hover-border-color: var(--chestnut-deep);
    --bs-btn-active-bg: var(--chestnut-deep); --bs-btn-active-border-color: var(--chestnut-deep);
    --bs-btn-disabled-bg: #8d7d71; --bs-btn-disabled-border-color: #8d7d71;
}
.btn-outline-dark {
    --bs-btn-color: var(--espresso); --bs-btn-border-color: var(--sand-deep);
    --bs-btn-hover-bg: var(--sand); --bs-btn-hover-color: var(--espresso); --bs-btn-hover-border-color: var(--sand-deep);
    --bs-btn-active-bg: var(--sand-deep); --bs-btn-active-color: var(--espresso); --bs-btn-active-border-color: var(--sand-deep);
}
.btn-accent {
    --bs-btn-bg: var(--chestnut); --bs-btn-border-color: var(--chestnut); --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--chestnut-deep); --bs-btn-hover-border-color: var(--chestnut-deep); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--chestnut-deep); --bs-btn-active-color: #fff;
}
.nav-pills .nav-link { border-radius: 999px; padding: .4rem 1rem; font-weight: 500; }
.nav-pills .nav-link.active, .nav-pills .nav-link.active.bg-dark { background: var(--espresso) !important; }
.nav-pills .nav-link:not(.active):hover { background: var(--sand); }

/* 폼 */
.form-control, .form-select { border-color: var(--line); border-radius: 10px; padding: .6rem .85rem; }
.form-control-sm { padding: .3rem .5rem; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: var(--chestnut); box-shadow: 0 0 0 .2rem rgba(154, 91, 46, .15); }
.form-check-input:checked { background-color: var(--chestnut); border-color: var(--chestnut); }
.form-label { font-weight: 600; font-size: .9rem; }
.form-control[readonly] { background: #fbf8f4; }

/* 카드/패널 */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.bg-white.rounded-3 { border: 1px solid var(--line); border-radius: var(--radius) !important; }
.section-title { font-weight: 800; letter-spacing: -.03em; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--chestnut); }

/* 테이블 */
.table { --bs-table-border-color: var(--line); margin-bottom: 0; }
.table > thead th { font-size: .8rem; font-weight: 600; white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #fbf7f1; }
.badge { font-weight: 600; padding: .4em .7em; border-radius: 999px; }
.alert { border-radius: 12px; border: 0; }
.alert-success { background: #edf5ea; color: #2f5d2a; }
.alert-warning { background: #fbf1df; color: #7a5212; }
.alert-danger { background: #fbe9e6; color: #8a2b1f; }
.pagination { --bs-pagination-color: var(--ink); --bs-pagination-active-bg: var(--espresso); --bs-pagination-active-border-color: var(--espresso); --bs-pagination-border-color: var(--line); }

/* ── 쇼핑몰 헤더 ── */
.topbar { background: var(--espresso); color: #e9dccb; font-size: .78rem; }
.site-header { background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020; }
.logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.35rem; letter-spacing: -.04em; color: var(--espresso); text-decoration: none; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--chestnut); color: #fff; display: grid; place-items: center; font-size: .95rem; }
.header-link { color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 500; display: inline-flex; align-items: center; gap: .3rem; position: relative; }
.header-link:hover { color: var(--chestnut); }

/* 카테고리 메뉴 (wiit 메가메뉴: 대분류 hover → 중·소분류) */
.cat-nav { border-top: 1px solid var(--line); }
.cat-nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.75rem; overflow-x: auto; scrollbar-width: none; }
.cat-nav-list::-webkit-scrollbar { display: none; }
.cat-nav-item { position: relative; }
.cat-nav-link { display: block; padding: .7rem 0; color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; }
.cat-nav-link:hover, .cat-nav-link.active { color: var(--chestnut); border-bottom-color: var(--chestnut); }
.cat-mega { display: none; }
@media (min-width: 992px) {
    .cat-nav-list { overflow: visible; }
    .cat-mega { position: absolute; top: 100%; left: -1.25rem; z-index: 1030; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(58, 42, 32, .12); padding: 1.1rem 1.25rem; gap: 2rem; }
    .cat-nav-item:hover .cat-mega, .cat-nav-item:focus-within .cat-mega { display: flex; }
}
.cat-mega-col { display: flex; flex-direction: column; gap: .35rem; min-width: 100px; }
.cat-mega-title { color: var(--ink); font-weight: 700; font-size: .9rem; text-decoration: none; margin-bottom: .15rem; white-space: nowrap; }
.cat-mega-link { color: var(--ink-soft); font-size: .85rem; text-decoration: none; white-space: nowrap; }
.cat-mega-title:hover, .cat-mega-link:hover { color: var(--chestnut); }
.cart-count { position: absolute; top: -8px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--chestnut); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.header-search { position: relative; }
.header-search input { border-radius: 999px; padding-left: 2.4rem; background: var(--cream); border-color: transparent; }
.header-search input:focus { background: #fff; }
.header-search i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--ink-soft); }

/* 히어로 */
.hero { position: relative; overflow: hidden; border-radius: 24px; background: linear-gradient(120deg, #3a2a20 0%, #6b4428 55%, #a8703f 100%); color: #fbf3e8; padding: 3.5rem 3rem; }
.hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(239, 213, 175, .35), transparent 70%); }
.hero h1 { font-weight: 800; letter-spacing: -.04em; line-height: 1.25; }
.hero p { color: #e6d5c0; }
.hero .btn-light { color: var(--espresso); font-weight: 700; }
.hero-points { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 2rem; font-size: .9rem; color: #f0e2cf; }
.hero-points i { color: #e7c08f; margin-right: .35rem; }

/* 상품 카드 */
.product-card { display: block; color: var(--ink); text-decoration: none; }
.product-thumb { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: #f3ece2; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .product-thumb img { transform: scale(1.04); }
.product-thumb .placeholder-icon { position: absolute; inset: 0; display: grid; place-items: center; color: #cdb99f; font-size: 2.5rem; }
.product-brand { font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: var(--chestnut); text-transform: uppercase; margin-top: .75rem; }
.product-name { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.product-price { font-weight: 800; font-size: 1.05rem; margin-top: .25rem; }
.price-locked { font-size: .85rem; color: var(--ink-soft); display: inline-flex; gap: .3rem; align-items: center; background: var(--sand); padding: .2rem .6rem; border-radius: 999px; margin-top: .35rem; }

/* 재고 매트릭스 */
.stock-matrix { border-collapse: separate; border-spacing: 0; }
.stock-matrix th, .stock-matrix td { border-color: var(--line); }
.stock-matrix thead th { background: #f7f1e9; }
.stock-matrix tbody th { background: #fbf8f4; }
.stock-matrix .qty { border-radius: 8px; font-weight: 700; }
.stock-matrix .qty:not(:placeholder-shown) { background: #fbf1e4; border-color: var(--chestnut); }
.stock-matrix td.soldout { color: #b9aa9b; background: repeating-linear-gradient(135deg, #fff, #fff 6px, #faf6f0 6px, #faf6f0 12px); }
.order-bar { position: sticky; bottom: 1rem; z-index: 10; background: var(--espresso); color: #fff; border-radius: var(--radius); box-shadow: 0 12px 32px rgba(58, 42, 32, .25); }
.order-bar .btn-light { color: var(--espresso); font-weight: 700; }

/* 인증 화면 */
.auth-wrap { min-height: calc(100vh - 220px); display: flex; align-items: center; }
.auth-aside { background: linear-gradient(160deg, #3a2a20, #8a5530); color: #f6eadb; border-radius: 20px; padding: 2.5rem; }
.auth-aside li { margin-bottom: .75rem; }
.auth-aside i { color: #e7c08f; margin-right: .5rem; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--sand); color: var(--espresso); font-weight: 700; font-size: .8rem; display: inline-grid; place-items: center; }

/* 푸터 */
.site-footer { background: #f3ece2; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .85rem; }

/* ── 관리자 ── */
.admin-body { background: #f6f2ec; }
.admin-sidebar { width: 232px; background: var(--espresso); color: #d9cbb9; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1030; }
.admin-sidebar .logo { color: #fff; }
.admin-sidebar .logo-mark { background: #c58a52; }
.admin-nav a { display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; margin: .15rem .75rem; border-radius: 10px; color: #d9cbb9; text-decoration: none; font-weight: 500; }
.admin-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-nav a.active { background: rgba(231, 192, 143, .16); color: #fff; }
.admin-nav a.active i { color: #e7c08f; }
.admin-nav .count { margin-left: auto; background: #c58a52; color: #fff; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: .1rem .5rem; }
.admin-main { margin-left: 232px; min-height: 100vh; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--line); height: 60px; position: sticky; top: 0; z-index: 1020; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform .2s; }
    .admin-sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    .admin-main { margin-left: 0; }
}
@media (max-width: 575.98px) {
    .hero { padding: 2.25rem 1.5rem; border-radius: 18px; }
}
.stock-matrix .qty { -moz-appearance: textfield; }
.stock-matrix .qty::-webkit-outer-spin-button, .stock-matrix .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stock-matrix th, .stock-matrix td { padding-left: .25rem; padding-right: .25rem; }
.form-control, .form-select { background-color: #fff; }
.form-control:disabled { background-color: #f3ece2; }
.table { --bs-table-bg: #fff; }
main > .container > form.header-search input, form.header-search.d-md-none input { background: #fff; border-color: var(--line); }
.text-bg-warning { background-color: #f5dfb8 !important; color: #6b4410 !important; }
.text-bg-success { background-color: #dcebd6 !important; color: #2f5d2a !important; }
.text-bg-danger { background-color: #f6d9d4 !important; color: #8a2b1f !important; }
.text-bg-secondary { background-color: #e6ded4 !important; color: #5d5148 !important; }

/* 메인: 카테고리 바로가기 (wiit 메인 바로가기 pill 스타일) + 대분류별 섹션 */
.cat-shortcuts { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }
.cat-shortcut { display: inline-flex; align-items: center; gap: .7rem; padding: .45rem 1.25rem .45rem .45rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; transition: transform .2s, box-shadow .2s; }
.cat-shortcut:hover { color: var(--chestnut); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(58, 42, 32, .1); }
.cat-shortcut-img { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: grid; place-items: center; background: var(--sand); color: var(--chestnut); font-weight: 800; }
.cat-shortcut-img img { width: 100%; height: 100%; object-fit: cover; }
.home-section + .home-section { margin-top: 3.5rem; padding-top: 3rem; border-top: 1px solid var(--line); }
.sub-chips { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; }
.sub-chips::-webkit-scrollbar { display: none; }
.sub-chip { padding: .35rem .9rem; border-radius: 999px; background: var(--sand); color: var(--ink-soft); font-size: .85rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.sub-chip:hover { background: var(--espresso); color: #fff; }
@media (max-width: 767px) {
    .cat-shortcuts { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding: 0 12px 4px; }
    .cat-shortcuts::-webkit-scrollbar { display: none; }
    .cat-shortcut { padding: .35rem 1rem .35rem .35rem; font-size: .85rem; }
    .cat-shortcut-img { width: 34px; height: 34px; }
}

/* 관리자 상품 이미지 드래그앤드롭 */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: 1.75rem 1rem; border: 2px dashed var(--sand-deep); border-radius: var(--radius); background: var(--cream); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone i { font-size: 2rem; color: var(--chestnut); }
.dropzone:hover, .dropzone.is-over { border-color: var(--chestnut); background: #f6ece0; }
.image-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .6rem; margin-top: .75rem; }
.image-list:empty { display: none; }
.image-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; cursor: grab; }
.image-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.image-item.sortable-ghost { opacity: .35; }
.image-main { position: absolute; top: 6px; left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--espresso); color: #fff; font-size: .7rem; font-weight: 700; }
.image-remove { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: .7rem; display: grid; place-items: center; }
.image-remove:hover { background: #dc3545; }
.note-editor.note-frame { border-color: var(--line); border-radius: 10px; }
.note-editor .note-toolbar { background: #f7f1e9; border-radius: 10px 10px 0 0; }

/* 상품 상세설명 (에디터 HTML) */
.rich-text { line-height: 1.8; overflow-wrap: break-word; }
.rich-text img { max-width: 100%; height: auto; }
.rich-text table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.rich-text td, .rich-text th { border: 1px solid var(--line); padding: .4rem .6rem; }

/* 회원 주문내역 카드 */
.order-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.order-card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); background: #fcfaf7; }
.order-card-body { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; color: var(--ink); text-decoration: none; }
.order-card-body:hover { background: #fbf7f1; }
.order-thumb { width: 72px; height: 72px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: #f3ece2; display: grid; place-items: center; color: #cdb99f; font-size: 1.6rem; }
.order-thumb img { width: 100%; height: 100%; object-fit: cover; }
.min-w-0 { min-width: 0; }
.order-steps { display: flex; list-style: none; margin: 0; padding: 0 1.1rem 1rem; counter-reset: step; }
.order-steps li { flex: 1; position: relative; text-align: center; font-size: .72rem; color: #b9aa9b; padding-top: 1.1rem; white-space: nowrap; }
.order-steps li::before { content: ''; position: absolute; top: 3px; left: 50%; transform: translateX(-50%); width: 10px; height: 10px; border-radius: 50%; background: var(--line); z-index: 1; }
.order-steps li::after { content: ''; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.order-steps li:first-child::after { display: none; }
.order-steps li.done, .order-steps li.current { color: var(--ink-soft); }
.order-steps li.done::before, .order-steps li.done::after, .order-steps li.current::after { background: var(--chestnut); }
.order-steps li.current { color: var(--chestnut); font-weight: 700; }
.order-steps li.current::before { background: var(--chestnut); box-shadow: 0 0 0 4px rgba(154, 91, 46, .18); }
.order-card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .75rem 1.1rem; border-top: 1px solid var(--line); }
@media (max-width: 575.98px) {
    .order-steps li { font-size: .62rem; }
    .order-thumb { width: 60px; height: 60px; }
}
