/* /www/dododo/dox/style/category.css */


/* ================================================
   상품 리스트 페이지
   ================================================ */
.product-list-page {
    padding: 10px 0 60px;
    min-height: 70vh;
}

/* 빵가루 네비게이션 */
.breadcrumb {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-gray);
    margin: 0;
}

.breadcrumb a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #ccc;
}

/* 카테고리 헤더 - 한 줄로 */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 2px solid var(--text-dark);
    margin-bottom: 15px;
}

.category-header h1 {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
}

/* 오른쪽 컨트롤 그룹 */
.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 정렬 + 보기 버튼 */
.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-count {
    font-size: 15px;
    color: var(--text-gray);
    white-space: nowrap;
}

.product-count strong {
    color: var(--primary-color);
    font-size: 16px;
}

/* 하위 카테고리 배지 */
.sub-category-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.sub-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 14px;
    transition: all 0.2s;
}

.sub-badge:hover {
    background: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.sub-badge .badge-label {
    background: #ff4444;
    color: var(--bg-white);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
}

/* 정렬 옵션 */
.sort-options {
    display: flex;
    gap: 8px;
}

.sort-btn {
    padding: 6px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-gray);
    font-size: 13px;
    transition: all 0.2s;
    white-space: nowrap;
}

.sort-btn:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.sort-btn.active {
    background: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
    font-weight: 500;
}

/* 보기 옵션 */
.view-options {
    display: flex;
    gap: 4px;
}

.view-btn {
    padding: 6px 10px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-gray);
}

.view-btn:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.view-btn.active {
    background: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
}

.view-btn svg {
    display: block;
}

/* 상품 그리드 - 5칸 */
.product-list-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

.product-list-grid[data-view="grid"] {
    grid-template-columns: repeat(5, 1fr);
}


/* 반응형 */
@media (max-width: 1600px) {
    .product-list-grid[data-view="grid"] {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1400px) {
    .product-list-grid[data-view="grid"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .product-list-grid[data-view="grid"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .product-list-grid[data-view="grid"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .header-controls {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .control-group {
        width: 100%;
    }
    
    .sort-options {
        width: 100%;
        overflow-x: auto;
    }
    
    .sub-category-item {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .product-list-grid[data-view="list"] .product-image {
        width: 100px;
        min-width: 100px;
        height: 100px;
    }
    
    .product-list-grid[data-view="list"] .product-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .product-list-grid[data-view="list"] .product-price {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* 상품 카드 */
.product-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--bg-white);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-image {
    position: relative;
    padding-bottom: 100%;
    background: var(--bg-light);
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
	/*
    object-fit: cover;*/

    object-fit: contain;  /* 👈 전체 보이기 */
    transition: transform 0.3s;
    background: white;  /* 여백 배경색 */
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.no-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-light);
    font-size: 14px;
}

.badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff4444;
    color: var(--bg-white);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
}

.badge-soldout {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #666;
    color: var(--bg-white);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    color: var(--text-dark);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.original-price {
    color: var(--text-light);
    text-decoration: line-through;
    font-size: 13px;
}

.sale-price,
.price {
    font-size: 17px;
    font-weight: bold;
    color: var(--text-dark);
}

.sale-price {
    color: #ff4444;
}

.discount {
    color: #ff4444;
    font-weight: bold;
    font-size: 14px;
}

/* 페이징 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
}

.page-btn {
    padding: 8px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-gray);
    font-size: 14px;
    transition: all 0.2s;
}

.page-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
}

/* 상품 없음 */
.no-products {
    text-align: center;
    padding: 80px 20px;
}

.no-products p {
    font-size: 18px;
    color: var(--text-light);
}
