/* 상품 올리기(/manage/products.html) — styles.css·manage.css 의 색·간격 변수(--green, --cream, --line, --orange, --red, --mint)만 쓴다. 폰 390폭이 기본. */
.pe-main { max-width: 760px; padding: 0 16px 100px; margin-top: 16px; }
.pe-main h2 { margin: 0; font-size: 22px; }
.pe-main h3 { margin: 0 0 8px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.pe-main p { margin: 0 0 8px; }
.pe-main .muted { font-size: 13px; }
.pe-main input, .pe-main select, .pe-main textarea { font-size: 16px; min-height: 46px; width: 100%; min-width: 0; }
.pe-main textarea { min-height: 96px; resize: vertical; }
.pe-main input[type="checkbox"], .pe-main input[type="radio"] { width: 22px; height: 22px; min-height: 22px; margin: 0; padding: 0; flex: 0 0 auto; }
.pe-main label.check { min-height: 44px; align-items: center; font-size: 15px; }
.pe-main button, .pe-link-button { min-height: 44px; font-size: 15px; padding: 8px 16px; }
.pe-main button.pe-primary, .pe-main .pe-primary { min-height: 46px; font-size: 16px; }
.pe-link-button { display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--green); color: #fff; border: 1px solid var(--green); font-weight: 800; text-decoration: none; }
.pe-link-button.secondary { background: #fff; color: var(--green); }
.pe-main a:focus-visible, .pe-main button:focus-visible, .pe-main input:focus-visible, .pe-main select:focus-visible, .pe-main textarea:focus-visible, .pe-filebtn:focus-within { outline: 3px solid var(--orange); outline-offset: 2px; }
.pe-main h2:focus, .pe-saved:focus { outline: none; }
.pe-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; min-height: 0 !important; }
.pe-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 12px; }
.pe-head .muted { margin-left: auto; }

