/* 
   BuyItForLife UK - Products Page Stylesheet
   Styles specific to the product search and listing functionality
*/

/* ===== PRODUCT HERO SECTION ===== */
.product-hero {
    background-color: var(--primary-dark);
    color: white;
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.product-hero h1 {
    color: white;
    margin-bottom: var(--spacing-sm);
}

.product-hero p {
    max-width: 800px;
    margin: 0 auto var(--spacing-md);
}

.search-container {
    max-width: 700px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    background-color: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.search-box input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
}

.search-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: var(--primary-dark);
}

/* ===== PRODUCT CATEGORIES SECTION ===== */
.product-categories {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-xl);
}

.category-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.category-tab {
    background: none;
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 0.6rem 1.2rem;
    font-family: var(--heading-font);
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-tab:hover {
    background-color: var(--primary-light);
    color: white;
}

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

/* ===== FILTER & SORT ===== */
.filter-sort-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.filter-container {
    position: relative;
}

.filter-btn {
    background-color: var(--background-alt);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-family: var(--heading-font);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 300px;
    background-color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-md);
    z-index: 100;
    margin-top: 0.5rem;
    display: none;
}

.filter-container:hover .filter-dropdown {
    display: block;
}

.filter-group {
    margin-bottom: var(--spacing-sm);
}

.filter-group h3 {
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.filter-actions {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.sort-container select {
    padding: 0.6rem 1.2rem;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-family: var(--body-font);
    background-color: white;
    cursor: pointer;
}

/* ===== PRODUCT GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.product-card {
    background-color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
}

.product-badge.best-price {
    background-color: var(--accent);
    color: white;
}

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

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

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

.product-details {
    padding: var(--spacing-sm);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.product-brand {
    color: var(--text-medium);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xs);
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--spacing-sm);
}

.feature {
    background-color: var(--background-alt);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.product-price-container {
    margin-top: auto;
    margin-bottom: var(--spacing-sm);
}

.price-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.current-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.original-price {
    text-decoration: line-through;
    color: var(--text-medium);
    font-size: 0.9rem;
}

.discount {
    color: var(--error);
    font-weight: 600;
    font-size: 0.9rem;
}

.retailer {
    font-size: 0.8rem;
    color: var(--text-medium);
}

.view-deal-btn {
    width: 100%;
    border-radius: 0;
    padding: 0.8rem;
    text-align: center;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.pagination-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

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

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
}

/* ===== DISCLAIMER ===== */
.price-disclaimer {
    background-color: var(--background-alt);
    padding: var(--spacing-md) 0;
}

.disclaimer-box {
    background-color: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--secondary);
}

.disclaimer-box h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-dark);
    margin-bottom: var(--spacing-xs);
}

.disclaimer-box p {
    font-size: 0.9rem;
    color: var(--text-medium);
}

.disclaimer-box p:last-child {
    margin-bottom: 0;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    .filter-sort-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-dropdown {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 576px) {
    .category-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
}
