/* ==========================================================
   spa.css — 라우터 셸 / 공용 컴포넌트 스타일 (T-008, 코어 소유)

   여기에는 "여러 페이지가 공유하는" 요소만 둔다.
   페이지 전용 스타일은 각 담당자가 별도 CSS 파일로 추가할 것.
   ========================================================== */

/* ---------- 헤더 보정 (button → a 로 바뀐 요소) ---------- */
a.avatar-btn {
  display: inline-block;
}

/* ---------- 상품 카드: 상세 이동 오버레이 링크 ---------- */
.product__go {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.product__go:focus-visible {
  outline: 3px solid var(--lime-strong);
  outline-offset: -3px;
}

/* ==========================================================
   페이지 상단 (뒤로가기 헤더)
   ========================================================== */
.pagehead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.pagehead__back {
  flex: none;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  transition: background var(--dur) var(--ease);
}

.pagehead__back:hover {
  background: var(--bg-soft);
}

.pagehead__text {
  min-width: 0;
  flex: 1;
}

.pagehead__title {
  font-size: var(--fs-section);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pagehead__sub {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--text-sub);
}

.pagehead__right {
  flex: none;
}

/* ==========================================================
   스텁 / 404
   ========================================================== */
.stub-wrap {
  min-height: 46vh;
}

.stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 56px 20px 64px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.stub__eyebrow {
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--purple);
}

.stub__title {
  font-size: var(--fs-section);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stub__desc {
  font-size: var(--fs-body);
  color: var(--text-sub);
  line-height: 1.6;
}

.stub__meta {
  font-size: var(--fs-sm);
  color: var(--text-faint);
}

.stub__code {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text-sub);
  font-size: var(--fs-sm);
}

.stub__cta {
  margin-top: 14px;
}

.route-404 {
  min-height: 52vh;
}

/* ==========================================================
   빈 상태
   ========================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 48px 20px;
  color: var(--text-sub);
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-faint);
}

.empty-state__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.empty-state__desc {
  font-size: var(--fs-sm);
}

.empty-state__cta {
  margin-top: 12px;
}

/* ==========================================================
   평점 별
   ========================================================== */
.stars {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-sm);
  line-height: 1;
}

.stars__track {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  letter-spacing: 1px;
}

.stars__base {
  color: var(--line-strong);
}

.stars__fill {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  color: #f7b500;
}

.stars__value {
  font-weight: 700;
  color: var(--text);
}

.stars__count {
  color: var(--text-faint);
}

/* ==========================================================
   재고 표시
   ========================================================== */
.stock {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-2xs);
  font-weight: 700;
  background: var(--bg-soft);
  color: var(--text-sub);
}

.stock--low {
  background: rgba(244, 63, 94, 0.1);
  color: var(--red-strong);
}

.stock--out {
  background: var(--bg-soft);
  color: var(--text-faint);
  text-decoration: line-through;
}

/* ==========================================================
   리뷰
   ========================================================== */
.review {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.review__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.review__author {
  font-weight: 700;
  font-size: var(--fs-sm);
}

.review__date {
  margin-left: auto;
  font-size: var(--fs-2xs);
  color: var(--text-faint);
}

.review__option {
  margin-top: 4px;
  font-size: var(--fs-2xs);
  color: var(--text-faint);
}

.review__body {
  margin-top: 6px;
  font-size: var(--fs-sm);
  color: var(--text-sub);
  line-height: 1.6;
}

/* ==========================================================
   쇼츠 타일 (검색·크리에이터 페이지 공용)
   ========================================================== */
.shorttile {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}

.shorttile__layer {
  position: absolute;
  inset: auto 0 0 0;
  padding: 10px;
  color: #fff;
}

.shorttile__dur {
  position: absolute;
  right: 10px;
  bottom: calc(100% + 6px);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.5);
  font-size: var(--fs-2xs);
  font-weight: 700;
}

.shorttile__caption {
  font-size: var(--fs-sm);
  font-weight: 700;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.shorttile__who {
  margin-top: 2px;
  font-size: var(--fs-2xs);
  color: var(--text-on-dark-sub);
}

/* ==========================================================
   장바구니 드로어 — 옵션 라인 (SKU)
   ========================================================== */
.cartitem__option {
  margin-top: 2px;
  font-size: var(--fs-2xs);
  color: var(--text-faint);
}

.cartitem.is-soldout .cartitem__thumb {
  opacity: 0.5;
}

.cartitem.is-soldout .cartitem__option {
  color: var(--red-strong);
}

/* ==========================================================
   T-012 — 홈 쿠폰 배너 "받음" 상태 (쿠폰함과 동일 키: WELCOME15)
   ========================================================== */
.coupon__download.is-got {
  width: auto;
  min-width: 56px;
  height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.34);
  /* check 아이콘의 원판 색 (체크 획은 흰색이라 라임 원판 위에서 보인다) */
  color: var(--lime);
  box-shadow: none;
}

.coupon__download.is-got:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.2);
}

.coupon__download-label {
  font-size: var(--fs-sm);
  font-weight: 800;
  white-space: nowrap;
  color: #fff;
}

/* ==========================================================
   T-012-r1 — 체크아웃 재고 초과 줄 (qty > 현재 SKU 재고)
   ========================================================== */
.co-item.is-over {
  outline: 1px solid var(--red-strong);
  outline-offset: 2px;
  border-radius: var(--radius-sm, 10px);
}

.co-item__err {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--red-strong);
}

.co-item__fix {
  padding: 3px 10px;
  border: 1px solid var(--red-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--red-strong);
  font-size: var(--fs-2xs);
  font-weight: 800;
  cursor: pointer;
}

.co-item__fix:hover {
  background: var(--red-strong);
  color: #fff;
}

/* ==========================================================
   T-012 — 쇼츠 뷰어 상품 스트립 → 상품 상세 링크
   ========================================================== */
.vstrip__link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  border-radius: 12px;
}

.vstrip__link .vstrip__thumb {
  flex: none;
}

.vstrip__link:hover .vstrip__name,
.vstrip__link:focus-visible .vstrip__name {
  text-decoration: underline;
}

.vstrip__link:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .stub {
    padding: 40px 16px 46px;
  }
}
