/* ============================================================
   app.css — shop-core 공통 스타일
   기존 auth/login.html, home/home.html, error/error.html 인라인 스타일 통합
   CSS 프레임워크 미사용 (자체 최소 CSS)
   ============================================================ */

/* ── 기본 초기화 ── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* ── blank 레이아웃 body (로그인·에러: 중앙 정렬) ── */
body.blank-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* ── 헤더 ── */
header {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 24px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.site-name {
    font-size: 18px;
    font-weight: 700;
    color: #337ab7;
    text-decoration: none;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.header-auth > span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* 사용자 칩 (아바타 아이콘 + 이름) */
.header-user {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 220px;
    padding: 5px 12px 5px 8px;
    background: #eef2f7;
    border-radius: 999px;
    color: #334155;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-user::before {
    content: "";
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #337ab7;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='9' r='3.2'/%3E%3Cpath d='M5.5 19c0-3.7 3-5.6 6.5-5.6s6.5 1.9 6.5 5.6z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.header-logout-form {
    display: inline-flex;
    margin: 0;
}

/* 헤더 인증 버튼 — 공용 .btn-link(밑줄 링크) 대신 헤더 전용으로 버튼화 (스코프 한정) */
.header-auth a.btn-link {
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    background: #337ab7;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.4;
    transition: background-color 0.2s;
}
.header-auth a.btn-link:hover {
    background: #286090;
    color: #fff;
}
.header-auth button.btn-link {
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid #d4dae1;
    border-radius: 6px;
    background: #fff;
    color: #5a6470;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.4;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.header-auth button.btn-link:hover {
    background: #f5f7f9;
    border-color: #aab2bd;
    color: #333;
}

/* ── 네비게이션 ── */
nav {
    background-color: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 24px;
}

.nav-list {
    max-width: 1200px;
    margin: 0 auto;
    list-style: none;
    display: flex;
    gap: 0;
}

.nav-item {
    display: flex;
}

.nav-link {
    display: block;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover {
    color: #337ab7;
}

.nav-link-active {
    color: #337ab7;
    border-bottom-color: #337ab7;
}

/* ── 플래시 메시지 영역 ── */
.flash-region {
    max-width: 1200px;
    margin: 16px auto 0;
    padding: 0 24px;
}

/* ── 공통 풀 레이아웃 body: sticky footer (footer margin-top:auto가 동작하도록 flex 컬럼+최소 100vh) ── */
body.app-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
/* main이 남는 세로 공간을 채워 footer를 화면 맨 아래로 밀어냄.
   width:100%로 기존 max-width:1200 + margin:0 auto 중앙정렬을 flex 컨텍스트에서도 유지 */
body.app-body main {
    flex: 1 0 auto;
    width: 100%;
}
body.app-body > footer {
    flex-shrink: 0;
}

/* ── 공통 메인 래퍼 ── */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ── 푸터 ── */
footer {
    margin-top: auto;
    padding: 16px 24px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    background-color: #fff;
}

.footer-copy {
    font-size: 13px;
    color: #888;
}

/* ── 공통 버튼 링크 ── */
.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: #337ab7;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.btn-link:hover {
    color: #286090;
}

/* ── 알림(Alert) ── */
.alert {
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-success {
    background-color: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #276749;
}

.alert-error {
    background-color: #fdf2f2;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #f0f7ff;
    border: 1px solid #b8d8f5;
    color: #1a4971;
}

/* ── 토스트 알림 (flash 메시지를 app.js가 우측 상단 토스트로 변환) ── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    cursor: pointer;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid transparent;
    opacity: 0;
    transform: translateX(16px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-hide {
    opacity: 0;
    transform: translateX(16px);
}

.toast-success {
    background-color: #f0fff4;
    border-color: #9ae6b4;
    color: #276749;
}

.toast-error {
    background-color: #fdf2f2;
    border-color: #f5c6cb;
    color: #721c24;
}

/* ── 상품 등록/수정 폼 컨테이너 (장바구니 카드 스타일 적용) ── */
.product-form-container {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ── 폼 공통 ── */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #444;
}

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
textarea:focus {
    border-color: #337ab7;
}

/* textarea 전용 — 적정 높이·세로 리사이즈·페이지 폰트 상속(기본 monospace 방지) */
textarea {
    min-height: 96px;
    resize: vertical;
    font-family: inherit;
}

/* ── 이메일 입력(아이디 + 도메인 선택) ── */
.email-compose {
    display: flex;
    align-items: center;
    gap: 8px;
}
.email-compose .email-local {
    flex: 1 1 auto;
    min-width: 0;
}
.email-compose .email-at {
    color: #666;
    flex: 0 0 auto;
}
.email-compose .email-domain-custom {
    flex: 1 1 auto;
    min-width: 0;
}
.email-compose .email-domain {
    flex: 0 0 auto;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    background-color: #fff;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}
.email-compose .email-domain:focus {
    border-color: #337ab7;
}

/* ── 로그인 컨테이너 ── */
.login-container {
    background: #fff;
    border-radius: 8px;
    padding: 40px 44px;
    width: 520px;
    max-width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.login-container h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 28px;
    text-align: center;
    color: #222;
}

.login-container button[type="submit"] {
    width: 100%;
    padding: 11px;
    background-color: #337ab7;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background-color 0.2s;
}

.login-container button[type="submit"]:hover {
    background-color: #286090;
}

/* ── 홈 컨테이너 ── */
.home-container {
    background: #fff;
    border-radius: 8px;
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.home-container h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #222;
}

.welcome {
    font-size: 16px;
    color: #555;
    margin-bottom: 36px;
    line-height: 1.6;
}

.welcome strong {
    color: #337ab7;
}

.home-container form {
    display: inline-block;
}

.home-container button[type="submit"] {
    padding: 10px 24px;
    background-color: #d9534f;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.home-container button[type="submit"]:hover {
    background-color: #c9302c;
}

/* ── 에러 컨테이너 ── */
.error-container {
    background: #fff;
    border-radius: 8px;
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.error-status {
    font-size: 72px;
    font-weight: 700;
    color: #d9534f;
    line-height: 1;
    margin-bottom: 16px;
}

.error-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #222;
}

.error-message {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 32px;
}

.home-link {
    display: inline-block;
    padding: 10px 24px;
    background-color: #337ab7;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.home-link:hover {
    background-color: #286090;
}

/* ── 폼 하단 링크 (로그인·회원가입 화면 공통) ── */
.form-footer-link {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: #555;
}

.form-footer-link a {
    color: #337ab7;
    text-decoration: none;
}

.form-footer-link a:hover {
    text-decoration: underline;
}

/* ── 폼 필드 검증 에러 메시지 ── */
.field-error {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #721c24;
}

/* ── 선택 입력 레이블 보조 텍스트 ── */
.optional {
    font-size: 12px;
    font-weight: 400;
    color: #888;
}

/* ── input[type="email"] — text 스타일 상속 ── */
input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

input[type="email"]:focus {
    border-color: #337ab7;
}

/* ── 관리자 회원 관리 ── */
.admin-members-container {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin-bottom: 24px;
}

.search-form {
    margin-bottom: 20px;
}

.search-form-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.search-keyword input[type="text"] {
    width: 240px;
}

.search-role select {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.search-submit {
    padding-bottom: 0;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #337ab7;
    color: #fff;
}

.btn-primary:hover {
    background-color: #286090;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #565e64;
}

.btn-outline {
    background-color: #fff;
    border: 1px solid #ccc;
    color: #555;
}

.btn-outline:hover {
    background-color: #f0f0f0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 16px;
}

.members-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.members-table th,
.members-table td {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: middle;
}

.members-table thead th {
    background-color: #f8f8f8;
    font-weight: 600;
    color: #444;
}

.members-table tbody tr:hover {
    background-color: #fafafa;
}

.empty-msg {
    text-align: center;
    color: #888;
    padding: 24px;
}

/* ── 주문 목록 / 주문서 / 판매자 상품 목록 테이블 (동일 스타일 공유) ── */
.order-list-container .table-wrapper,
.checkout-container .table-wrapper,
.seller-product-list-container .table-wrapper {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.order-table,
.checkout-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.order-table thead th,
.checkout-table thead th {
    background-color: #f7f8fa;
    font-weight: 600;
    color: #555;
    padding: 13px 16px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid #ececec;
}
.order-table td,
.checkout-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    color: #333;
}
.order-table tbody tr:last-child td,
.checkout-table tbody tr:last-child td {
    border-bottom: none;
}
.order-table tbody tr:hover,
.checkout-table tbody tr:hover {
    background-color: #fafbfc;
}
/* 주문서 셀 정렬 (주문 목록과 동일 톤) */
.checkout-table .checkout-item-name { font-weight: 600; color: #2c3e50; }
.checkout-table .checkout-item-option { color: #777; }
.checkout-table .checkout-item-price { text-align: right; white-space: nowrap; color: #444; }
.checkout-table .checkout-item-quantity { text-align: center; color: #777; white-space: nowrap; }
.checkout-table .checkout-item-line-amount { text-align: right; font-weight: 700; color: #222; white-space: nowrap; }
.order-table .order-number {
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
}
.order-table .order-representative-item {
    color: #444;
}
.order-table .order-item-count {
    text-align: center;
    color: #777;
    white-space: nowrap;
}
.order-table .order-final-amount {
    text-align: right;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
}
.order-table .order-created-at {
    color: #999;
    white-space: nowrap;
}
.order-table .order-detail-link {
    text-align: center;
    white-space: nowrap;
}

/* 주문 상태 배지 */
.badge-order-status {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    background: #eef0f3;
    color: #555;
}
.badge-pending    { background: #fff3cd; color: #8a6d3b; }
.badge-paid       { background: #d4edda; color: #1e7e34; }
.badge-preparing  { background: #e2e3ff; color: #3f3f9e; }
.badge-shipping   { background: #cfe8ff; color: #1c5d99; }
.badge-delivered  { background: #c8e6c9; color: #1b5e20; }
.badge-cancelled  { background: #f8d7da; color: #a02834; }
.badge-refunded   { background: #e9ecef; color: #6c757d; }

/* 상품 상태 배지 (판매자 목록 전용) */
.badge-product-status {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    background: #eef0f3;
    color: #555;
}
.badge-product-on_sale  { background: #d4edda; color: #1e7e34; }
.badge-product-draft    { background: #fff3cd; color: #8a6d3b; }
.badge-product-sold_out { background: #f8d7da; color: #a02834; }
.badge-product-hidden   { background: #e9ecef; color: #6c757d; }

/* ── 주문서(checkout) 레이아웃 ── */
.checkout-container {
    max-width: 760px;
    margin: 0 auto;
}
.checkout-items-section,
.checkout-summary-section,
.checkout-shipping-section {
    margin-bottom: 28px;
}
.checkout-summary {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    font-size: 14px;
    color: #555;
}
.checkout-summary-row + .checkout-summary-row {
    border-top: 1px solid #f3f3f3;
}
.checkout-summary-value {
    font-weight: 600;
    color: #333;
}
.checkout-total-row {
    margin-top: 2px;
    padding-top: 14px;
    border-top: 2px solid #ececec;
}
.checkout-total-label {
    font-size: 15px;
    font-weight: 700;
    color: #222;
}
.checkout-total-amount {
    font-size: 20px;
    font-weight: 800;
    color: #d9534f;
}
.checkout-form {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.checkout-form .form-control {
    width: 100%;
}
.checkout-action {
    margin-top: 20px;
}
.checkout-action .btn-lg {
    width: 100%;
}
.checkout-back-link {
    margin-top: 20px;
    text-align: center;
}

/* ── 주문 상세(order detail) (주문내역/주문서와 동일 톤) ── */
.order-detail-container {
    max-width: 760px;
    margin: 0 auto;
}
.order-detail-header,
.order-detail-items,
.order-detail-amount,
.order-detail-shipping,
.order-detail-payment,
.order-detail-cancel,
.order-detail-shipments,
.order-detail-cancelled-notice {
    margin-bottom: 28px;
}
/* 정보 카드(헤더/배송지/결제/취소/배송 블록 공통) */
.order-detail-meta,
.shipping-info,
.payment-info,
.cancel-section,
.shipment-block {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.shipment-block + .shipment-block {
    margin-top: 14px;
}
/* 라벨/값 행 */
.order-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    font-size: 14px;
}
.order-detail-row + .order-detail-row {
    border-top: 1px solid #f5f5f5;
}
.order-detail-label {
    flex: 0 0 92px;
    color: #888;
    font-weight: 600;
}
.order-detail-value {
    color: #333;
}
/* 상세 항목 테이블 셀 정렬 (.checkout-table 공유 + order-item-* 셀) */
.checkout-table .order-item-name { font-weight: 600; color: #2c3e50; }
.checkout-table .order-item-option,
.checkout-table .order-item-option-values { color: #777; }
.checkout-table .order-item-price { text-align: right; white-space: nowrap; color: #444; }
.checkout-table .order-item-quantity { text-align: center; color: #777; white-space: nowrap; }
.checkout-table .order-item-line-amount { text-align: right; font-weight: 700; color: #222; white-space: nowrap; }
.option-value-list { list-style: none; margin: 0; padding: 0; }
.option-value-item { font-size: 12px; color: #777; line-height: 1.5; }
/* 결제 상태 / 배송 배지 */
.payment-status-paid { color: #1e7e34; font-weight: 700; }
.payment-status-pending { color: #8a6d3b; font-weight: 700; }
.badge-shipment-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #cfe8ff;
    color: #1c5d99;
}
.payment-form-section,
.payment-action {
    margin-top: 16px;
}
/* 취소/안내 */
.cancel-notice {
    color: #a02834;
    font-size: 13px;
    margin-bottom: 12px;
}
.cancel-complete-info {
    border: 1px solid #f5d2d2;
    background: #fdf3f4;
    border-radius: 8px;
    padding: 14px 18px;
}
.cancel-complete-label {
    color: #a02834;
    font-weight: 600;
}
/* 배송 포함 상품 목록 */
.shipment-items-block {
    margin: 10px 0;
}
.shipment-item-list {
    margin: 6px 0 0;
    padding-left: 18px;
    color: #555;
    font-size: 13px;
}
.shipment-tracking-info,
.shipment-delivered-info {
    margin-top: 6px;
}
.order-detail-back {
    margin-top: 20px;
    text-align: center;
}

.role-change-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.page-info {
    font-size: 14px;
    color: #555;
}

.page-nav {
    display: flex;
    gap: 8px;
}

/* ── 옵션/Variant 관리 화면 ── */
.variants-container {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.variants-section {
    margin-bottom: 40px;
    border-top: 1px solid #e0e0e0;
    padding-top: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
}

.subsection-title {
    font-size: 15px;
    font-weight: 600;
    color: #444;
    margin-bottom: 12px;
}

.option-list {
    margin-bottom: 24px;
}

.option-item {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.option-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.option-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    min-width: 80px;
}

.option-value-badge {
    display: inline-block;
    background: #e9f0f8;
    color: #337ab7;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 13px;
    margin-right: 4px;
}

.no-values {
    font-size: 13px;
    color: #aaa;
}

.option-value-form-wrapper {
    margin-top: 8px;
}

.form-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.form-inline label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 0;
    min-width: 70px;
}

.form-inline input[type="text"] {
    width: 180px;
    font-size: 13px;
    padding: 6px 10px;
}

.option-create-form {
    background: #f5f5f5;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

.variant-create-form {
    background: #f5f5f5;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

.variants-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.variants-table th,
.variants-table td {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: middle;
}

.variants-table thead th {
    background-color: #f8f8f8;
    font-weight: 600;
    color: #444;
}

.variants-table tbody tr:hover {
    background-color: #fafafa;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.check-label {
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 0;
    cursor: pointer;
}

.option-value-checks {
    margin-bottom: 12px;
}

.option-group-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.option-value-check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.option-value-check-row input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.variant-update-form {
    display: inline;
}

.back-link {
    margin-top: 24px;
}

/* ── 이미지 관리 화면 ── */
.images-container {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.images-section {
    margin-bottom: 40px;
    border-top: 1px solid #e0e0e0;
    padding-top: 24px;
}

.image-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.image-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    background: #f9f9f9;
    width: 240px;
}

.image-preview {
    position: relative;
    margin-bottom: 8px;
}

.product-image-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.badge-primary {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #337ab7;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
}

.image-info {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.image-order {
    display: block;
}

.image-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inline-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.input-short {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.btn-danger {
    background-color: #d9534f;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c9302c;
}

/* ── 공개 상품 목록 화면 ── */
.product-list-container {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.product-search-section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.search-category {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-sort {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-select {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.search-select:focus {
    border-color: #337ab7;
}

.product-grid-section {
    margin-bottom: 24px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.product-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
}

.placeholder-text {
    font-size: 13px;
    color: #aaa;
}

.product-card-body {
    padding: 12px 16px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-category {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: #337ab7;
    margin-bottom: 8px;
}

.badge-sold-out {
    display: inline-block;
    background: #d9534f;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
}

/* ── 관리자 통계 대시보드 ── */
.dashboard-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.dashboard-header .page-title {
    margin-bottom: 0;
}

.dashboard-period-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #e9f0f8;
    color: #337ab7;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.stat-card-header {
    background: #f8f8f8;
    padding: 12px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.stat-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

.stat-card-body {
    padding: 20px;
}

.stat-ratio {
    margin-bottom: 10px;
}

.stat-ratio-value {
    font-size: 32px;
    font-weight: 800;
    color: #337ab7;
    line-height: 1.2;
}

.stat-ratio-na {
    font-size: 18px;
    font-weight: 600;
    color: #aaa;
}

.stat-raw {
    font-size: 14px;
    color: #555;
}

.stat-raw-sep {
    color: #bbb;
}

.stat-raw-unit {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.stat-card-notice {
    padding: 10px 20px 14px;
    font-size: 12px;
    color: #888;
    line-height: 1.6;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.badge-on-sale {
    display: inline-block;
    background: #5cb85c;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
}

.pagination-section {
    margin-top: 20px;
}

/* ── 공개 상품 상세 화면 ── */
.product-detail-container {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.detail-back-link {
    margin-bottom: 24px;
}

.product-detail-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .product-detail-main {
        grid-template-columns: 1fr;
    }
}

/* 이미지 갤러리 */
.product-gallery {
    flex-shrink: 0;
}

.gallery-placeholder {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    border-radius: 8px;
}

.gallery-main-img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.gallery-thumbnails {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
}

.gallery-thumb:hover,
.thumb-active {
    border-color: #337ab7;
}

/* 상품 기본 정보 */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-detail-category {
    font-size: 13px;
    color: #888;
}

.product-detail-name {
    font-size: 24px;
    font-weight: 700;
    color: #222;
    line-height: 1.4;
}

.product-status {
    margin-bottom: 4px;
}

.badge-lg {
    font-size: 13px;
    padding: 4px 12px;
}

.product-price-area {
    margin-bottom: 8px;
}

.product-detail-price {
    font-size: 28px;
    font-weight: 700;
    color: #337ab7;
}

.product-description p {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
    white-space: pre-line;
}

/* 옵션 */
.product-options {
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
}

.option-group {
    margin-bottom: 12px;
}

.option-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.option-values {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Variant */
.product-variants {
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
}

.variant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.variant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f9f9f9;
}

.variant-unavailable {
    opacity: 0.6;
}

.variant-option {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-right: auto;
}

.variant-price {
    font-size: 15px;
    font-weight: 600;
    color: #337ab7;
}

.variant-available-badge {
    font-size: 12px;
    color: #5cb85c;
    font-weight: 500;
}

.variant-unavailable-badge {
    font-size: 12px;
    color: #d9534f;
    font-weight: 500;
}

/* 장바구니 */
.product-cart-action {
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
}

.btn-disabled-cart {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-notice {
    margin-top: 8px;
    font-size: 13px;
    color: #888;
    text-align: center;
}

/* ── 담기 폼 (상세화면) ── */
.cart-login-notice {
    text-align: center;
    padding: 16px 0;
}

.add-to-cart-form {
    margin-top: 8px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
}

.required {
    color: #d9534f;
    margin-left: 2px;
}

.variant-radio-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.variant-radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f9f9f9;
}

.variant-radio-item input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.variant-radio-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 0;
    cursor: pointer;
}

.variant-radio-disabled {
    opacity: 0.6;
}

.variant-radio-disabled input[type="radio"] {
    cursor: not-allowed;
}

.label-disabled {
    cursor: not-allowed;
}

.variant-radio-option {
    font-weight: 600;
    color: #333;
}

.variant-radio-price {
    font-weight: 600;
    color: #337ab7;
}

.variant-radio-status {
    font-size: 12px;
    color: #d9534f;
}

.add-to-cart-quantity-input {
    width: 100px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.add-to-cart-quantity-input:focus {
    border-color: #337ab7;
}

.cart-soldout-notice {
    padding: 12px 0;
}

/* ── 장바구니 화면 ── */
.cart-container {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cart-empty {
    text-align: center;
    padding: 40px 0;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cart-table th,
.cart-table td {
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: middle;
}

.cart-table thead th {
    background-color: #f8f8f8;
    font-weight: 600;
    color: #444;
}

.cart-item-row:hover {
    background-color: #fafafa;
}

.cart-item-unavailable {
    background-color: #fdf8f8;
}

.cart-item-product {
    min-width: 200px;
}

.cart-item-product-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-item-image {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.cart-item-image-placeholder {
    width: 64px;
    height: 64px;
    background: #eee;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    color: #aaa;
}

.cart-item-name-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-name {
    font-weight: 600;
    color: #222;
    font-size: 14px;
}

.badge-unavailable {
    display: inline-block;
    background: #d9534f;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
}

.badge-stock-shortage {
    display: inline-block;
    background: #f0ad4e;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
}

.cart-item-option {
    font-size: 13px;
    color: #666;
    min-width: 80px;
}

.cart-item-price {
    font-size: 14px;
    color: #337ab7;
    font-weight: 600;
    white-space: nowrap;
}

.cart-quantity-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-quantity-input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    text-align: center;
}

.cart-quantity-input:focus {
    border-color: #337ab7;
}

.cart-delete-form {
    display: inline;
}

.cart-item-line-amount {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
}

.cart-item-delete {
    text-align: center;
}

.cart-summary {
    margin-top: 24px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.cart-summary-row {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
}

.cart-summary-label {
    color: #555;
}

.cart-summary-value {
    font-weight: 600;
    color: #222;
}

.cart-total-amount {
    font-size: 20px;
    color: #337ab7;
}

.cart-action {
    margin-top: 24px;
    text-align: right;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.cart-order-notice {
    margin-top: 8px;
    font-size: 13px;
    color: #888;
}

.cart-back-link {
    margin-top: 24px;
}

/* ── 접근성: 시각적 숨김 ── */
.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;
}

/* ── 리뷰 영역 (상품 상세 + 작성/수정 폼) ── */

/* 상품 상세 리뷰 섹션 */
.product-review-section {
    margin-top: 40px;
    border-top: 2px solid #e0e0e0;
    padding-top: 32px;
}

.review-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.review-avg-rating {
    font-size: 36px;
    font-weight: 700;
    color: #f0ad4e;
    line-height: 1;
}

.review-avg-stars {
    font-size: 20px;
    color: #f0ad4e;
    letter-spacing: 2px;
}

.review-count-label {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

.review-no-rating {
    font-size: 14px;
    color: #aaa;
}

/* 리뷰 목록 */
.review-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.review-item {
    padding: 16px 20px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
}

.review-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.review-author {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.review-stars {
    font-size: 15px;
    color: #f0ad4e;
    letter-spacing: 1px;
}

.review-date {
    font-size: 12px;
    color: #aaa;
}

.review-content {
    font-size: 14px;
    color: #444;
    line-height: 1.7;
    white-space: pre-line;
    margin-bottom: 10px;
}

.review-no-content {
    font-size: 13px;
    color: #aaa;
    font-style: italic;
}

.review-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.review-empty {
    text-align: center;
    padding: 32px;
    color: #aaa;
    font-size: 14px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

/* 리뷰 폼 컨테이너 */
.review-form-container {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    max-width: 600px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 별점 선택 (라디오) */
.rating-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.rating-radio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.15s, border-color 0.15s;
}

.rating-radio-label:hover {
    background-color: #fff8e8;
    border-color: #f0ad4e;
}

.rating-radio-label input[type="radio"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.rating-star-char {
    font-size: 16px;
    color: #f0ad4e;
}

/* textarea (content) */
textarea.review-content-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

textarea.review-content-input:focus {
    border-color: #337ab7;
}

.char-count {
    font-size: 12px;
    color: #888;
    text-align: right;
    margin-top: 4px;
}

.review-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* ── 판매자 상품 목록 화면 ── */
.seller-product-list-container {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.seller-product-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.seller-product-list-header .page-title {
    margin-bottom: 0;
}

.seller-product-list-footer {
    margin-top: 16px;
    text-align: right;
}

.seller-product-name {
    font-weight: 600;
    color: #2c3e50;
}

.seller-product-price {
    text-align: right;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
}

.seller-product-actions {
    text-align: center;
    white-space: nowrap;
    display: flex;
    gap: 6px;
    justify-content: center;
}
