/* ====== 랭킹 컨테이너 ====== */
.ranking-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ====== 헤더 ====== */
.ranking-header {
    text-align: center;
    margin-bottom: 50px;
}

.ranking-header h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ranking-header p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 20px;
}

/* ====== 카테고리 필터 ====== */
.category-filter {
    margin-bottom: 20px;
}

.category-filter a {
    display: inline-block;
    margin: 0 8px 10px 0;
    padding: 6px 16px;
    border-radius: 25px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.category-filter a:hover { background-color: #ddd; }

.category-filter a.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* ====== 랭킹 통계 ====== */
.ranking-stats {
    background: linear-gradient(135deg,
        rgba(255, 107, 107, 0.1),
        rgba(147, 112, 219, 0.1));
    padding: 15px 25px;
    border-radius: 25px;
    display: inline-block;
    font-weight: 600;
    color: #333;
}

/* ====== 그리드 ====== */
.ranking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* ====== 카드 ====== */
.ranking-card {
    background: white;
    border-radius: 18px;
    padding: 18px; /* 기존 20px → 18px */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #eee;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px; /* 기존 15px → 12px */
}

.ranking-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.ranking-card.top-3 {
    border: 2px solid;
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.05),
        rgba(255, 255, 255, 1));
}

.ranking-card.rank-1 { border-color: #ffd700; box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3); }
.ranking-card.rank-2 { border-color: #c0c0c0; box-shadow: 0 8px 25px rgba(192, 192, 192, 0.3); }
.ranking-card.rank-3 { border-color: #cd7f32; box-shadow: 0 8px 25px rgba(205, 127, 50, 0.3); }

/* ====== 랭킹 번호 ====== */
.ranking-number {
    width: 42px;  /* 기존 45px → 42px */
    height: 42px; /* 기존 45px → 42px */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35em;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.rank-1 .ranking-number { background: linear-gradient(135deg, #ffd700, #ffed4e); box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4); }
.rank-2 .ranking-number { background: linear-gradient(135deg, #c0c0c0, #e8e8e8); box-shadow: 0 4px 15px rgba(192, 192, 192, 0.4); }
.rank-3 .ranking-number { background: linear-gradient(135deg, #cd7f32, #daa520); box-shadow: 0 4px 15px rgba(205, 127, 50, 0.4); }
.ranking-number.other { background: linear-gradient(135deg, #667eea, #764ba2); box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); }

/* ====== 이미지 ====== */
.product-image {
    width: 60px;  /* 기존 70px → 60px */
    height: 60px; /* 기존 70px → 60px */
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

/* ====== 제품 정보 ====== */
.product-details { flex: 1; min-width: 0; }
.product-brand { font-size: 0.9em; color: #888; margin-bottom: 5px; font-weight: 500; }
.product-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-price { font-size: 1em; color: #ff6699; font-weight: 600; margin-bottom: 10px; }
.like-info {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255, 107, 107, 0.1);
    padding: 8px 12px; border-radius: 20px;
    font-size: 0.9em; font-weight: 600; color: #ff6b6b;
}

/* ====== 왕관 ====== */
.crown-icon { position: absolute; top: -10px; right: -10px; font-size: 1.7em; transform: rotate(25deg); }
.rank-1 .crown-icon { color: #ffd700; text-shadow: 0 2px 8px rgba(255, 215, 0, 0.5); }

/* ====== 빈 상태 ====== */
.empty-state { text-align: center; padding: 80px 20px; color: #666; }
.empty-state .icon { font-size: 4em; margin-bottom: 20px; opacity: 0.3; }
.empty-state h2 { font-size: 1.8em; margin-bottom: 15px; color: #333; }
.empty-state p { font-size: 1.1em; margin-bottom: 30px; }

/* ====== 뒤로가기 버튼 ====== */
.back-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white; border: none;
    padding: 12px 25px; border-radius: 25px;
    cursor: pointer; font-size: 1em; font-weight: 600;
    transition: all 0.3s ease; text-decoration: none; display: inline-block; margin-top: 20px;
}
.back-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3); text-decoration: none; }

/* ====== 반응형 ====== */
@media (max-width: 1024px) {
    .ranking-container {
        padding: 30px 25px;
    }
    
    .ranking-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 18px;
    }
    
    .ranking-card {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .ranking-container { 
        padding: 20px 15px; 
    }
    
    .ranking-header h1 { 
        font-size: 2em; 
    }
    
    .ranking-header p {
        font-size: 1em;
    }
    
    .ranking-grid { 
        grid-template-columns: 1fr; 
        gap: 18px; 
    }
    
    .ranking-card { 
        padding: 16px; 
        flex-direction: column; 
        text-align: center; 
        gap: 15px;
    }
    
    .product-image { 
        width: 90px; 
        height: 90px; 
    }
    
    .ranking-number {
        width: 38px;
        height: 38px;
        font-size: 1.2em;
    }
    
    .product-name {
        font-size: 1em;
        margin-bottom: 6px;
    }
    
    .product-price {
        font-size: 0.95em;
        margin-bottom: 8px;
    }
    
    .like-info {
        padding: 6px 10px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .ranking-container {
        padding: 15px 10px;
    }
    
    .ranking-header {
        margin-bottom: 30px;
    }
    
    .ranking-header h1 {
        font-size: 1.8em;
        margin-bottom: 10px;
    }
    
    .ranking-header p {
        font-size: 0.9em;
        margin-bottom: 15px;
    }
    
    .category-filter {
        margin-bottom: 15px;
    }
    
    .category-filter a {
        margin: 0 5px 8px 0;
        padding: 5px 12px;
        font-size: 0.85em;
    }
    
    .ranking-grid {
        gap: 15px;
        margin-bottom: 30px;
    }
    
    .ranking-card {
        padding: 14px;
        gap: 12px;
    }
    
    .product-image {
        width: 80px;
        height: 80px;
    }
    
    .ranking-number {
        width: 35px;
        height: 35px;
        font-size: 1.1em;
    }
    
    .product-details {
        text-align: center;
    }
    
    .product-brand {
        font-size: 0.85em;
        margin-bottom: 4px;
    }
    
    .product-name {
        font-size: 0.95em;
        margin-bottom: 5px;
    }
    
    .product-price {
        font-size: 0.9em;
        margin-bottom: 6px;
    }
    
    .like-info {
        padding: 5px 8px;
        font-size: 0.8em;
        justify-content: center;
    }
    
    .crown-icon {
        font-size: 1.5em;
        top: -8px;
        right: -8px;
    }
}

@media (max-width: 360px) {
    .ranking-container {
        padding: 10px 8px;
    }
    
    .ranking-header h1 {
        font-size: 1.6em;
    }
    
    .ranking-header p {
        font-size: 0.85em;
    }
    
    .ranking-grid {
        gap: 12px;
    }
    
    .ranking-card {
        padding: 12px;
        gap: 10px;
    }
    
    .product-image {
        width: 70px;
        height: 70px;
    }
    
    .ranking-number {
        width: 32px;
        height: 32px;
        font-size: 1em;
    }
    
    .product-name {
        font-size: 0.9em;
    }
    
    .product-price {
        font-size: 0.85em;
    }
    
    .like-info {
        padding: 4px 6px;
        font-size: 0.75em;
    }
}

.category-dropdown {
    padding: 12px 20px;
    border: 2px solid #667eea;
    margin-bottom: 20px;
    border-radius: 25px;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    min-width: 150px;
}
