/* /main/css/recommend.css */

/* 1. 컨테이너 설정 */
.container-fluid {
    max-width: 1600px !important;
    margin: 0 auto !important;
    padding-left: 10rem !important; 
    padding-right: 10rem !important;
}

/* 2. 섹션 스타일 */
.product-section {
    margin: 0 !important;
    padding: 110px 0 50px 0 !important; 
    border-radius: 0;  
    min-height: auto !important; 
}

/* 3. 카드 기본 스타일 */
.card {
    height: auto !important;
    min-height: 340px !important; 
    max-width: 300px !important;
    overflow: hidden !important;
}

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

.card img {
    height: 190px !important;
    object-fit: cover;
}

.card:hover img {
    transform: scale(1.1);   
}

.card .card-body {
    height: 150px !important;
    overflow: hidden;
    padding: 0.5rem !important;
}

/* 4. 텍스트 크기 및 간격 미세 조정 */
.card h6 {
    font-size: 0.95rem !important;
    margin-bottom: 0.3rem !important;
}

.price-per-kg {
    color: #888 !important;
    font-weight: 500;
    font-size: 0.8rem !important; 
    margin-bottom: 0.2rem !important;
}

.product-weight {
    color: #6c757d;
    font-size: 0.8rem !important; 
    margin-bottom: 0.2rem !important;
}

.total-price {
    color: #111 !important;
    font-weight: 700;
    font-size: 1.1rem !important; 
    margin-bottom: 0 !important;
}

.badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.3rem !important;
}

/* 5. 카드 사이 간격(Row Gap) 줄이기 */
.container-fluid .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    --bs-gutter-y: 1rem !important; 
}

/* 빈 슬롯 스타일 */
.empty-slot {
    min-height: 340px !important;
    height: auto !important;
    max-width: 300px !important;
    border: 2px dashed #ddd !important;
    opacity: 0.3;
    border-radius: 10px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.empty-slot .card-body {
    height: auto !important;  
    padding: 0 !important;
}

/* 제목 스타일 */
.section-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem !important; 
}

.section-desc {
    font-size: 1rem;
    color: #6c757d;
}

/* =========================================
   반응형 설정
   ========================================= */

/* 태블릿 (992px 이하) */
@media (max-width: 991px) {
    .container-fluid {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
        
    .product-section {
        margin: 0 !important;
        padding-top: 80px !important; 
    }
        
    .section-title {
        font-size: 1.5rem;
    }
        
    .row-cols-md-4 > .col {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .row.row-cols-md-4 {
        gap: 1rem !important;
    }
    
    .card {
        max-width: 100% !important;
    }
}

/* 모바일 (768px 이하) - 통합 */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .product-section {
        padding: 15px 0 20px 0 !important;
        min-height: auto !important;
    }
    
    /* 모바일에서 5번째부터 숨기기 (4개만 표시) */
    .row > .col:nth-child(n+5) {
        display: none !important;
    }
    
    .card {
        max-width: 100% !important;
        min-height: 220px !important;
        height: auto !important;
    }

    .card img {
        height: 100px !important;
    }

    .card .card-body {
        height: auto !important;
        padding: 0.4rem !important;
    }
    
    .empty-slot {
        min-height: 220px !important;
    }
}

/* 초소형 모바일 (576px 이하) - 2열 강제, 통합 */
@media (max-width: 576px) {
    .container-fluid {
        max-width: 100% !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .product-section {
        margin: 0 !important;
        padding: 10px 0 15px 0 !important;
        min-height: auto !important;
    }
    
    /* 모바일에서 5번째부터 숨기기 (4개만 표시) */
    .row > .col:nth-child(n+5) {
        display: none !important;
    }
    
    .section-title {
        font-size: 1.1rem !important;
        margin-bottom: 0.3rem !important;
    }
    
    .section-desc {
        font-size: 0.85rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .row.row-cols-2 > .col,
    .row.row-cols-md-4 > .col {
        flex: 0 0 calc(50% - 0.5rem) !important;
        max-width: calc(50% - 0.5rem) !important;
    }
    
    .row.g-4 {
        gap: 0.6rem !important;
        margin: 0 !important;
    }
    
    .card {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        min-height: 220px !important;
    }
    
    .card-body {
        padding: 0.4rem !important;
        height: auto !important;
    }
    
    .card img {
        height: 100px !important;
        object-fit: cover;
    }
    
    .card h6 {
        font-size: 0.8rem !important;
        margin-bottom: 0.2rem !important;
        line-height: 1.3;
    }
    
    .price-per-kg {
        font-size: 0.7rem !important;
        margin-bottom: 0.15rem !important;
    }
    
    .product-weight {
        font-size: 0.7rem !important;
        margin-bottom: 0.15rem !important;
    }
    
    .total-price {
        font-size: 0.9rem !important;
    }
    
    .badge {
        font-size: 0.65rem !important;
        padding: 0.25rem 0.4rem !important;
    }
    
    .empty-slot {
        min-height: 220px !important;
    }
}