/* nutrition-compare.css — "같이 놓고 계산해봄" 계산기.
   결과를 표(넓은 열)로 만들지 않고 제품별 카드로 쌓는다 — 021 같은
   8열 표에서 겪은 모바일 UX 문제를 새 기능에서 반복하지 않기 위함
   (F6 요구사항). 모바일 우선으로 작성하고 넓은 화면에서만 grid로
   나열한다. */

.dwj-nc {
  max-width: 720px;
}

.dwj-nc-products {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dwj-nc-product {
  border: 1px solid var(--wp--preset--color--border, #d8cfc2);
  border-radius: 6px;
  padding: 1rem;
}

.dwj-nc-product h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.05rem;
}

.dwj-nc-field {
  margin-bottom: 0.65rem;
}

.dwj-nc-field label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: var(--wp--preset--color--text-muted, #6b6255);
}

.dwj-nc-field input,
.dwj-nc-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--wp--preset--color--border, #d8cfc2);
  border-radius: 4px;
  font-size: 1rem;
}

.dwj-nc-field input[aria-invalid="true"] {
  border-color: #b3261e;
  outline: 1px solid #b3261e;
}

.dwj-nc-field-error {
  color: #b3261e;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.dwj-nc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.dwj-nc-remove {
  background: none;
  border: none;
  color: var(--wp--preset--color--text-muted, #6b6255);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  margin-top: 0.4rem;
}

.dwj-nc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.dwj-nc-actions button {
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--wp--preset--color--border, #d8cfc2);
  background: var(--wp--preset--color--bg, #faf6ef);
  cursor: pointer;
  font-size: 0.95rem;
}

.dwj-nc-actions [data-dwj-nc-calculate] {
  background: var(--wp--preset--color--accent, #a35b1a);
  color: #fff;
  border-color: var(--wp--preset--color--accent, #a35b1a);
}

.dwj-nc-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dwj-nc-actions button:focus-visible,
.dwj-nc-remove:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent, #a35b1a);
  outline-offset: 2px;
}

.dwj-nc-copy-status {
  font-size: 0.85rem;
  color: var(--wp--preset--color--text-muted, #6b6255);
  margin: -0.5rem 0 1rem 0;
  min-height: 1.1em;
}

.dwj-nc-result:focus {
  outline: none; /* 결과 영역으로 포커스 이동은 스크린리더 안내 목적, 시각적 outline은 불필요 */
}

.dwj-nc-error {
  color: #b3261e;
  font-weight: 600;
}

.dwj-nc-observation {
  border: 1px solid var(--wp--preset--color--border, #d8cfc2);
  background: var(--wp--preset--color--bg-alt, #f2ece0);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.dwj-nc-observation h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.dwj-nc-observation ul {
  margin: 0 0 0.5rem 0;
  padding-left: 1.2rem;
}

.dwj-nc-observation__note {
  font-size: 0.82rem;
  color: var(--wp--preset--color--text-muted, #6b6255);
  margin: 0;
}

.dwj-nc-related {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--wp--preset--color--border, #d8cfc2);
}

.dwj-nc-related__title {
  margin: 0 0 0.6rem 0;
  font-size: 0.95rem;
  color: var(--wp--preset--color--text-muted, #6b6255);
}

.dwj-nc-related__list {
  margin: 0;
  padding-left: 1.2rem;
}

.dwj-nc-related__list li {
  margin-bottom: 0.4rem;
}

.dwj-nc-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* 넓은 화면에서만 카드를 나란히 — 좁은 화면(대부분의 실사용)에서는
   항상 1열로 쌓아 가로 스크롤이 아예 발생하지 않는다. */
@media (min-width: 700px) {
  .dwj-nc-cards {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

.dwj-nc-card {
  border: 1px solid var(--wp--preset--color--border, #d8cfc2);
  border-radius: 6px;
  padding: 1rem;
}

.dwj-nc-card__title {
  margin: 0 0 0.75rem 0;
  font-size: 1.05rem;
}

.dwj-nc-card__section {
  margin-bottom: 0.75rem;
}

.dwj-nc-card__section h4 {
  margin: 0 0 0.4rem 0;
  font-size: 0.85rem;
  color: var(--wp--preset--color--text-muted, #6b6255);
  font-weight: 600;
}

.dwj-nc-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dwj-nc-card__list li {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--wp--preset--color--border, #d8cfc2);
  font-size: 0.95rem;
}

.dwj-nc-card__list li:last-child {
  border-bottom: none;
}

.dwj-nc-card__value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
