/* products.css */
.products-container {
    max-width: 1200px;
    margin: 80px auto 40px;
    padding: 0 20px;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.products-wrapper {
    position: relative;
    min-height: 200px;
}

.page-title {
    font-size: 2rem;
    color: #1a1a1a;
    font-weight: 600;
}

/* 검색 컨테이너 스타일 */
.search-container {
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-bar {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px 12px;
    gap: 8px;
}

#searchInput {
    border: none;
    background: none;
    padding: 8px;
    width: 200px;
    font-size: 0.95rem;
    color: #1a1a1a;
}

#searchInput:focus {
    outline: none;
}

.search-button {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
}

.search-button:hover {
    color: #2563eb;
}

/* 컨트롤 영역 스타일 */
.controls-wrapper {
    display: flex;
    gap: 16px;
    align-items: center;
}

.items-per-page {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f3f4f6;
    color: #4b5563;
    cursor: pointer;
    min-width: 120px;
}

.items-per-page:focus {
    outline: none;
    border-color: #2563eb;
}

/* 뷰 컨트롤 스타일 */
.view-controls {
    display: flex;
    gap: 8px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}

.view-toggle {
    border: none;
    background: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.view-toggle.active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 그리드 뷰 스타일 */
.products-wrapper.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

/* 리스트 뷰 스타일 */
.products-wrapper.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.products-wrapper.list-view .product-card {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 24px;
}

.products-wrapper.list-view .product-image {
    width: 120px;
    height: 90px;
    flex-shrink: 0;
    display: block;
}

.products-wrapper.list-view .product-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.products-wrapper.list-view .product-details {
    flex: 1;
}

.products-wrapper.list-view .product-footer {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* 상품 카드 공통 스타일 */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
}

.product-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-status {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-card:hover .product-status {
    opacity: 1;
}

.product-status.available {
    background-color: #dcfce7;
    color: #166534;
}

.product-status.rented {
    background-color: #fee2e2;
    color: #991b1b;
}

.product-status.sold {
    background-color: #e5e7eb;
    color: #1f2937;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 1.1rem;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-weight: 600;
}

.product-description {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2563eb;
}

.rental-count {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    font-size: 0.9rem;
}

.rental-count .material-icons {
    font-size: 16px;
}

/* 페이지네이션 스타일 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
}

.page-button {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background-color: white;
    border-radius: 6px;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.page-button:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.page-button:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 8px;
}

.page-number {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    color: #475569;
    background-color: white;
}

.page-number.active {
    background-color: #2563eb;
    color: white;
    border-color: #2563eb;
}
/* 빈 상태 스타일 */
.no-products {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 60px 0;
    color: #6b7280;
    width: 100%;
}

.no-products .material-icons {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

.reset-search {
    display: inline-block;
    margin-top: 16px;
    padding: 8px 16px;
    background-color: #f3f4f6;
    color: #4b5563;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.reset-search:hover {
    background-color: #e5e7eb;
    color: #2563eb;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .products-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .search-container {
        width: 100%;
        flex-direction: column;
    }

    .search-bar {
        width: 100%;
    }

    #searchInput {
        width: 100%;
    }

    .products-wrapper.grid-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .products-wrapper.list-view .product-card {
        flex-direction: column;
        align-items: stretch;
    }

    .products-wrapper.list-view .product-image {
        width: 100%;
        height: auto;
        aspect-ratio: 4/3;
    }

    .products-wrapper.list-view .product-info {
        flex-direction: column;
        gap: 16px;
    }

    .products-wrapper.list-view .product-footer {
        justify-content: space-between;
    }

    .controls-wrapper {
        width: 100%;
        justify-content: space-between;
    }

    .product-card {
        min-width: 0;
    }

    .product-title {
        font-size: 1rem;
    }

    .product-description {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .page-numbers {
        gap: 4px;
    }

    .page-number {
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    .page-button {
        padding: 6px 12px;
    }
}