/* CSS SPLIT MANIFEST (Option A): base/layout/components/pages */
/* AI-ANCHOR:RESPELLMON:STYLE-ENTRY */
@import url('./base/variables.css');
@import url('./layout/header.css');
@import url('./layout/grid.css');
@import url('./components/buttons.css');
@import url('./components/cards.css');
@import url('./components/forms.css');
@import url('./components/toast.css');
/* Page bundles (seller) */
@import url('./pages/seller/common.css');
@import url('./pages/seller/index.css');
@import url('./pages/seller/new_order.css');
@import url('./pages/seller/edit_order.css');
@import url('./pages/seller/product_detail.css');

/* --- Global Styles --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
    --primary-color: #FF6F00; /* A vibrant orange */
    --primary-hover-color: #FF8F00;
    --accent-color: #A2D2FF; /* Sky Blue */
    --accent-hover-color: #8EC9FF;
    --danger-color: #ff6b6b; /* Red for stop/delete */
    --danger-hover-color: #ff4d4d;
    --disabled-color: #adb5bd;
    --light-gray-color: #f8f9fa; /* Lighter background */
    --medium-gray-color: #e9ecef; /* Borders */
    --dark-gray-color: #343a40;
    --background-color: #ffffff;
    --text-color: #212529;
    --border-radius: 12px;
    --shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
}

/* 390px 고정 레이아웃 - 종횡비 유지 스케일링 (viewport에서 처리) */
html {
    overflow-x: hidden;
    width: 100%;
}

/* PC 화면에서는 전체 너비 사용 */
@media (min-width: 781px) {
    html {
        width: 100%;
    }
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    margin: 0 auto;
    background-color: var(--light-gray-color);
    color: var(--text-color);
    box-sizing: border-box;
    overflow-x: hidden;
    width: 390px;
    min-width: 390px;
}

/* PC 화면에서는 전체 너비 사용 */
@media (min-width: 781px) {
    body {
        width: 100%;
        min-width: 100%;
        max-width: 1920px;
    }
}

/* Top Bar - 스타일은 layout/header.css에서 관리 */

/* .top-bar, .top-bar-links, .top-bar-link 스타일은 layout/header.css 참조 */

/* 금색 알 아이콘 - 공통 */
.gold-egg {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="goldGradient" x1="0%25" y1="0%25" x2="0%25" y2="100%25"><stop offset="0%25" style="stop-color:%23FFD700;stop-opacity:1" /><stop offset="50%25" style="stop-color:%23FFA500;stop-opacity:1" /><stop offset="100%25" style="stop-color:%23FF8C00;stop-opacity:1" /></linearGradient></defs><ellipse cx="12" cy="13" rx="7" ry="9" fill="url(%23goldGradient)" stroke="%23DAA520" stroke-width="0.5"/><ellipse cx="9" cy="10" rx="2" ry="2.5" fill="%23FFFFE0" opacity="0.4"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
}

.gold-egg.size-16 {
    width: 16px;
    height: 16px;
}

.gold-egg.size-20 {
    width: 20px;
    height: 20px;
}

.gold-egg.size-24 {
    width: 24px;
    height: 24px;
}

/* 쪽지 아이콘 깜빡임 애니메이션 */
@keyframes messageBlink {
    0%, 100% { 
        stroke: #ff4757;
    }
    50% { 
        stroke: #ff6348;
    }
}

/* 안읽은 쪽지가 있을 때만 깜빡임 */
.top-bar-link.message-link:has(.message-badge) svg {
    animation: messageBlink 0.7s ease-in-out infinite;
}

.top-bar-link.message-link:has(.message-badge) svg path,
.top-bar-link.message-link:has(.message-badge) svg polyline {
    animation: messageBlink 0.7s ease-in-out infinite;
}

/* 쪽지 안읽은 개수 배지 - 숫자만 깔끔하게 */
.message-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: transparent;
    color: #ff4757;
    font-size: 12px;
    font-weight: 700;
    padding: 0;
    min-width: auto;
    text-align: center;
    line-height: 1;
}

/* .container 스타일은 layout/grid.css에서 관리 */

/* Login Page */
.login-container {
    background-color: var(--background-color);
    padding: 50px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    margin: 50px auto;
}

.login-container h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 15px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--medium-gray-color);
    border-radius: var(--border-radius);
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-size: 12px;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 111, 0, 0.15);
}

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--primary-color);
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

/* 비활성화된 버튼 공통 스타일 */
.btn:disabled {
    background-color: var(--disabled-color);
    cursor: not-allowed;
}

.btn:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
}

.btn-small {
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    width: auto;
    display: inline-block;
}

.btn-small:hover {
    transform: translateY(-2px);
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--medium-gray-color);
}

.dashboard-header h1 {
    font-size: 20px;
    color: var(--dark-gray-color);
    margin: 0;
    font-weight: 700;
}

.dashboard-content {
    position: relative; /* prevent empty rule warning */
    /* Wrapper */
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--medium-gray-color);
    margin-bottom: 30px;
}

.tab-link {
    padding: 15px 30px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    color: #6c757d;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color 0.3s, border-bottom-color 0.3s;
}

