/* DEAL: 중고 물건 직거래. 3열 정사각 사진 + 이름·가격·상태. 거래가 끝난 물건은 흐리게. 공통 모양은 /lib/site.css */
.deal-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px var(--gap);
  padding: 36px 0 80px;
}
.item-cell { min-width: 0; }
.item { display: block; color: inherit; text-decoration: none; animation: item-in .6s ease both; animation-delay: calc(var(--i, 0) * 40ms); }
.item-pic { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 4px; background: var(--c, #e6e4e8); }
.item-pic img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.item-pic img.loaded { opacity: 1; }
.item-pic.empty { display: grid; place-items: center; background: rgba(255, 255, 255, .4); }
.item-pic.empty .mark { width: 16%; height: auto; opacity: .12; filter: grayscale(1); }
.item-info { display: grid; gap: 5px; padding: 12px 2px 0; }
.item-name { font: 700 15px/1.45 var(--serif); color: var(--ink); word-break: keep-all; text-wrap: pretty; }
.item-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.item-price { font: 600 14px var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.item-state { font: 500 11.5px var(--sans); color: var(--faint); white-space: nowrap; }
.st-selling .item-state, .st-haggling .item-state { color: var(--ink); } /* 지금 살 수 있는 물건만 상태 글자를 진하게(색은 쓰지 않음) */
/* 쿨거래완료: 사진을 흐리게 */
.item.st-sold .item-pic img.loaded { opacity: .45; filter: grayscale(1); }
.item.st-sold .item-name, .item.st-sold .item-price { color: var(--muted); }
@media (hover: hover) {
  .item:hover .item-pic img { transform: scale(1.03); }
  .item:hover .item-name { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
}
@keyframes item-in { from { opacity: 0; } } /* 위로 떠오르던 움직임 뺌: 처음 열 때 까딱 움직여 보였음(2026-10-08) */

/* 자세히 보기 창 */
.item-view {
  width: min(1040px, 94vw); max-height: 92dvh; padding: 0; border: 0; border-radius: 10px;
  background: var(--wall); color: var(--ink); overflow: auto;
}
.item-view::backdrop { background: rgba(27, 27, 25, .55); backdrop-filter: blur(3px); }
.iv-close { position: sticky; top: 0; float: right; z-index: 2; width: 48px; height: 48px; border: 0; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.iv-close:hover { color: var(--ink); }
.iv-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; padding: 36px; }
.iv-main { display: grid; place-items: center; aspect-ratio: 1; background: rgba(0, 0, 0, .04); border-radius: 6px; overflow: hidden; }
.iv-main img { max-width: 100%; max-height: 100%; object-fit: contain; }
.iv-main .mark { width: 16%; opacity: .12; filter: grayscale(1); }
.st-sold .iv-main img { filter: grayscale(1); opacity: .6; }
.iv-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.iv-thumbs button { width: 64px; height: 64px; padding: 0; border: 0; border-radius: 4px; overflow: hidden; background: none; cursor: pointer; opacity: .5; transition: opacity .15s; }
.iv-thumbs button[aria-pressed="true"], .iv-thumbs button:hover { opacity: 1; }
.iv-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iv-info { display: flex; flex-direction: column; padding-top: 8px; min-width: 0; }
.iv-state { margin: 0; font: 500 12px var(--sans); color: var(--faint); }
.st-selling .iv-state, .st-haggling .iv-state { color: var(--ink); }
.iv-name { margin: 8px 0 0; font: 700 24px/1.4 var(--serif); word-break: keep-all; text-wrap: balance; }
.iv-price { margin: 10px 0 0; font: 600 19px var(--sans); font-variant-numeric: tabular-nums; }
.iv-desc { margin: 22px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font: 400 15px/1.85 var(--serif); white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.iv-date { margin: 16px 0 0; font: 400 12px var(--sans); color: var(--faint); font-variant-numeric: tabular-nums; }
.iv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.iv-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border-radius: 6px; font: 600 14px var(--sans); text-decoration: none; white-space: nowrap; }
.iv-pay { background: var(--ink); color: #fff; }
.iv-pay:hover { background: #000; }
.iv-link { border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent); color: var(--ink); }
.iv-link:hover { border-color: var(--ink); }
.iv-note { margin: 12px 0 0; font: 400 12px/1.6 var(--sans); color: var(--faint); word-break: keep-all; }

@media (min-width: 2000px) { .deal-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .deal-grid { gap: 22px var(--gap); padding-top: 18px; }
  .item-info { gap: 2px; padding-top: 7px; }
  .item-name { font-size: 12.5px; }
  .item-price { font-size: 12px; }
  .item-state { font-size: 10px; }
  .item-view { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .iv-wrap { grid-template-columns: 1fr; gap: 20px; padding: 0 16px 32px; clear: both; }
  .iv-name { font-size: 20px; }
  .iv-actions a { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .item, .item-pic img { animation: none; transition: none; }
}

/* 2026-10-08 사용자 지시: 목록은 사진 밑 왼쪽에 이름·상태(이름 밑), 오른쪽에 가격·게시날짜(가격 밑). 상태 글자는 더 크고 진하게.
   자세히 보기는 맨 위 왼쪽 상태, 오른쪽 게시날짜 */
.item-info { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.item-left, .item-right { display: grid; gap: 4px; min-width: 0; }
.item-right { justify-items: end; text-align: right; }
.item-state { font: 500 12.5px var(--sans); color: var(--muted); white-space: normal; word-break: keep-all; }
.item-price { white-space: nowrap; }
.item-date { font: 500 12px var(--sans); color: var(--ink); opacity: .7; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: .02em; }
.iv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-right: 40px; }
.iv-state { font-size: 13px; color: var(--muted); }
.iv-top .iv-date { margin: 0; font: 600 13px var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
@media (max-width: 640px) {
  .item-info { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .item-right { justify-items: start; text-align: left; grid-auto-flow: column; justify-content: start; gap: 8px; align-items: baseline; }
  .item-state { font-size: 11px; }
  .item-date { font-size: 10.5px; }
  .iv-top { padding-right: 0; }
}

/* 2026-10-08 사용자 지시: 이름을 더 크게, 상태(팔생각 없음 등)도 같은 비율로 함께 키움(약 1.2배). 오른쪽 가격·날짜도 균형 맞게 조금 */
.item-name { font-size: 18px; line-height: 1.4; }
.item-price { font-size: 16px; }
.item-date { font-size: 13px; }
.item-state { font-size: 15px; }
.item-left { gap: 5px; }
.iv-name { font-size: 29px; }
.iv-state { font-size: 15.5px; }
@media (max-width: 640px) {
  .item-name { font-size: 15px; }
  .item-state { font-size: 13px; }
  .item-price { font-size: 13px; }
  .item-date { font-size: 11px; }
  .iv-name { font-size: 24px; }
}
/* [DEAL!] 단추와 메일 창(2026-10-08 사용자 지시: 단추 하나, 누르면 메일 창, 창 안에 카톡 상담 안내) */
.iv-actions button.iv-pay { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 30px; border: 0; border-radius: 6px; font: 700 14px var(--sans); letter-spacing: .04em; cursor: pointer; }
.deal-mail { width: min(560px, 94vw); max-height: 92dvh; padding: 0; border: 0; border-radius: 10px; background: var(--wall); color: var(--ink); overflow: auto; }
.deal-mail::backdrop { background: rgba(27, 27, 25, .45); }
.deal-mail form { display: grid; gap: 16px; padding: 28px 28px 24px; }
.dm-title { margin: 0; padding-right: 40px; font: 700 18px/1.4 var(--serif); word-break: keep-all; }
.dm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.deal-mail label { display: grid; gap: 4px; }
.deal-mail label span { font: 500 11px var(--sans); color: var(--muted); }
.deal-mail input, .deal-mail textarea { width: 100%; padding: 9px 0; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); background: none; font: 400 15px var(--sans); color: var(--ink); outline: none; }
.deal-mail textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.deal-mail input:focus, .deal-mail textarea:focus { border-bottom-color: var(--ink); }
.deal-mail .cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.dm-kakao { margin: 0; font: 400 13px/1.6 var(--sans); color: var(--muted); word-break: keep-all; }
.dm-kakao b { color: var(--ink); font-weight: 700; }
.dm-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dm-msg { flex: 1; margin: 0; font: 13px/1.6 var(--sans); color: var(--muted); word-break: keep-all; }
.dm-foot .iv-pay { min-height: 44px; padding: 0 26px; border: 0; border-radius: 6px; font: 600 14px var(--sans); cursor: pointer; }
.dm-foot .iv-pay:disabled { opacity: .4; }
.deal-mail .iv-close { position: absolute; top: 6px; right: 6px; float: none; }
@media (max-width: 640px) { .dm-row { grid-template-columns: 1fr; } .deal-mail form { padding: 22px 18px 18px; } }
/* 자세히 보기: 가격만 오른쪽 정렬(사용자 지시 2026-10-08) */
.iv-price { text-align: right; }
/* 문의 메일 창 키움(사용자 지시 2026-10-08): 폭 760, 여백·글자·본문 칸 크게 */
.deal-mail { width: min(760px, 94vw); }
.deal-mail form { gap: 20px; padding: 40px 40px 32px; }
.dm-title { font-size: 22px; }
.deal-mail label span { font-size: 12px; }
.deal-mail input, .deal-mail textarea { font-size: 16px; }
.deal-mail textarea { min-height: 260px; }
.dm-kakao { font-size: 14px; }
@media (max-width: 640px) { .deal-mail form { padding: 26px 20px 20px; } .deal-mail textarea { min-height: 200px; } }
.dm-kakao a { color: var(--ink); text-decoration: none; border-bottom: 1px solid currentColor; }
/* 번쩍임 없애기(2026-10-08): 열 때 칸·사진이 서서히 나타나던 효과를 뺀다(쿨거래완료의 흐린 사진은 그대로) */
.item { animation: none; }
.item-pic img { opacity: 1; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.item.st-sold .item-pic img { opacity: .45; }
