/* Catalog Page Styles */

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: bottom;
}

.page-header .container {
    position: relative;
    z-index: 1;
}

.search-box input {
    border-radius: 50px;
    padding-left: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

.search-box input:focus {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    border-color: white;
}

/* Filter Section */
.filter-section {
    background: #f8f9fa;
}

.filter-section h6 {
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.filter-section .form-select {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.filter-section .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.filter-section .btn-group .btn {
    border-radius: 8px;
    padding: 8px 16px;
}

.filter-section .btn-group .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.filter-section .btn-group .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Catalog Product Cards */
.catalog-product-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.catalog-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15) !important;
    border-color: #007bff;
}

.card-img-container {
    position: relative;
    background: #fff;
    padding: 20px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.catalog-product-card:hover .card-img-container img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #007bff;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 10;
    text-transform: uppercase;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.product-badge.bg-success {
    background: #28a745 !important;
}

.product-badge.bg-danger {
    background: #dc3545 !important;
}

/* Brand Label */
.brand-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Product Specs */
.product-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.spec-item {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    color: #666;
    background: #f8f9fa;
    padding: 4px 10px;
    border-radius: 15px;
    border: 1px solid #e0e0e0;
}

.spec-item i {
    margin-right: 4px;
    font-size: 0.7rem;
}

/* Rating */
.rating-small {
    font-size: 0.85rem;
}

.rating-small i {
    font-size: 0.8rem;
}

/* Price Section */
.price-section {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price-tag {
    font-size: 1.25rem;
    font-weight: 700;
    color: #28a745;
}

.old-price {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
}

/* Buttons */
.catalog-product-card .btn {
    font-size: 0.85rem;
    padding: 8px 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.catalog-product-card .btn:hover {
    transform: translateY(-2px);
}

/* List View Styles */
.list-view .product-item {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

.list-view .catalog-product-card {
    display: flex;
    flex-direction: row;
    height: auto;
}

.list-view .card-img-container {
    flex: 0 0 250px;
    height: 200px;
}

.list-view .card-body {
    flex: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 20px;
}

.list-view .card-body > * {
    flex-basis: 100%;
}

.list-view .card-body .mt-auto {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.list-view .d-grid {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
}

.list-view .d-grid .btn {
    flex: 1;
}

/* Animation */
.product-item {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* No Products Message */
#noProducts {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Product Count */
#productCount {
    font-weight: 700;
    color: #007bff;
}

/* Responsive Design */
@media (max-width: 991px) {
    .page-header {
        text-align: center;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .search-box {
        margin-top: 20px;
    }

    .filter-section .col-md-3 {
        margin-bottom: 15px;
    }

    .list-view .card-img-container {
        flex: 0 0 200px;
        height: 180px;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.75rem;
    }

    .page-header .lead {
        font-size: 1rem;
    }

    .card-img-container {
        height: 180px;
        padding: 15px;
    }

    .filter-section h6 {
        font-size: 0.85rem;
    }

    .filter-section .form-select {
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    .catalog-product-card .card-title {
        font-size: 0.95rem;
    }

    .price-tag {
        font-size: 1.1rem;
    }

    .list-view .catalog-product-card {
        flex-direction: column;
    }

    .list-view .card-img-container {
        flex: none;
        width: 100%;
        height: 200px;
    }

    .list-view .card-body {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 30px 0 !important;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header .lead {
        font-size: 0.9rem;
    }

    .filter-section {
        padding: 15px 0 !important;
    }

    .filter-section .btn-group {
        width: 100%;
    }

    .filter-section .btn-group .btn {
        flex: 1;
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    .card-img-container {
        height: 160px;
        padding: 10px;
    }

    .catalog-product-card .card-body {
        padding: 15px;
    }

    .catalog-product-card .card-title {
        font-size: 0.9rem;
    }

    .spec-item {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .price-tag {
        font-size: 1rem;
    }

    .old-price {
        font-size: 0.8rem;
    }

    .catalog-product-card .btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* Loading State */
.products-loading {
    text-align: center;
    padding: 50px;
}

.products-loading::after {
    content: '';
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover Effects */
.catalog-product-card .btn-primary:hover {
    background: #0056b3;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

.catalog-product-card .btn-success:hover {
    background: #1e7e34;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.catalog-product-card .btn-danger:hover {
    background: #c82333;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.catalog-product-card .btn-outline-primary:hover {
    background: #007bff;
    color: white;
}

.catalog-product-card .btn-outline-success:hover {
    background: #28a745;
    color: white;
}

.catalog-product-card .btn-outline-danger:hover {
    background: #dc3545;
    color: white;
}

/* Stagger Animation for Products */
.product-item:nth-child(1) { animation-delay: 0.05s; }
.product-item:nth-child(2) { animation-delay: 0.1s; }
.product-item:nth-child(3) { animation-delay: 0.15s; }
.product-item:nth-child(4) { animation-delay: 0.2s; }
.product-item:nth-child(5) { animation-delay: 0.25s; }
.product-item:nth-child(6) { animation-delay: 0.3s; }
.product-item:nth-child(7) { animation-delay: 0.35s; }
.product-item:nth-child(8) { animation-delay: 0.4s; }
.product-item:nth-child(9) { animation-delay: 0.45s; }
.product-item:nth-child(10) { animation-delay: 0.5s; }
.product-item:nth-child(11) { animation-delay: 0.55s; }
.product-item:nth-child(12) { animation-delay: 0.6s; }

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Print Styles */
@media print {
    .navbar,
    .page-header,
    .filter-section,
    .contact-section,
    .footer-bottom,
    .btn {
        display: none !important;
    }

    .catalog-product-card {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