.tab-link:hover {
    color: var(--primary-color);
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 700;
}

.tab-content {
    display: none;
    background-color: var(--background-color);
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* Product Grid & Cards */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: #fff;
    border: 1px solid #f0f0f0;
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s;
    position: relative; /* For badge positioning */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.product-card.out-of-stock {
    opacity: 0.65;
}

.card-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    z-index: 10;
}

.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-bottom: 1px solid var(--medium-gray-color);
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.product-price {
    font-size: 18px;
    color: var(--primary-color);
    margin: 0 0 8px 0;
    font-weight: 700;
}

.product-stock {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 20px 0;
}

.product-buttons {
    display: flex;
    gap: 10px;
}

.btn-sell, .btn-manage, .btn-stop-sell {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-manage {
    background-color: #4A9FE8 !important;
    color: white;
    text-decoration: none;
    text-align: center;
}

.btn-manage:hover {
    background-color: #3A8FD8 !important;
}

.btn-manage.disabled {
    background-color: var(--disabled-color);
    cursor: not-allowed;
    pointer-events: none;
}

.btn-manage.disabled:hover {
    background-color: var(--disabled-color);
}

.btn-sell.disabled {
    background-color: var(--disabled-color);
    cursor: not-allowed;
    pointer-events: none;
}

.btn-sell.disabled:hover {
    background-color: var(--disabled-color);
}

.btn-stop-sell {
    background-color: var(--danger-color);
    color: white;
}

.btn-stop-sell:hover {
    background-color: var(--danger-hover-color);
}

.empty-list-message {
    background-color: #fcfcfc;
    border-radius: var(--border-radius);
    padding: 50px;
    text-align: center;
    font-size: 18px;
    color: #6c757d;
    grid-column: 1 / -1;
}

/* Footer */
.site-footer {
    background-color: var(--light-gray-color);
    padding: 40px 30px;
    text-align: center;
    font-size: 14px;
    color: #6c757d;
    border-top: 1px solid var(--medium-gray-color);
    margin-top: 50px;
}

.site-footer p {
    margin: 0;
}

/* New Order: card styles moved to pages/seller/new_order.css */

/* New Order History Card Styles */
.order-history-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.order-card-new {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--medium-gray-color);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default; /* 카드 전체 클릭 제거 */
}

.order-card-new:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.order-card-header-new {
    padding: 20px;
    background-color: #fdfdfd;
    border-bottom: 1px solid var(--medium-gray-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* 상단 정렬로 변경 */
    flex-wrap: wrap;
    gap: 15px;
    cursor: default; /* 헤더 클릭 제거 */
    position: relative; /* 우측 상단 버튼 포지셔닝 기준 */
}

.order-card-header-new .order-actions {
    position: absolute;
    top: 20px;
    right: 20px;
}

/* 수정 버튼 디자인: 공통 버튼과 통일 (btn btn-small 기반) */
.btn-edit {
    background-color: var(--primary-color);
    color: #fff;
}
.btn-edit:hover {
    background-color: var(--primary-hover-color);
}
.btn-edit.disabled {
    background-color: var(--disabled-color);
    cursor: not-allowed;
    pointer-events: none;
}

/* 주문내역 카드 수정 버튼 크기 통일 (.btn-small과 동일) */
.order-card-header-new .btn-edit {
    padding: 12px 20px; /* match .btn-small */
    font-size: 15px;   /* match .btn-small */
    border-radius: var(--border-radius);
    background-color: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
}

.order-card-header-new .btn-edit:hover {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
}

.order-card-header-new .btn-edit.disabled {
    background-color: #fff !important;
    color: #adb5bd !important;
    border-color: #dee2e6 !important;
}

.order-info-main {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.order-code {
    font-weight: 400;
    font-size: 15px;
    color: var(--dark-gray-color);
}

.order-date {
    font-size: 14px;
    color: #6c757d;
}

.order-info-sub {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
    font-size: 15px;
    flex: 0 0 100%;
}

.order-card-body-new {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-item-card-new {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 15px;
    background-color: var(--light-gray-color);
    border-radius: 10px;
}

.item-image {
    flex-shrink: 0;
}

.item-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--medium-gray-color);
}

.item-details {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: center;
}

.item-info-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-info-col strong {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 2px;
}

.item-info-col span {
    font-size: 15px;
    font-weight: 500;
}

.item-info-col .address {
    font-size: 14px;
    color: #495057;
}

.tracking-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    margin-top: 5px;
    display: inline-block;
}

.tracking-link:hover {
    text-decoration: underline;
}

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-align: center;
}

