/* ============================================================
   공용 카드 컴포넌트 — 촬영상품(pd-cards) / 지점안내(br-grid) 공통 규격
   사용법:
     <a class="card" href="...">              상품 카드 (이름+가격+설명)
     <a class="card card--branch" href="..."> 지점 카드 (이름+주소, 타이포만 오버라이드)
   바로가기(card__goto)는 모든 카드에 포함 — 데스크톱 호버 시에만 표시,
   터치 기기(모바일)에서는 표시 안 함.
   폰트 변수(--sans/--serif)는 각 페이지 CSS의 :root를 참조.
   ============================================================ */

.card {
  position: relative; display: block; width: 440px;
  color: inherit; text-decoration: none;
}
.card__img { width: 440px; height: 300px; object-fit: cover; }

/* ---------- 바로가기 (호버 시 표시, 모바일 숨김) ---------- */
/* 원시 <card-goto> 요소는 JS(card-goto.js) 치환 전까지 스타일 없는 텍스트로
   항상 떠 보이므로 자체를 숨김 — 치환된 .card__goto span만 호버로 표시 */
card-goto { display: none; }
.card__goto {
  position: absolute; left: 20px; top: 237px; width: 400px; height: 47px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 0 24px;
  background: #fff; border-radius: 4px;
  font-family: var(--sans, sans-serif);
  font-weight: 500; font-size: 15px; letter-spacing: -0.02em; color: #000;
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.card__goto img { width: 13px; height: 10px; }
@media (hover: hover) {
  .card:hover .card__goto { opacity: 1; visibility: visible; }
}

/* ---------- 이름 + 가격 (상품 카드 기준 스펙) ---------- */
/* img→텍스트 간격 32(피그마 4040:4992: y332−300), 이름/가격 행 높이 28 —
   baseline 정렬로 행이 29로 불어나는 것을 고정 */
.card__info {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 32px; height: 28px;
}
.card__name {
  font-weight: 600; font-size: 22px; line-height: 26.3px;
  letter-spacing: -0.02em; color: #333;
}
.card__price {
  font-family: var(--serif, serif); font-style: normal; font-weight: 700;
  font-size: 24px; line-height: 27.6px; letter-spacing: 0.01em;
  color: var(--c-green, #4a4c25);
}
.card__price span {
  font-family: var(--sans, sans-serif); font-weight: 500;
  font-size: 18px; margin-left: 5px;
}

/* ---------- 하단 텍스트: 상품 설명 16px (이름행→설명 간격 12: 피그마 40−28) ---------- */
.card__desc {
  margin-top: 12px; font-weight: 500; font-size: 16px; line-height: 22px;
  letter-spacing: -0.02em; color: #787878;
}

/* ---------- 지점 카드 수정자 (피그마 sub_지점안내 4040:5118 스펙: 700 24px / 18px,
   img→이름 32, 이름→주소 12 — 카드 총 395) ---------- */
.card--branch .card__name {
  display: block; margin-top: 32px;
  font-weight: 700; font-size: 24px; line-height: 29px; /* 정수 — 28.6은 카드 394.6px로 행 피치가 1px 흔들림 */
}
.card--branch .card__desc {
  margin-top: 12px; font-size: 18px; line-height: 22px;
}

/* ============================================================
   모바일 (html.is-m — 360 캔버스) — 피그마 촬영상품_360 4110:8067
   카드 320, img 320×218, 텍스트 세로 스택(이름→설명→가격):
   .card__info를 display:contents로 해체해 flex order로 재배열
   ============================================================ */
html.is-m .card { display: flex; flex-direction: column; align-items: flex-start; width: 320px; }
html.is-m .card__img { width: 320px; height: 218px; order: 0; }
html.is-m .card__info { display: contents; }
html.is-m .card__name { order: 1; margin-top: 16px; font-size: 18px; line-height: 21px; }
html.is-m .card__desc { order: 2; margin-top: 4px; font-size: 15px; line-height: 22px; white-space: nowrap; }
html.is-m .card__price { order: 3; margin-top: 8px; font-weight: 800; font-size: 18px; line-height: 21px; }
html.is-m .card__price span { font-size: 14px; }
/* 바로가기 바 — 모바일에서는 호버 동작이 없으므로 아예 렌더에서 제외 */
html.is-m .card__goto { display: none; }

/* 지점 카드 — 피그마 지점안내_360 4110:8453: img 320×200, 이름 19 Bold, 주소 15 */
html.is-m .card--branch .card__img { height: 200px; }
html.is-m .card--branch .card__name { margin-top: 18px; font-weight: 700; font-size: 19px; line-height: 23px; }
html.is-m .card--branch .card__desc { margin-top: 8px; font-size: 15px; line-height: 18px; }
