/*
 * 파일명: assets/css/main.css
 * 역할: 메인 페이지(index.php) 전용 스타일
 *       - 상단 대가성 문구 띠 (sticky top)
 *       - 프로필 영역
 *       - 검색바 + 카테고리 탭
 *       - 가로형 리스트 카드 (썸네일 + 번호 + 이름)
 *       - PC 최대 3열 → 모바일 1열 반응형
 */

/* ============================================================
   레이아웃 컨테이너
   ============================================================ */
.main-wrapper {
    min-height: 100vh;
    background-color: var(--color-bg-soft);
    padding-bottom: 100px;
}


/* ============================================================
   0. 최상단 대가성 문구 띠 (Marquee Bar)
   ============================================================ */
.top-disclosure-bar {
    background: #FFF3CD;
    color: #856404;
    border-bottom: 1px solid #FFEAA7;
    font-size: var(--text-xs);
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: var(--z-header);
}

.top-disclosure-track {
    display: inline-flex;
    white-space: nowrap;
    padding: 8px 0;
    animation: marquee 25s linear infinite;
}

.top-disclosure-track span {
    padding: 0 var(--space-3xl);
    font-weight: 500;
}

@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}


/* ============================================================
   1. 프로필 영역 (상단)
   ============================================================ */
.profile-section {
    background: var(--color-bg);
    padding: var(--space-2xl) var(--space-lg) var(--space-xl);
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

.profile-actions {
    position: absolute;
    top: var(--space-md);
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 var(--space-md);
}

.profile-action-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-bg-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition-fast);
    border: 1px solid var(--color-border);
}

.profile-action-btn:hover {
    background: var(--color-bg-hover);
}

.profile-image-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-bg-soft);
    box-shadow: var(--shadow-card);
    border: 3px solid var(--color-bg);
}

.profile-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: var(--text-xl);
    font-weight: 800;
    margin-bottom: var(--space-md);
    letter-spacing: -0.03em;
}

.profile-bio {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

/* SNS / 비즈니스 제안 등 액션 버튼들 */
.profile-cta-row {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.profile-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: var(--color-bg-soft);
    border: 1px solid var(--color-border);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
}

.profile-cta-btn:hover {
    background: var(--color-bg-hover);
    transform: translateY(-1px);
}


/* ============================================================
   2. 검색 + 카테고리 (Sticky 영역)
   ============================================================ */
.sticky-filter {
    position: sticky;
    top: 36px; /* 상단 대가성 문구 띠 높이만큼 */
    background: var(--color-bg);
    z-index: var(--z-sticky);
    padding: var(--space-md) 0 var(--space-sm);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 검색바 */
.search-bar {
    position: relative;
    margin: 0 var(--space-lg) var(--space-md);
    display: flex;
    gap: var(--space-sm);
}

.search-input-wrap {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 11px 40px 11px 40px;
    font-size: var(--text-base);
    background: var(--color-bg-soft);
    border: 1.5px solid transparent;
    border-radius: var(--radius-pill);
    transition: all var(--transition-base);
    color: var(--color-text-primary);
}

.search-input:focus {
    outline: none;
    background: var(--color-bg);
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px var(--color-accent-soft);
}

/* ⭐ 더 흐린 placeholder */
.search-input::placeholder {
    color: #CED4DA;
    font-weight: 400;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-tertiary);
    pointer-events: none;
    font-size: 16px;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-border-strong);
    color: white;
    font-size: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    cursor: pointer;
}
.search-clear.show { display: inline-flex; }

/* ⭐ "검색" 텍스트 버튼 */
.search-submit-btn {
    flex-shrink: 0;
    padding: 11px 20px;
    background: var(--color-text-primary);
    color: var(--color-text-inverse);
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: 700;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.search-submit-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

/* 카테고리 칩 */
.category-tabs {
    display: flex;
    gap: var(--space-sm);
    padding: 0 var(--space-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }

.category-chip {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-pill);
    background: var(--color-bg-soft);
    color: var(--color-text-secondary);
    border: 1.5px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
}

.category-chip:hover {
    background: var(--color-bg-hover);
}

.category-chip.active {
    background: var(--color-text-primary);
    color: var(--color-text-inverse);
    border-color: var(--color-text-primary);
}


/* ============================================================
   3. 상품 그리드 (가로형 리스트 카드)
   ============================================================ */
.products-section {
    padding: var(--space-lg) var(--space-lg) 0;
    max-width: 1200px;
    margin: 0 auto;
}

.products-count {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-md);
}
.products-count strong {
    color: var(--color-text-primary);
    font-weight: 700;
}

/* ⭐ 그리드: 모바일 1열 → 태블릿 2열 → PC 3열 */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 700px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-md);
    }
}

/* ⭐ 가로형 리스트 카드 */
.product-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    padding: var(--space-sm);
    gap: var(--space-md);
    position: relative;
    cursor: pointer;
    animation: fadeIn var(--transition-base) both;
    min-height: 88px;
}

.product-card:hover {
    box-shadow: var(--shadow-card);
    transform: translateY(-1px);
}

/* 카드 클릭 영역 전체화 */
.product-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* 썸네일 (작게) */
.product-thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-bg-soft);
    position: relative;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 카드 본문 */
.product-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding-right: var(--space-md);
}

/* 번호 + 상품명 묶음 */
.product-title-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.product-number {
    flex-shrink: 0;
    font-size: var(--text-base);
    font-weight: 800;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
    line-height: 1.4;
}

.product-title {
    flex: 1;
    font-size: var(--text-base);
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-text-primary);

    /* 2줄 말줄임 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: keep-all;
}

/* 뱃지 (있으면 작게 표시) */
.product-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-pill);
    letter-spacing: -0.01em;
    margin-left: 6px;
    vertical-align: middle;
}

/* 태그 (작게 한 줄로) */
.product-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.product-tag {
    font-size: 11px;
    color: var(--color-text-tertiary);
    background: transparent;
    cursor: pointer;
}

.product-tag:hover {
    color: var(--color-accent);
}

/* 우측 화살표 인디케이터 */
.product-arrow {
    flex-shrink: 0;
    color: var(--color-text-tertiary);
    font-size: 18px;
    padding-right: var(--space-sm);
}


/* ============================================================
   4. 빈 상태
   ============================================================ */
.empty-state {
    text-align: center;
    padding: var(--space-4xl) var(--space-lg);
    color: var(--color-text-tertiary);
    grid-column: 1 / -1;
}

.empty-state-emoji {
    font-size: 48px;
    margin-bottom: var(--space-md);
}

.empty-state-text {
    font-size: var(--text-base);
    line-height: 1.6;
}


/* ============================================================
   5. 카드 하이라이트 (딥링크)
   ============================================================ */
.product-card.highlighted {
    box-shadow: 0 0 0 2px var(--color-accent), var(--shadow-card);
    animation: pulse 1.5s ease-in-out 2;
}


/* ============================================================
   6. 하단 푸터
   ============================================================ */
.main-footer {
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: var(--text-xs);
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
}


/* ============================================================
   7. 카카오톡 공유 플로팅
   ============================================================ */
.kakao-share-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: var(--z-fab);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #FEE500;
    color: #3C1E1E;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-float);
    transition: all var(--transition-base);
}

.kakao-share-fab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 28px rgba(254, 229, 0, 0.4);
}


/* ============================================================
   8. 반응형: 컨테이너 너비 조정
   ============================================================ */
.profile-section,
.sticky-filter,
.main-footer {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 769px) {
    .main-wrapper {
        background: var(--color-bg-soft);
    }
    .profile-section {
        background: var(--color-bg);
    }
}
