/* Page Header */
.page-header {
    background: linear-gradient(rgba(33, 27, 30, 0.7), rgba(33, 27, 30, 0.7)), url('../../img/hero-products-2.png');
    background-size: cover;
    background-position: center;
    color: var(--tertiary-color);
    padding: 6rem 0;
    text-align: center;
    /* Fallback background color in case image doesn't load */
    background-color: var(--secondary-color);
    /* Ensure the background is visible even if image fails to load */
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fallback for when image doesn't load */
.page-header.no-image {
    background-image: linear-gradient(rgba(33, 27, 30, 0.8), rgba(33, 27, 30, 0.8)),
                      linear-gradient(135deg, #41beba 0%, #2a8b88 100%);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Product Categories */
.product-categories {
    padding: 2rem 0;
    background-color: var(--light-gray);
    position: sticky;
    top: 80px;
    z-index: 10;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.category-tab {
    background-color: var(--tertiary-color);
    border: 2px solid var(--medium-gray);
    border-radius: 30px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.category-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-tab.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--tertiary-color);
}

/* Products Section */
.products-section {
    padding: 4rem 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background-color: var(--tertiary-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: var(--tertiary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    flex-grow: 1;
}

.product-description {
    color: var(--dark-gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Product price removed - catalog mode */

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-view-details {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    flex: 1;
}

.btn-view-details:hover {
    background-color: var(--primary-color);
    color: var(--tertiary-color);
}

.btn-add-to-cart {
    flex: 1;
}

/* Load More */
.load-more-container {
    text-align: center;
}

/* Product Modal */
.product-modal-content {
    max-width: 800px;
    max-height: 90vh;
}

.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.product-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-product-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Modal product price removed - catalog mode */

.modal-product-description {
    line-height: 1.6;
}

.product-specifications h4 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

#modal-specs-list {
    padding-left: 1.5rem;
}

#modal-specs-list li {
    margin-bottom: 0.25rem;
}

.product-availability h4 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.availability-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.availability-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.availability-item i.available {
    color: var(--success-color);
}

.availability-item i.unavailable {
    color: var(--error-color);
}

.product-quantity {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-quantity label {
    font-weight: 500;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    overflow: hidden;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    background-color: var(--light-gray);
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.quantity-btn:hover {
    background-color: var(--medium-gray);
}

#modal-quantity {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 992px) {
    .product-details {
        grid-template-columns: 1fr;
    }
    
    .product-image-container {
        order: -1;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 4rem 0;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .product-categories {
        position: static;
    }
    
    .category-tabs {
        gap: 0.5rem;
    }
    
    .category-tab {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .modal-product-price {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 3rem 0;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-quantity {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .quantity-selector {
        align-self: flex-start;
    }
}