/* Products Page Styles */
main {
    padding: 2rem 0;
}

h1 {
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--primary-color);
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filters select {
    padding: 0.8rem 1.2rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filters select:hover {
    border-color: #3498db;
}

.filters select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    padding: 1rem;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    transition: transform 0.3s ease;
    background: #f5f5f5;
}

.product-image-container {
    position: relative;
    overflow: hidden;
}

.share-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
    transform: translateY(-10px);
}

.product-image-container:hover .share-btn {
    opacity: 1;
    transform: translateY(0);
}

.share-btn:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: scale(1.1);
}

.share-btn i {
    font-size: 18px;
    color: #333;
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    font-size: 1.3rem;
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-weight: 600;
}

.product-info .category {
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #27ae60;
}

.decreased {
    font-size: 1.2rem;
    color: #e74c3c;
    text-decoration: none;
    opacity: 1;
}

.discount-badge {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.color-preview {
    display: flex;
    gap: 0.5rem;
    margin: 0.8rem 0;
    flex-wrap: wrap;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-dot.clickable:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.stock-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 15;
}

.stock-badge.in-stock {
    color: #27ae60;
}

.stock-badge.low-stock {
    color: #f39c12;
}

.stock-badge.out-of-stock {
    color: #e74c3c;
}

.btn.add-to-cart {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn.add-to-cart:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.btn.add-to-cart:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.no-products {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: #7f8c8d;
}

.catalog-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 1rem;
    color: #7f8c8d;
}

.catalog-error i {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.catalog-error .retry-products {
    margin-top: 1rem;
    background: var(--primary-color);
    color: white;
}

.products-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    min-height: 46px;
    margin: 2.5rem 0 1rem;
}

.pagination-pages {
    display: flex;
    gap: 0.4rem;
}

.pagination-btn {
    min-width: 42px;
    height: 42px;
    padding: 0 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled),
.pagination-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.pagination-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    font-style: italic;
    color: #777;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 0;
}

.empty-state i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filters {
        flex-direction: column;
    }

    .filters select {
        width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .product-card img {
        height: 200px;
        object-fit: contain;
        background: #f5f5f5;
    }

    .skeleton-product-image {
        height: 200px;
    }

    .product-info {
        padding: 1rem;
    }

    .product-info h3 {
        font-size: 1.1rem;
    }

    .price {
        font-size: 1.3rem;
    }

    .nav-links.active {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        z-index: 1001;
        display: flex !important;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}