/* ===== 상품 목록(/shop) · 상품 상세(/product/:id) ===== */

/* 현재 위치 */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px 0; font-size: 13px; color: var(--muted); }
.crumbs > * + *::before { content: "›"; margin: 0 8px; color: var(--line); }
.crumbs a:hover { color: var(--green-800); text-decoration: underline; }
.crumbs [aria-current] { color: var(--green-800); font-weight: 600; }

/* ---------- 목록: 머리 ---------- */
.shop-head { padding-top: clamp(32px, 5vw, 56px); padding-bottom: 32px; }
.shop-title { margin-top: 18px; }
.shop-lead { margin-top: 12px; max-width: 620px; font-size: 16px; color: var(--green-800); }
.shop-pets {
  display: inline-flex; gap: 6px; margin-top: 28px; padding: 6px;
  border-radius: 999px; background: var(--gray-50);
}
.shop-pets a {
  display: grid; place-items: center; height: 42px; padding: 0 22px; border-radius: 999px;
  font-size: 14px; font-weight: 700; color: var(--muted); transition: background 0.2s, color 0.2s;
}
.shop-pets a:hover { color: var(--green-800); }
.shop-pets a[aria-current] { background: var(--yellow); color: var(--green-800); }

/* ---------- 목록: 본문 (필터 + 결과) ---------- */
.shop-body { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; padding-bottom: 120px; scroll-margin-top: calc(var(--header-h) + 16px); }
.shop-filters { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 28px; }
.f-title { margin-bottom: 10px; font-size: 13px; font-weight: 800; letter-spacing: 0.04em; color: var(--green-800); }
.f-list { display: grid; gap: 2px; }
.f-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 38px; padding: 6px 12px; border-radius: 10px; font-size: 14px; color: var(--text);
  transition: background 0.2s, color 0.2s;
}
.f-option:hover { background: var(--gray-50); color: var(--green-800); }
.f-option.is-on { background: var(--green-800); color: var(--white); font-weight: 700; }
.f-option.is-empty { color: #b9b9b9; }
.f-count { min-width: 26px; padding: 0 7px; border-radius: 999px; background: var(--gray-50); font-size: 12px; line-height: 20px; text-align: center; color: var(--muted); }
.f-option.is-on .f-count { background: rgba(255, 255, 255, 0.2); color: var(--white); }
.f-hint { font-size: 13px; color: var(--muted); }

.shop-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.shop-count { margin-right: auto; font-size: 14px; color: var(--green-800); font-weight: 600; }
.filter-toggle { display: none; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--green-800); }
.shop-sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.shop-sort__select { height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--green-800); font-weight: 600; }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.active-filters:empty { display: none; }
.active-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 14px;
  border-radius: 999px; background: var(--beige); color: var(--green-800); font-size: 13px; font-weight: 600;
}
.active-chip svg { width: 14px; height: 14px; transform: rotate(45deg); }
.active-chip:hover { background: var(--yellow); }
.active-clear { align-self: center; margin-left: 4px; font-size: 13px; color: var(--muted); text-decoration: underline; }

.shop-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
.shop-card .product-name { font-size: 17px; }
.shop-card .product-name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.shop-card .add-btn { position: relative; z-index: 1; }
.shop-card__cat { margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--orange); }
.shop-card__opts { margin-top: 6px; font-size: 12px; color: var(--muted); }
.shop-card .product-price { margin-top: auto; padding-top: 10px; }
.add-btn--link { display: grid; place-items: center; }
.product-card:hover .add-btn--link { background: var(--yellow); border-color: var(--yellow); }
.shop-card .product-tag { z-index: 1; }

.shop-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 20px; padding: 80px 20px; border-radius: var(--radius); background: var(--gray-50); text-align: center; color: var(--green-800); }

.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 48px; }
.pager:empty { display: none; }
.pager-link {
  display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); font-weight: 700; color: var(--green-800); transition: background 0.2s;
}
.pager-link:hover { background: var(--gray-50); }
.pager-link.is-current { background: var(--green-800); border-color: var(--green-800); color: var(--white); }

/* ---------- 상세 ---------- */
.pd { padding-top: clamp(24px, 4vw, 44px); }
.pd > .crumbs { margin-bottom: 24px; }
.pd-top { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.pd-gallery { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 12px; }
.pd-main { display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--radius); background: var(--gray-50); overflow: hidden; }
.pd-main.product-media { height: auto; }
.pd-main.product-media svg { width: 78%; }
.pd-main img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.pd-thumb { aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: var(--gray-50); }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumb[aria-pressed="true"] { border-color: var(--green-800); }

