/* ==========================================================
   components.css - 재사용 컴포넌트
   진열장 카드 · 요약 통계 · 필터 · 배지 · 폼 · 버튼
   (색/폰트는 common.css 의 변수만 사용)
   ========================================================== */

/* ===== 페이지 머리 (제목 + 우측 액션) ===== */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }

/* ===== 버튼 ===== */
.btn {
    display: inline-block;
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: #b4551f; border-color: #b4551f; color: #fff; }

/* ===== 요약 통계 (총 개수 · 컬렉션 · 받은 부럽다) ===== */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.stat .num { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.stat .cap { font-size: 12px; color: var(--muted); }

/* ===== 필터 (전체 / 소장 / 위시) ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter-bar a {
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
    color: var(--muted);
    transition: background .15s, color .15s, border-color .15s;
}
.filter-bar a:hover { color: var(--text); }
.filter-bar a.on {
    background: var(--accent-soft);
    border-color: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

/* ===== 진열장 그리드 ===== */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}

/* ===== 물건 카드 ===== */
.goods-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.goods-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(28, 27, 25, .07);
}

/* 사진 자리 — 실제 이미지가 붙기 전까지 이모지 플레이스홀더 */
.goods-card .thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
    background: linear-gradient(140deg, var(--accent-soft), var(--bg));
}
.goods-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

.goods-card .body { padding: 12px 14px 14px; flex: 1; }
.goods-card .brand { font-size: 12px; color: var(--muted); }
.goods-card .name {
    font-weight: 700;
    line-height: 1.35;
    margin: 2px 0 8px;
    letter-spacing: -0.01em;
}
.goods-card .meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
}

/* ===== 배지 (고정 · 상태 · 부럽다) ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--muted);
}
.badge-featured {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.badge-wish { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.envy { font-weight: 600; color: var(--accent); }

/* ===== 공유 프로필 머리 ===== */
.profile-head {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
}
.profile-head .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--accent-soft), var(--bg));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    flex: none;
}
.profile-head .handle { color: var(--muted); font-size: 13px; }
.profile-head .bio { margin: 6px 0 0; max-width: 52ch; }

/* ===== 컬렉션 줄 ===== */
.collection-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.collection-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .15s;
}
.collection-card:hover { border-color: var(--accent); }
.collection-card .ico { font-size: 22px; }
.collection-card .t { font-weight: 700; font-size: 14px; }
.collection-card .c { font-size: 12px; color: var(--muted); }

/* ===== 폼 ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.field input,
.field select,
.field textarea {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.field .req { color: var(--accent); }

/* 카테고리별 추가 항목이 들어가는 자리 */
.field-group {
    grid-column: 1 / -1;
    border-top: 1px dashed var(--line);
    padding-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.field-group .group-title {
    grid-column: 1 / -1;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

/* ===== 빈 상태 ===== */
.empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}

/* ===== 반응형 ===== */
@media (max-width: 768px) {
    .goods-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; text-align: center; }
}
