/*
 * 목록/로딩 등 화면 공통 표시용.
 * 사이트 본체 CSS 는 빌드된 Tailwind 를 정적으로 링크해 쓰는 구조라
 * 새 유틸리티를 추가할 수 없어 필요한 것만 여기에 둔다.
 */

/* ── 상단 진행바 ─────────────────────────────────────────────── */
.cng-loadingbar {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: #e6ecea;
  overflow: hidden;
}

.cng-loadingbar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: 4px;
  background: #2f7a68;
  animation: cng-slide 1.1s ease-in-out infinite;
}

@keyframes cng-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

/* ── 카드 자리표시 ───────────────────────────────────────────── */
/* 목록이 비어 보이는 대신 실제 카드와 같은 크기를 잡아둬서
   불러온 뒤 화면이 덜컥 밀리지 않게 한다 */
.cng-skeleton-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 700px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e3ebe8;
}

.cng-skeleton-img  { height: 60%; }
.cng-skeleton-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.cng-skeleton-line { height: 22px; border-radius: 6px; }
.cng-skeleton-pill { height: 42px; width: 160px; border-radius: 100px; }

.cng-shimmer {
  background: linear-gradient(90deg, #eef2f1 25%, #e2e9e7 37%, #eef2f1 63%);
  background-size: 400% 100%;
  animation: cng-shimmer 1.4s ease infinite;
}

@keyframes cng-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .cng-loadingbar::after,
  .cng-shimmer { animation: none; }
}

/* ── 자주 묻는 질문 아코디언 ─────────────────────────────────── */
.cng-faq-item {
  border: 1px solid #dbe5e1;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.cng-faq-item.is-open {
  border-color: #00bf96;
  box-shadow: 0 3px 14px rgba(0, 191, 150, .1);
}

.cng-faq-q {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 20px 22px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  color: #1e2732;
  line-height: 1.5;
}

.cng-faq-q:hover { background: #f7fbfa; }

.cng-faq-badge {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
}

.cng-faq-badge.q { background: #00bf96; color: #fff; }
.cng-faq-badge.a { background: #eaf5f2; color: #00806a; }

.cng-faq-chevron {
  margin-left: auto;
  flex: 0 0 auto;
  color: #7d8b86;
  transition: transform .22s ease;
}

.cng-faq-item.is-open .cng-faq-chevron { transform: rotate(180deg); }

/* 높이를 재지 않고도 부드럽게 열리도록 grid 1fr 트릭을 쓴다 */
.cng-faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .24s ease;
}

.cng-faq-item.is-open .cng-faq-a { grid-template-rows: 1fr; }

.cng-faq-a > div { overflow: hidden; }

.cng-faq-a-inner {
  display: flex;
  gap: 14px;
  padding: 0 22px 22px;
  border-top: 1px solid #edf3f1;
  padding-top: 18px;
  margin-top: 0;
}

.cng-faq-text {
  font-size: 16px;
  line-height: 1.8;
  color: #45514c;
  white-space: pre-wrap;
  word-break: keep-all;
}

@media (max-width: 640px) {
  .cng-faq-q { padding: 16px; font-size: 16px; gap: 10px; }
  .cng-faq-a-inner { padding: 16px 16px 18px; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .cng-faq-a, .cng-faq-chevron { transition: none; }
}

/* ── 메인: 실시간 제품현황 ───────────────────────────────────── */
/*
 * "즉시 출고 가능" 같은 라벨이 화면 폭이 줄면 두 줄로 쪼개져 잘려 보였다.
 * 한국어는 기본 줄바꿈 규칙상 아무 글자에서나 끊기므로 keep-all 로 어절 단위로 끊고,
 * 폭에 맞춰 글자 크기를 줄여 한 줄을 유지한다.
 */
.cng-status-label {
  white-space: nowrap;
  word-break: keep-all;
  text-align: center;
  font-size: clamp(13px, 1.05vw, 18px);
  line-height: 1.4;
}

/* 숫자 원이 찌그러지지 않게 고정 */
.cng-status-num {
  flex: 0 0 auto;
}

/* 아이콘도 같이 줄어들게 */
.cng-status-icon {
  flex: 0 0 auto;
  max-width: 100%;
  height: auto;
}

@media (max-width: 1279px) {
  /* 데스크톱 미만에서는 숫자 원을 조금 줄여 라벨 공간을 확보한다 */
  .cng-status-num {
    width: 76px !important;
    height: 76px !important;
    font-size: 30px !important;
  }
}