.pd-cat { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--orange); }
.pd-tag { position: static; }
.pd-name { margin-top: 10px; font-size: clamp(28px, 3vw, 40px); line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; color: var(--green-800); }
.pd-desc { margin-top: 12px; font-size: 16px; }
.pd-price { margin-top: 20px; font-size: 26px; font-weight: 800; color: var(--orange); }
.pd-field { margin-top: 28px; }
.pd-label { font-size: 14px; font-weight: 700; color: var(--green-800); }
.pd-hint { font-size: 13px; font-weight: 500; color: var(--orange); }
.pd-opts { margin-top: 10px; }
.pd-opts .size-chip { height: 40px; padding: 0 18px; font-size: 14px; }

.pd-sizefind { margin-top: 24px; padding: 18px 20px; border-radius: var(--radius-sm); background: var(--beige); }
.pd-sizefind label { display: block; font-size: 14px; font-weight: 700; color: var(--green-800); }
.pd-sizefind__row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.pd-input { width: 110px; height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); }
.pd-sizefind__btn { height: 42px; margin-left: auto; background: var(--green-800); color: var(--white); }
.pd-sizefind__btn:hover { background: var(--green-900); }
.pd-sizefind .pd-hint { margin-top: 10px; color: var(--green-800); }

.pd-buy { display: flex; gap: 12px; margin-top: 28px; }
.pd-qty { display: flex; align-items: center; height: 56px; border-radius: 999px; border: 1px solid var(--line); }
.pd-qty button { width: 48px; height: 100%; font-size: 20px; color: var(--green-800); }
.pd-qty input { width: 44px; height: 100%; border: 0; text-align: center; font-weight: 700; color: var(--green-800); -moz-appearance: textfield; }
.pd-qty input::-webkit-inner-spin-button, .pd-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pd-add { flex: 1; height: 56px; font-size: 15px; }
.pd-add:disabled { background: var(--gray-50); color: var(--muted); cursor: not-allowed; }
.pd-total { min-height: 1.6em; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--green-800); }
.pd-points { display: grid; gap: 6px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; }
.pd-points li::before { content: "·"; margin-right: 8px; color: var(--orange); font-weight: 800; }
.pd-points a { color: var(--green-800); text-decoration: underline; }

.pd-tabs { margin-top: clamp(56px, 8vw, 96px); }
.pd-tablist { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.pd-tab { flex: none; padding: 14px 22px; border-bottom: 3px solid transparent; margin-bottom: -1px; font-size: 15px; font-weight: 700; color: var(--muted); }
.pd-tab[aria-selected="true"] { color: var(--green-800); border-bottom-color: var(--yellow-dark); }
.pd-panel { padding: 28px 4px 8px; }
.pd-panel:focus-visible { border-radius: 8px; }
.pd-text { display: grid; gap: 12px; max-width: 760px; font-size: 15px; line-height: 1.8; }
.pd-note { color: var(--muted); font-size: 14px; }
.pd-spec { display: grid; grid-template-columns: 120px 1fr; gap: 10px 20px; max-width: 760px; margin-bottom: 24px; }
.pd-spec dt { font-weight: 700; color: var(--green-800); }
.pd-spec dd { margin: 0; }
.pd-table { width: 100%; max-width: 760px; border-collapse: collapse; font-size: 14px; }
.pd-table th, .pd-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.pd-table th { background: var(--gray-50); color: var(--green-800); font-weight: 700; }

.pd-faq { margin-top: clamp(56px, 8vw, 96px); }
.pd-subtitle { margin-bottom: 20px; font-size: 24px; font-weight: 800; color: var(--green-800); }
.pd-faq .faq-list { display: grid; gap: 12px; max-width: 860px; }
.pd-related { padding-block: clamp(64px, 9vw, 110px); }
.pd-related .h-lg { margin-bottom: 32px; }
.pd-related[hidden] { display: none; }

/* ---------- 반응형 ---------- */
@media (max-width: 980px) {
  .shop-body { grid-template-columns: 1fr; gap: 0; }
  .filter-toggle { display: inline-flex; align-items: center; }
  .shop-filters {
    position: static; display: none; grid-template-columns: repeat(2, 1fr); gap: 20px;
    margin-bottom: 24px; padding: 20px; border-radius: var(--radius-sm); background: var(--gray-50);
  }
  .shop-filters.is-open { display: grid; }
  .shop-filters .f-option:hover { background: var(--white); }
  .shop-toolbar { flex-wrap: wrap; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .pd-top { grid-template-columns: 1fr; }
  .pd-gallery { position: static; }
}
@media (max-width: 640px) {
  .shop-head { padding-bottom: 20px; }
  .shop-pets { display: flex; }
  .shop-pets a { flex: 1; padding: 0 12px; }
  .shop-filters { grid-template-columns: 1fr; }
  .shop-count { width: 100%; }
  .shop-sort { margin-left: auto; }
  .shop-grid { grid-template-columns: 1fr; }
  .pd-buy { flex-direction: column; }
  .pd-qty { align-self: flex-start; }
  .pd-spec { grid-template-columns: 1fr; gap: 4px; }
  .pd-spec dd { margin-bottom: 10px; }
}