/* 내 상품 */
.pe-actions-top { display: grid; gap: 10px; margin-bottom: 12px; }
.pe-actions-top button { width: 100%; }
.pe-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pe-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 4px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; min-width: 0; }
.pe-card-img { grid-row: 1 / span 2; width: 88px; height: 88px; border-radius: 10px; background: #f4f1e8; overflow: hidden; display: grid; place-items: center; }
.pe-card-img img { width: 100%; height: 100%; object-fit: cover; }
.pe-noimg { color: #7a867e; font-size: 12px; text-align: center; }
.pe-card-body { min-width: 0; display: grid; gap: 2px; align-content: start; }
.pe-card-name { font-size: 16px; overflow-wrap: anywhere; }
.pe-card-body p { margin: 0; }
.pe-price { font-size: 16px; }
.pe-price s { font-weight: 500; margin-left: 4px; }
.pe-state { justify-self: start; display: inline-block; border-radius: 999px; background: var(--mint); color: var(--green); padding: 2px 10px; font-size: 12px; font-weight: 850; }
.pe-state[data-state="SOLD_OUT"], .pe-state[data-state="HIDDEN"] { background: #ece9df; color: #4b5a51; }
.pe-state[data-state="WAITING_STORE"], .pe-state[data-state="STOPPED"] { background: #ffe2d2; color: #7a2e12; }
.pe-card-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.pe-card-actions button, .pe-card-actions a { width: 100%; }
.pe-card-actions > :only-child { grid-column: 1 / -1; }
.pe-card-note { color: #7a2e12; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; word-break: keep-all; }
.pe-card[data-legacy="1"] .pe-card-note { color: #4b5a51; font-weight: 600; }
.pe-notice { color: #7a2e12; font-weight: 700; font-size: 13px; margin: 0; overflow-wrap: anywhere; word-break: keep-all; }
.pe-notice:empty { display: none; }

/* 쓰는 화면 */
.pe-lock { border: 0; padding: 0; margin: 0; min-width: 0; }
.pe-lock:disabled { opacity: .6; }
.pe-local-note { background: var(--mint); border-radius: 10px; padding: 10px 12px; }
.pe-step { background: var(--cream); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; display: grid; gap: 10px; min-width: 0; }
.pe-step > * { margin-top: 0; margin-bottom: 0; }
.pe-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; font-size: 13px; font-weight: 850; flex: 0 0 auto; }
.pe-field { display: grid; gap: 5px; min-width: 0; }
.pe-field > label { font-size: 14px; }
.pe-money { display: flex; align-items: center; gap: 8px; }
.pe-money span { font-weight: 750; flex: 0 0 auto; }
.pe-err { color: var(--red); font-weight: 750; font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.pe-ok { color: var(--green); font-weight: 750; font-size: 13px; margin: 0; }
.pe-err:empty, .pe-ok:empty { display: none; }
.pe-main [aria-invalid="true"] { border-color: var(--red); background: #fff6f6; }
.pe-discount { color: var(--orange); font-weight: 750; font-size: 13px; margin: 0; }
.pe-discount:empty { display: none; }
.pe-filebtn { display: inline-flex; align-items: center; justify-content: center; position: relative; min-height: 46px; padding: 8px 18px; border-radius: 9px; background: var(--green); color: #fff; border: 1px solid var(--green); font-weight: 800; font-size: 16px; cursor: pointer; justify-self: start; }
.pe-filebtn.secondary { background: #fff; color: var(--green); min-height: 44px; font-size: 15px; }
.pe-filebtn.is-disabled { opacity: .5; cursor: not-allowed; }
.pe-photos, .pe-detail, .pe-info, .pe-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pe-photos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pe-photos:empty, .pe-detail:empty, .pe-info:empty, .pe-options:empty { display: none; }
.pe-photo, .pe-detail-item, .pe-option { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; display: grid; gap: 6px; align-content: start; min-width: 0; }
.pe-photo p { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.pe-photo-img { position: relative; aspect-ratio: 1; background: #f4f1e8; border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.pe-photo-img img { width: 100%; height: 100%; object-fit: cover; }
.pe-badge { position: absolute; left: 6px; top: 6px; background: var(--orange); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 850; }
.pe-photo-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-photo-actions button { flex: 1 1 auto; padding: 6px 10px; font-size: 14px; }
.pe-photo[data-status="failed"], .pe-detail-item[data-status="failed"] { border-color: var(--red); }
.pe-detail-no { margin: 0; font-weight: 750; font-size: 14px; }
.pe-detail-img { background: #f4f1e8; border-radius: 8px; overflow: hidden; display: grid; place-items: center; min-height: 80px; }
.pe-detail-img img { width: 100%; max-height: 260px; object-fit: contain; }
.pe-info-row { display: grid; grid-template-columns: 1fr; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
.pe-info-row button { justify-self: start; }
.pe-option-head { margin: 0; }
.pe-grid2 { display: grid; grid-template-columns: 1fr; gap: 8px; }
.pe-option .pe-del { justify-self: start; }
.pe-radios { display: grid; gap: 4px; }
.pe-saved { background: var(--mint); border: 1px solid var(--green); border-radius: 14px; padding: 14px; margin-bottom: 12px; display: grid; gap: 8px; }
.pe-saved h3 { color: var(--green); margin: 0; }
.pe-saved p { margin: 0; }

/* 한 번에 고치기 */
.pe-bulk { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.pe-bulk-row { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; min-width: 0; }
.pe-bulk-row[data-changed="1"] { border-color: var(--green); background: #f6fbf8; }
.pe-bulk-name { margin: 0; overflow-wrap: anywhere; }

/* 아래에 붙는 저장 띠 */
.pe-bar { position: sticky; bottom: 0; z-index: 4; display: grid; gap: 8px; padding: 10px 0 12px; margin-top: 8px; background: linear-gradient(to top, var(--cream) 80%, rgba(255, 253, 247, 0)); }
.pe-bar button { width: 100%; }

@media (min-width: 640px) {
  .pe-main { padding: 0 22px 100px; }
  .pe-actions-top { grid-template-columns: auto auto; justify-content: start; }
  .pe-actions-top button { width: auto; }
  .pe-card { grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; }
  .pe-card-img { grid-row: 1; width: 96px; height: 96px; }
  .pe-card-actions { grid-column: auto; grid-template-columns: auto auto; margin-top: 0; }
  .pe-grid2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pe-bulk-row .pe-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-info-row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; align-items: end; }
  .pe-bar { display: flex; justify-content: flex-end; }
  .pe-bar button { width: auto; min-width: 160px; }
  .pe-bar #save-publish { order: 2; }
}

/* 엑셀로 한꺼번에 올리기 — 미리보기는 상품마다 카드 한 장(폰·PC 같은 꼴, 가로로 밀 일 없음) */
.pe-actions-top #open-import[aria-expanded="true"] { background: var(--mint); border-color: var(--green); }
.pi-panel { background: var(--cream); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; display: grid; gap: 12px; min-width: 0; }
.pi-panel > * { margin-top: 0; margin-bottom: 0; }
.pi-panel h3 { margin: 0; font-size: 18px; }
.pi-panel h3:focus, .pi-result h4:focus { outline: none; }
.pi-step { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; min-width: 0; }
.pi-step > * { margin: 0; }
.pi-step h4 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.pi-buttons { display: grid; gap: 8px; }
.pi-buttons button, .pi-buttons .pe-filebtn { width: 100%; justify-self: stretch; }
.pi-files { color: #33433a; font-size: 14px; overflow-wrap: anywhere; word-break: keep-all; }
.pi-files:empty { display: none; }
.pi-status { font-weight: 750; font-size: 14px; overflow-wrap: anywhere; }
.pi-status:empty { display: none; }
.pi-status[data-kind="error"] { color: var(--red); }
.pi-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.pi-notes:empty { display: none; }
.pi-notes li { background: #fff; border-left: 4px solid var(--orange); border-radius: 6px; padding: 6px 10px; overflow-wrap: anywhere; word-break: keep-all; }
.pi-notes li[data-kind="info"] { border-left-color: var(--green); }
.pi-notes li[data-kind="error"] { border-left-color: var(--red); }
.pi-preview { display: grid; gap: 10px; min-width: 0; }
.pi-sum { margin: 0; font-size: 17px; }
.pi-tablewrap { min-width: 0; }
.pi-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pi-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.pi-table, .pi-table tbody, .pi-table tr, .pi-table td { display: block; }
.pi-table tr { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
.pi-table tr[data-ok="0"] { border-color: var(--red); background: #fffafa; }
.pi-table tr[data-ok="2"] { background: #f4f1e8; }
.pi-table td { padding: 3px 0; display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 8px; overflow-wrap: anywhere; word-break: keep-all; }
.pi-table td::before { content: attr(data-label); color: #5a695f; font-size: 13px; font-weight: 700; }
.pi-table td[data-label="상품 이름"] { font-weight: 800; }
.pi-badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 850; background: var(--mint); color: var(--green); }
.pi-badge[data-ok="0"] { background: #ffe2d2; color: #7a2e12; }
.pi-badge[data-ok="2"] { background: #ece9df; color: #4b5a51; }
.pi-reasons { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.pi-reasons li { color: #7a2e12; font-size: 13px; font-weight: 650; }
.pi-reasons li[data-kind="info"] { color: #4b5a51; font-weight: 500; }
.pi-go { display: grid; gap: 8px; }
.pi-go > * { margin: 0; }
.pi-progress { font-weight: 750; color: var(--green); font-size: 14px; }
.pi-progress:empty { display: none; }
.pi-result { background: var(--mint); border: 1px solid var(--green); border-radius: 12px; padding: 12px; display: grid; gap: 8px; min-width: 0; }
.pi-result > * { margin: 0; }
.pi-result h4 { font-size: 17px; margin: 0; color: var(--green); }
.pi-result h5 { margin: 4px 0; font-size: 15px; }
.pi-panel[data-busy="1"] .pe-filebtn { opacity: .5; pointer-events: none; }

@media (min-width: 880px) {
  .pi-buttons { grid-template-columns: repeat(2, minmax(0, 260px)); }
}

@media (min-width: 640px) {
  .pe-actions-top { grid-template-columns: repeat(3, auto); }
}

/* 묶음 4-B: 진열 표시·수량 세는 방식 */
.pe-marks { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.pe-mark { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.pe-choice { border: 0; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; min-width: 0; }
.pe-choice legend { font-weight: 700; margin-bottom: 4px; padding: 0; }
.pe-choice label.check { min-height: 44px; align-items: center; }

/* 묶음 5-B: 얼마 안 남음 표시·남는 돈·얼마 안 남은 상품만 보기 */
.pe-mark-low { border-color: var(--orange); background: #fff3ea; color: #7a2e12; }
.pe-margin { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: #24513a; overflow-wrap: anywhere; word-break: keep-all; }
.pe-low-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.pe-low-filter p { margin: 0; }
.pe-low-filter button { min-height: 44px; }
/* 사장님 화면 다듬기: 아래 고정 띠가 마지막 칸을 가리지 않게 여백, 목록 찾기·거르기, 지우기 확인 */
html { scroll-padding-bottom: 150px; }
.pe-main { padding-bottom: 160px; }
.pe-tools { display: grid; gap: 10px; margin: 8px 0 10px; }
.pe-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pe-main .pe-chip { min-height: 44px; border-radius: 999px; background: #fff; color: var(--green); font-weight: 700; padding: 8px 16px; }
.pe-main .pe-chip[aria-pressed="true"] { background: var(--green); color: #fff; }
.pe-info-toggle { width: 100%; justify-content: center; margin-bottom: 8px; }
.pe-card-actions .pe-danger { background: #fff; color: var(--red); border-color: var(--red); }
.pe-confirm { grid-column: 1 / -1; display: grid; gap: 8px; padding: 10px; border: 1px solid var(--red); border-radius: 10px; background: #fff6f6; }
.pe-confirm p { margin: 0; }
.pe-confirm .actions { margin-top: 0; }
.pe-saved .actions { margin-top: 4px; }
.pe-main .pe-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
