/* =====================================================
   card-features.css - 카드 공통 기능 스타일
   ===================================================== */

.product-card .photo-box,
.product-card .bundle-thumb {
  cursor: pointer;
}
.product-card .photo-box:hover,
.product-card .bundle-thumb:hover {
  border-color: var(--primary);
}

/* ----- Header 내 판매자상품코드 입력 ----- */
.product-card .card-header .seller-code-field {
  flex: 1;
  min-width: 0;
  margin-left: 8px;
}
.product-card .card-header .seller-code-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 4px;
  display: block;
}
.product-card .card-header .seller-code-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  font-family: inherit;
}
.product-card .card-header .seller-code-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}
.product-card.saved .card-header .seller-code-field input {
  background: #f7f8fc;
  border-style: dashed;
}

.product-card .bundle-badge {
  background: #fff3e0;
  color: #e65100;
  border-color: #ffe0b2;
}

/* ----- 판매수수료 필드 (비율 입력 + 금액 표시) ----- */
.product-card .fee-field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.product-card .fee-field .fee-rate {
  width: 70px;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: right;
}
.product-card .fee-field .fee-rate:focus {
  outline: none;
  border-color: var(--primary);
}

/* ----- 복수품 섹션 ----- */
.product-card .bundle-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.product-card .bundle-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.product-card .bundle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.product-card .bundle-item {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.product-card .bundle-thumb {
  width: 56px;
  height: 56px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.product-card .bundle-thumb.has-image {
  border-style: solid;
}
.product-card .bundle-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-card .bundle-item-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
}
.product-card .bundle-code-field {
  flex: 1 1 50%;
  min-width: 0;
}
.product-card .bundle-total-field {
  flex: 1 1 50%;
  min-width: 0;
}
.product-card .bundle-code-field label,
.product-card .bundle-total-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
}
.product-card .bundle-code-field input,
.product-card .bundle-total-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.product-card .bundle-total-field input {
  background: #f7f8fc;
  text-align: right;
}
.product-card .bundle-remove {
  padding: 8px 12px;
  font-size: 12px;
  flex-shrink: 0;
}
/* ----- 복수품 추가 버튼 (캡슐 스타일) ----- */
.product-card .bundle-add button,
.product-card .bundle-add-item {
  flex: 0 0 auto;
  width: auto;
  min-width: 140px;
  background: #f5f5f7;
  color: #4a4a4a;
  border: 1px solid #e5e5ea;
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}
.product-card .bundle-add button {
  display: inline-flex;
}
.product-card .bundle-add-item {
  display: flex;
  margin: 10px auto 0;
}
.product-card .bundle-add button:hover,
.product-card .bundle-add-item:hover {
  background: #eaeaec;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* ----- 복수품 전환 버튼 ----- */
.product-card .bundle-add {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: center;
}

/* ----- Saved card 상태 ----- */
.product-card.saved .card-header .seller-code-field input[readonly] {
  background: #f7f8fc;
  color: var(--text-soft);
  cursor: default;
}

/* ----- 판매수수료 전체입력 바 ----- */
.bulk-fee-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  flex-shrink: 0;
}
.bulk-fee-bar label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
}
.bulk-fee-bar input {
  width: 70px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  text-align: right;
  font-family: inherit;
}
.bulk-fee-bar input:focus {
  outline: none;
  border-color: var(--primary);
}
.bulk-fee-bar button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.bulk-fee-bar button:hover {
  background: #5b4bc4;
}

/* ----- 2개이상구매 행: 최종이익 반절 + 2개이상구매 반절 ----- */
.product-card .field-row.split-profit {
  grid-template-columns: 1fr 1fr 0.5fr 0.5fr;
}

/* ----- 판매가+공급가입력 행: 판매가 반절 + 공급가입력 반절 ----- */
.product-card .field-row.split-price {
  grid-template-columns: 1fr 0.5fr 0.5fr 1fr;
}

/* ----- 반응형 ----- */
@media (max-width: 520px) {
  .product-card .field-row.split-profit {
    grid-template-columns: 1fr;
  }
  .product-card .field-row.split-price {
    grid-template-columns: 1fr;
  }
  .product-card .bundle-item {
    flex-wrap: wrap;
  }
  .product-card .bundle-thumb {
    width: 48px;
    height: 48px;
  }
  .product-card .bundle-item-fields {
    width: calc(100% - 64px);
  }
  .product-card .bundle-code-field,
  .product-card .bundle-total-field {
    flex: 1 1 50%;
  }
  .product-card .bundle-remove {
    margin-left: auto;
  }
}
