/* Products Page Specific Styles */

/* Products Hero */
.products-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem 0;
    color: white;
    text-align: center;
}

.products-hero h1 {
    color: white;
    margin-bottom: 0.5rem;
}

.products-hero p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* Search Bar */
.search-bar {
    max-width: 600px;
    margin: 0 auto;
}

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

.search-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1rem;
    color: var(--text-dark);
}

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

.search-form button {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-form button:hover {
    background: var(--primary-dark);
}

/* Products Content */
.products-content {
    padding: 3rem 0;
    background: var(--bg-light);
    min-height: 60vh;
}

.products-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* Filters Sidebar */
.filters-sidebar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 1rem;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.filters-header h3 {
    font-size: 1.25rem;
    margin: 0;
}

.clear-filters {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    cursor: pointer;
    font-weight: 500;
}

.clear-filters:hover {
    text-decoration: underline;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 2rem;
}

.filter-section h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

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

.filter-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-gray);
    transition: color 0.3s ease;
}

.filter-label:hover {
    color: var(--text-dark);
}

.filter-label input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-label span {
    flex: 1;
}

/* Price Range Filter */
.price-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.price-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.price-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-apply-price {
    width: 100%;
    padding: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.btn-apply-price:hover {
    background: var(--primary-dark);
}

/* Products Main */
.products-main {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.results-count {
    font-weight: 600;
    color: var(--text-dark);
}

.results-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* View Options */
.view-options {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-light);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
}

.view-options button {
    padding: 0.5rem;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-gray);
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
}

.view-options button.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.view-options button:hover {
    color: var(--primary-color);
}

/* Sort Select */
.sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    background: white;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

/* List View */
.products-grid.list-view {
    grid-template-columns: 1fr;
}

.products-grid.list-view .product-item {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.products-grid.list-view .product-image {
    height: 150px;
}

/* Product Item */
.product-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.product-item a {
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Product Image */
.product-image {
    position: relative;
    height: 200px;
    background: var(--bg-light);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform 0.3s ease;
}

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

/* Product Badge */
.product-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: #28a745;
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.product-badge.badge-order {
    background: #ff6b35;
}

/* Product Info */
.product-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-manufacturer {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: var(--text-dark);
}

.product-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.product-specs span {
    padding: 0.25rem 0.5rem;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-gray);
}

.product-price {
    margin-top: auto;
}

.price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Add to Quote Button */
.btn-add-quote {
    width: 100%;
    padding: 0.75rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-add-quote:hover {
    background: #ff5722;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.page-prev,
.page-next {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-prev:hover:not(:disabled),
.page-next:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-prev:disabled,
.page-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-num:hover,
.page-num.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-dots {
    color: var(--text-gray);
    padding: 0 0.5rem;
}

/* Quote Cart (Floating) */
.quote-cart {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    z-index: 100;
    min-width: 200px;
    display: none; /* Hidden by default, shown when items added */
}

.quote-cart.has-items {
    display: block;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cart-title {
    font-weight: 600;
    color: var(--text-dark);
}

.cart-count {
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-view-cart {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-view-cart:hover {
    background: var(--primary-dark);
}

/* Search Results */
.search-results {
    margin-top: 2rem;
}

.no-results {
    text-align: center;
    padding: 3rem;
}

.no-results p {
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.results-list {
    display: grid;
    gap: 1rem;
}

.result-item {
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.result-item h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.result-item p {
    color: var(--text-gray);
    line-height: 1.6;
}

.result-item mark {
    background: yellow;
    padding: 0 2px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .products-layout {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: static;
        margin-bottom: 2rem;
    }

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

@media (max-width: 768px) {
    .products-hero {
        padding: 2rem 0;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .results-controls {
        width: 100%;
        justify-content: space-between;
    }

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

    .product-info {
        padding: 0.75rem;
    }

    .product-name {
        font-size: 0.9rem;
    }

    .price {
        font-size: 1.1rem;
    }

    .quote-cart {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .page-numbers {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .search-form {
        flex-direction: column;
    }

    .search-form button {
        padding: 0.75rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .filter-section {
        margin-bottom: 1.5rem;
    }

    .view-options {
        display: none;
    }
}