.status-pending, .status-unpaid { background-color: #ffc107; } /* Yellow */
.status-completed, .status-paid { background-color: #28a745; } /* Green */
.status-shipped { background-color: #17a2b8; } /* Teal */
.status-delivered { background-color: #007bff; } /* Blue */
.status-cancelled { background-color: #ff8c94; } /* Softer pink-red */


/* Product Detail Page Styles */
/* moved to pages/seller/product_detail.css */

/* Toast Message Styles */
/* moved to components/toast.css */

/* Page title leading icon (e.g., 장바구니) */
.page-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;  /* container box */
  height: 24px;
  margin-right: 8px;
  color: var(--primary-color);
  vertical-align: middle;
}
.page-title-icon svg { width: 20px; height: 20px; display: block; }

/* Order History header and edit button overrides */
.order-card-header-new { padding-right: 0; }
.order-card-header-new .order-info-main,
.order-card-header-new .order-info-sub { flex: 0 0 100%; }

/* Add '상태:' label before header status badge only */
.order-card-header-new .order-info-sub .status-badge::before {
  content: '상태: ';
  font-weight: 700;
  margin-right: 4px;
  color: var(--text-color);
}

/* In order history, make status badge text same as normal text */
.order-history-list .status-badge { color: var(--text-color) !important; }

/* Order History page specific tweaks */
.order-history-page .dashboard-header { display: block; }
.order-history-page .dashboard-header h1 { margin: 0 0 6px 0; }
.order-history-page .dashboard-header .dashboard-subtitle { margin: 0; color: #6c757d; }

/* Status badge refinements: remove pill background and use icon + text */
.order-history-list .status-badge {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
/* Default text color */
.order-history-list .status-badge { color: var(--text-color) !important; }

/* Icons before text */
.order-history-list .status-badge::before {
  content: '';
  display: inline-block;
  width: 16px; height: 16px;
  mask-size: contain; -webkit-mask-size: contain;
  mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat;
  background-color: currentColor;
}
/* Cancelled: red icon (circle-x) */
.order-history-list .status-cancelled { color: #e53935 !important; }
.order-history-list .status-cancelled::before {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>');
}

/* In-progress/complete: elegant blue icon (circle-check for 완료, circle-progress for 진행) */
.order-history-list .status-completed,
.order-history-list .status-paid,
.order-history-list .status-delivered { color: #1e88e5 !important; }
.order-history-list .status-completed::before,
.order-history-list .status-paid::before,
.order-history-list .status-delivered::before {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M9 12l2 2 4-4"/></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M9 12l2 2 4-4"/></svg>');
}
.order-history-list .status-pending,
.order-history-list .status-unpaid,
.order-history-list .status-shipped,
.order-history-list .status-preparing { color: #1e88e5 !important; }
.order-history-list .status-pending::before,
.order-history-list .status-unpaid::before,
.order-history-list .status-shipped::before,
.order-history-list .status-preparing::before {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></svg>');
}

/* Header status: show as plain text only ("상태: 결제대기"), no icon, no pill */
.order-card-header-new .order-info-sub .status-badge {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  color: var(--text-color) !important;
  font-weight: 700;
  white-space: nowrap;
}
/* Force-remove header icon even if globally enabled */
.order-card-header-new .order-info-sub .status-badge::after {
  content: none !important;
  display: none !important;
  background: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

/* Avoid black box in browsers without CSS mask support */
.order-history-list .status-badge::before,
.order-card-header-new .order-info-sub .status-badge::after { display: none; background: none !important; }
@supports ((-webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"/>')) or (mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"/>'))) {
  .order-history-list .status-badge::before,
  .order-card-header-new .order-info-sub .status-badge::after { display: inline-block; background-color: currentColor; }
}

/* Keep '상태:' label and status text on the same line in header */
.order-card-header-new .order-info-sub .status-badge {
  white-space: nowrap;
}

/* Ensure icons are visible by default; hide only if CSS mask is not supported */
.order-history-list .status-badge::before,
.order-card-header-new .order-info-sub .status-badge::after {
  display: inline-block !important;
  background-color: currentColor !important;
}

@supports not ((-webkit-mask-image: url("")) or (mask-image: url(""))) {
  .order-history-list .status-badge::before,
  .order-card-header-new .order-info-sub .status-badge::after {
    display: none !important;
    background: none !important;
  }
}

/* Order History: top row layout (label left, date right), code on next line */
.order-info-main .order-top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.order-info-main .order-label {
  font-weight: 700;
  font-size: 15px;
  color: var(--dark-gray-color);
}

/* 반품/교환 버튼도 수정 버튼과 동일한 아웃라인 스타일 적용 */
.order-item-actions .btn-edit {
    padding: 12px 20px; /* match .btn-small */
    font-size: 15px;   /* match .btn-small */
    border-radius: var(--border-radius);
    background-color: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
}
.order-item-actions .btn-edit:hover {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
}
.order-item-actions .btn-edit.disabled {
    background-color: #fff !important;
    color: #adb5bd !important;
    border-color: #dee2e6 !important;
}

.btn-outline-dark {
    background-color: white;
    border: 1px solid black;
    color: black;
    padding: 8px 20px; /* Similar to .btn-small */
    font-size: 15px;   /* Similar to .btn-small */
    font-weight: 700;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    text-decoration: none; /* Ensure it looks like a button even if it's an <a> tag */
    display: inline-block; /* For padding and width to work correctly on <a> */
    text-align: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-outline-dark:hover {
    background-color: #f8f9fa; /* Slightly darker on hover */
    color: #333;
    border-color: #333;
}

/* End of cleaned file: duplicated seller index and summary-cards blocks removed; header spacing lives in layout/header.css */

