/* Global Styles */
body {
    background-color: #f8f9fa;
    color: #333333;
    font-family: 'Roboto', sans-serif;
}

/* Loading Spinner Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-button {
    position: relative;
    overflow: hidden;
}

.loading-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.loading-button .loading-spinner-small {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.loading-button.loading .loading-spinner-small {
    display: block;
}

.loading-button.loading .btn-text {
    opacity: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Navigation Bar Styles */
.navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    max-height: 40px;
}

.navbar-dark .navbar-nav .nav-link {
    color: #333333;
    font-weight: 500;
    transition: color 0.3s;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #0d6efd;
}

/* Footer Styles */
footer {
    background-color: #000000;
    color: #f5f5f5;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-logo img {
    max-height: 60px;
    margin-bottom: 1rem;
}

/* Product Card Styles */
.product-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #e9ecef;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-card:hover .product-description {
    opacity: 1;
    visibility: visible;
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.product-card .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.product-card .card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-description {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    background-color: rgba(255, 255, 255, 0.95);
    position: absolute;
    top: 200px;
    left: 0;
    right: 0;
    padding: 1rem;
    z-index: 10;
    border-top: 1px solid #e9ecef;
}

.description-text {
    color: #6c757d;
    margin-bottom: 0;
    max-height: 100px;
    overflow-y: auto;
}

.product-card .price {
    font-weight: 700;
    color: #0d6efd;
    font-size: 1.2rem;
}

.category-badge {
    background-color: #f8f9fa;
    color: #6c757d;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #e9ecef;
}

/* Product Detail Page Styles */
.product-detail-img {
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.product-image-container {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-container:hover .product-detail-img {
    transform: scale(1.5);
}

.product-thumbnail {
    cursor: pointer;
    height: 80px;
    width: 80px;
    object-fit: cover;
    transition: all 0.2s ease-in-out;
    border: 2px solid transparent;
    margin: 0 5px;
}

.product-thumbnail:hover {
    border: 2px solid #0d6efd;
    transform: scale(1.05);
}

.product-thumbnail.active {
    border: 2px solid #0d6efd;
    box-shadow: 0 0 5px rgba(13, 110, 253, 0.5);
}

.product-thumbnails {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.carousel-item {
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.carousel-control-prev, .carousel-control-next {
    transition: opacity 0.3s ease;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    top: 50%;
    transform: translateY(-50%);
}

.carousel-control-prev:hover, .carousel-control-next:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.product-detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #212529;
}

.product-detail-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: 1.5rem;
}

.product-detail-description {
    margin-bottom: 2rem;
}

/* Search Box Styles */
.search-container {
    margin-bottom: 2rem;
}

.search-input {
    background-color: #1e1e1e;
    border: 1px solid #333;
    color: #f5f5f5;
}

.search-input:focus {
    background-color: #2a2a2a;
    color: #f5f5f5;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Filter Styles */
.filter-container {
    margin-bottom: 2rem;
}

.filter-btn {
    background-color: #1e1e1e;
    border: 1px solid #333;
    color: #f5f5f5;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.filter-btn:hover, .filter-btn.active {
    background-color: #007bff;
    border-color: #007bff;
}

/* Pagination Styles */
.pagination .page-link {
    background-color: #1e1e1e;
    border-color: #333;
    color: #f5f5f5;
}

.pagination .page-link:hover {
    background-color: #2a2a2a;
    border-color: #333;
    color: #f5f5f5;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* Placeholder Image Styles */
.placeholder-img {
    background-color: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaaaaa;
    font-size: 1.5rem;
}

/* Loading Animation */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

/* Responsive Adjustments */
@media (max-width: 767.98px) {
    .product-card .card-img-top {
        height: 150px;
    }
    
    .product-detail-img {
        max-height: 300px;
    }
}

/* 缩略图容器样式 */
.thumbnail-item {
    padding: 5px;
    transition: all 0.3s ease;
}