/* Products Page Styles */

.products-page {
    padding: 2rem 0;
    background: var(--barn-cream);
    min-height: 80vh;
}

.breadcrumbs {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--barn-brown);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: var(--barn-red);
}

.breadcrumbs span {
    color: #666;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title h1 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 2.2rem;
}

.page-title h1 i {
    color: var(--barn-red);
}

.results-count {
    color: var(--barn-brown);
    font-size: 1rem;
    margin: 0;
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 8px 12px;
    border: 2px solid #E0E0E0;
    background: white;
    color: var(--barn-brown);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active,
.view-btn:hover {
    border-color: var(--barn-red);
    background: var(--barn-red);
    color: white;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls label {
    font-weight: 500;
    color: var(--text-dark);
}

.sort-controls select {
    padding: 8px 12px;
    border: 2px solid #E0E0E0;
    border-radius: 5px;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.sort-controls select:focus {
    outline: none;
    border-color: var(--barn-red);
}

.products-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* Sidebar Styles */
.sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 120px;
}

.filter-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #E0E0E0;
}

.filter-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-section h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-section h3 i {
    color: var(--barn-red);
}

.category-filter {
    list-style: none;
    padding: 0;
}

.category-filter li {
    margin-bottom: 0.5rem;
}

.category-filter a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.category-filter a:hover,
.category-filter a.active {
    background: var(--barn-cream);
    border-color: var(--barn-red);
    color: var(--barn-red);
}

.category-filter a i {
    margin-right: 0.75rem;
    width: 16px;
}

.category-filter .count {
    background: #E0E0E0;
    color: var(--text-dark);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.category-filter a.active .count {
    background: var(--barn-red);
    color: white;
}

.price-filter {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-inputs input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #E0E0E0;
    border-radius: 5px;
    font-size: 0.9rem;
}

.price-inputs span {
    color: var(--barn-brown);
    font-weight: 500;
}

.condition-filter {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.filter-checkbox input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1.2);
}

.sidebar-promotion {
    background: linear-gradient(135deg, var(--barn-red), #A0303E);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 1rem;
}

.promo-content h4 {
    margin-bottom: 0.75rem;
    color: white;
    font-size: 1.1rem;
}

.promo-content p {
    margin-bottom: 1rem;
    opacity: 0.9;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Products Grid */
.products-main {
    min-height: 400px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.condition-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.condition-new {
    background: var(--barn-green);
    color: white;
}

.condition-used {
    background: var(--barn-gold);
    color: white;
}

.condition-refurbished {
    background: var(--barn-brown);
    color: white;
}

.featured-badge {
    background: var(--accent-orange);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-info {
    padding: 1.5rem;
}

.product-category {
    color: var(--barn-brown);
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.product-name {
    margin-bottom: 0.75rem;
}

.product-name a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.product-name a:hover {
    color: var(--barn-red);
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--barn-brown);
}

.product-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.product-price {
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--barn-red);
}

.original-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.savings {
    display: block;
    color: var(--barn-green);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.product-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 0.9rem;
    text-align: center;
}

.product-actions .btn:last-child {
    flex: 0 0 auto;
    padding: 10px 12px;
}

/* No Products State */
.no-products {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--barn-brown);
}

.no-products-icon {
    font-size: 4rem;
    color: #E0E0E0;
    margin-bottom: 1.5rem;
}

.no-products h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.no-products p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-btn {
    padding: 10px 15px;
    border: 2px solid #E0E0E0;
    background: white;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-btn:hover,
.page-btn.active {
    border-color: var(--barn-red);
    background: var(--barn-red);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* List View */
.products-grid.list-view {
    grid-template-columns: 1fr;
}

.products-grid.list-view .product-card {
    display: flex;
    height: 200px;
}

.products-grid.list-view .product-image {
    width: 250px;
    height: 100%;
    flex-shrink: 0;
}

.products-grid.list-view .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.products-grid.list-view .product-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .products-content {
        grid-template-columns: 250px 1fr;
        gap: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .products-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
        margin-bottom: 2rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .product-card {
        border-radius: 12px;
    }
    
    .product-image {
        height: 160px;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .products-grid.list-view .product-card {
        flex-direction: column;
        height: auto;
    }
    
    .products-grid.list-view .product-image {
        width: 100%;
        height: 160px;
    }
}

@media (max-width: 480px) {
    .products-page {
        padding: 1rem 0;
    }
    
    .page-title h1 {
        font-size: 1.8rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-section {
        padding-bottom: 1rem;
    }
    
    .sidebar {
        padding: 1rem;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .page-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}
