/* ═══════════════════════════════════════════════════════════════
   🎨 상품 목록 페이지 상태별 스타일 (product-list-states.css)
   ═══════════════════════════════════════════════════════════════ */

/* ─── 로딩 상태 ─── */
.loading-state,
.error-state,
.no-products {
    grid-column: 1 / -1; /* 전체 그리드 컬럼 차지 */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 40px 20px;
}

.loading-message,
.error-message,
.no-products-message {
    text-align: center;
    padding: 40px;
    background: var(--input-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 400px;
    width: 100%;
}

.loading-message p {
    font-size: 16px;
    color: var(--font-primary);
    margin: 0;
    position: relative;
}

/* 로딩 애니메이션 */
.loading-message p::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid var(--btn-primary-bg);
    border-radius: 50%;
    border-top-color: transparent;
    animation: loading-spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── 에러 상태 ─── */
.error-message p {
    font-size: 16px;
    color: var(--font-primary);
    margin: 0 0 8px 0;
}

.error-detail {
    font-size: 14px;
    color: var(--font-light);
    margin-bottom: 20px !important;
    word-break: break-word;
}

.retry-button {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.retry-button:hover {
    opacity: 0.9;
}

/* ─── 빈 상태 (상품 없음) ─── */
.no-products-message p {
    font-size: 16px;
    color: var(--font-light);
    margin: 0;
}

/* ─── 베스트 상품 뱃지 ─── */
.common-card {
    position: relative;
}

.best-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── 이미지 로딩 실패 처리 ─── */
.card-image {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.card-image[src="/images/no-image.jpg"]::before {
    content: '이미지 없음';
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
    font-size: 14px;
}

/* ─── 반응형: 모바일에서 상태 메시지 ─── */
@media (max-width: 768px) {
    .loading-state,
    .error-state,
    .no-products {
        min-height: 300px;
        padding: 20px 16px;
    }

    .loading-message,
    .error-message,
    .no-products-message {
        padding: 30px 20px;
    }

    .loading-message p,
    .error-message p,
    .no-products-message p {
        font-size: 15px;
    }

    .error-detail {
        font-size: 13px;
    }
}

/* ─── 페이지네이션 비활성화 상태 ─── */
.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--input-bg);
}

.pagination button:disabled:hover {
    background: var(--input-bg);
    transform: none;
}

/* ─── 정렬 select 포커스 스타일 ─── */
.sort:focus {
    outline: 2px solid var(--btn-primary-bg);
    outline-offset: 2px;
    border-color: var(--btn-primary-bg);
}

/* ─── 카드 호버 효과 개선 ─── */
.common-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.common-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}