/* ew-inventory: 프론트엔드 스타일 */

:root {
  --ew-primary: #2c3e50;
  --ew-accent: #e67e22;
  --ew-green: #27ae60;
  --ew-red: #e74c3c;
  --ew-gray: #ecf0f1;
  --ew-border: #ddd;
  --ew-radius: 6px;
}

/* 공통 */
.ew-section-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; color: var(--ew-primary); }
.ew-notice { padding: 12px 16px; border-radius: var(--ew-radius); background: #fff3cd; border: 1px solid #ffc107; }
.ew-notice--warn { background: #fff3cd; }
.ew-empty { color: #999; text-align: center; padding: 30px 0; }
.ew-msg { padding: 12px 16px; border-radius: var(--ew-radius); }
.ew-msg--success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.ew-msg--error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* 뱃지 */
.ew-badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 600; }
.ew-badge--pending   { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.ew-badge--confirmed { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.ew-badge--stocked   { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }

/* 테이블 */
.ew-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ew-table th { background: var(--ew-primary); color: #fff; padding: 10px 12px; text-align: left; }
.ew-table td { border-bottom: 1px solid var(--ew-border); padding: 10px 12px; vertical-align: middle; }
.ew-table tr:last-child td { border-bottom: none; }
.ew-table tr:hover td { background: #f8f9fa; }

/* ─── 입고 요청 폼 ─── */
.ew-request-wrap { max-width: 900px; }
.ew-search-bar { margin-bottom: 16px; }
.ew-input { width: 100%; max-width: 400px; padding: 9px 12px; border: 1px solid var(--ew-border); border-radius: var(--ew-radius); font-size: 14px; }

/* 상품 그리드 */
.ew-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.ew-product-card { border: 2px solid var(--ew-border); border-radius: var(--ew-radius); cursor: pointer; transition: border-color .2s, box-shadow .2s; position: relative; }
.ew-product-card.is-hidden { display: none; }
.ew-product-card.is-selected { border-color: var(--ew-accent); box-shadow: 0 0 0 3px rgba(230,126,34,.15); }
.ew-product-card__inner { display: flex; flex-direction: column; align-items: center; padding: 12px; cursor: pointer; }
.ew-product-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; margin-bottom: 8px; }
.ew-product-info { text-align: center; width: 100%; }
.ew-product-name { font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 3px; }
.ew-product-sku  { font-size: 11px; color: #999; }
.ew-product-stock{ font-size: 11px; color: var(--ew-green); margin-top: 2px; }
.ew-check-indicator { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ew-accent); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.ew-product-card.is-selected .ew-check-indicator { opacity: 1; }

/* 장바구니 */
.ew-cart-section { border: 1px solid var(--ew-border); border-radius: var(--ew-radius); padding: 20px; background: #fafafa; margin-bottom: 20px; }
.ew-cart-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.ew-cart-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ew-border); }
.ew-cart-item:last-child { border-bottom: none; }
.ew-cart-item__name { flex: 1; font-size: 14px; }
.ew-cart-item__qty { display: flex; align-items: center; gap: 6px; }
.ew-qty-btn { width: 28px; height: 28px; border: 1px solid var(--ew-border); border-radius: 4px; background: #fff; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.ew-qty-btn:hover { background: var(--ew-gray); }
.ew-qty-input { width: 60px; text-align: center; border: 1px solid var(--ew-border); border-radius: 4px; padding: 4px; font-size: 14px; }
.ew-cart-remove { background: none; border: none; color: #999; cursor: pointer; font-size: 16px; padding: 0 4px; }
.ew-cart-remove:hover { color: var(--ew-red); }

/* 폼 요소 */
.ew-form-group { margin-bottom: 14px; }
.ew-label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 14px; }
.ew-textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--ew-border); border-radius: var(--ew-radius); font-size: 14px; resize: vertical; }

/* 버튼 */
.ew-btn { display: inline-block; padding: 10px 20px; border-radius: var(--ew-radius); font-size: 15px; font-weight: 600; cursor: pointer; border: none; transition: opacity .2s; }
.ew-btn--primary { background: var(--ew-accent); color: #fff; }
.ew-btn--primary:hover { opacity: .85; }
.ew-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 반응형 */
@media (max-width: 600px) {
  .ew-product-grid { grid-template-columns: repeat(2, 1fr); }
  .ew-table { font-size: 12px; }
  .ew-table th, .ew-table td { padding: 8px 6px; }
}
