/* Products Page Styles */

.page-header {
    background: var(--gradient-hero);
    color: var(--white);
    padding: var(--spacing-xxl) 0;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.page-header p {
    font-size: 1.2rem;
    color: var(--white);
    opacity: 1;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
}

.breadcrumb {
    background: var(--bg-gray);
    padding: var(--spacing-sm) 0;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--accent-emerald);
    text-decoration: none;
}

.breadcrumb span {
    color: var(--text-dark);
    font-weight: 500;
}

/* Product Filters */
.product-filters {
    background: var(--white);
    padding: var(--spacing-sx) 0;
    border-bottom: 2px solid var(--light-gray);
    position: sticky;
    top: 80px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.filters-wrapper {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

/* Vertical partition between typed text and search icon */
.search-box::after {
    content: '';
    position: absolute;
    top: 50%;
    right: calc(var(--spacing-md) + 1.15em);
    transform: translateY(-50%);
    width: 1px;
    height: clamp(1.1rem, 55%, 1.85rem);
    background: var(--text-gray);
    pointer-events: none;
}

.search-box i {
    position: absolute;
    right: var(--spacing-sm);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    pointer-events: none;
    line-height: 1;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem var(--spacing-md);
    border: 2px solid var(--light-gray);
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-emerald);
}

.search-box:has(input:focus)::after {
    background: rgba(39, 64, 109, 0.28);
}

.filter-controls {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.filter-select {
    padding: 0.75rem var(--spacing-md);
    border: 2px solid var(--light-gray);
    border-radius: 4px;
    font-size: 1rem;
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-emerald);
}

/* Custom filter dropdowns (category / application) */
.custom-filter-select {
    position: relative;
    min-width: 200px;
    flex: 1;
}

.custom-filter-select__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem var(--spacing-md);
    border: 2px solid var(--light-gray);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--white);
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.custom-filter-select__trigger:hover {
    border-color: rgba(39, 64, 109, 0.35);
}

.custom-filter-select.is-open .custom-filter-select__trigger {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 0 3px rgba(39, 64, 109, 0.12);
}

.custom-filter-select__trigger:focus {
    outline: none;
    border-color: var(--accent-emerald);
}

.custom-filter-select__trigger:focus:not(:focus-visible) {
    box-shadow: none;
}

.custom-filter-select__trigger:focus-visible {
    box-shadow: 0 0 0 3px rgba(39, 64, 109, 0.12);
}

.custom-filter-select__text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-filter-select__caret {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--text-gray);
    transition: transform 0.2s ease;
}

.custom-filter-select.is-open .custom-filter-select__caret {
    transform: rotate(180deg);
    color: var(--accent-emerald);
}

.custom-filter-select__panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 250;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: var(--white);
    border: 2px solid var(--light-gray);
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    max-height: min(320px, 55vh);
    overflow-y: auto;
}

.custom-filter-select__option {
    padding: 0.65rem var(--spacing-md);
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: background 0.15s ease, color 0.15s ease;
}

.custom-filter-select__option:hover,
.custom-filter-select__option:focus {
    background: var(--bg-gray);
    outline: none;
}

.custom-filter-select__option.is-selected {
    background: rgba(39, 64, 109, 0.08);
    color: var(--accent-emerald);
    font-weight: 600;
}

.view-toggle {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--light-gray);
    padding: 4px;
    border-radius: 4px;
}

.view-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-dark);
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn.active,
.view-btn:hover {
    background: var(--accent-emerald);
    color: var(--white);
}

/* Products Section */
.products-section {
    padding: var(--spacing-lg) 0;
    background: var(--bg-gray);
    overflow: visible;
    position: relative;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.products-header h2 {
    color: var(--primary-emerald);
    font-size: 2rem;
}

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

.product-category {
    margin-bottom: var(--spacing-xxl);
    padding: var(--spacing-xl);
    background: var(--white);
    border-radius: 8px;
    overflow: visible;
    position: relative;
}

/* Hash / nav scroll: keep category title below sticky header + .product-filters (see .product-filters top) */
.product-category[id] {
    scroll-margin-top: calc(5rem + 10.5rem);
}

#catalog {
    scroll-margin-top: calc(5rem + 10.5rem);
}

.category-title {
    color: var(--primary-emerald);
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 3px solid var(--accent-blue);
}

.category-description {
    color: var(--text-dark);
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Products Grid & List Views */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    position: relative;
    overflow: visible;
}

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

.products-grid.list-view .product-card {
    display: flex;
    flex-direction: row;
    max-width: 100%;
    overflow: visible;
}

.products-grid.list-view .product-image {
    width: 250px;
    height: 200px;
    flex-shrink: 0;
}

.products-grid.list-view .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card {
    background: var(--white);
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    overflow: visible;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.product-card:hover {
    border-color: var(--accent-emerald);
    box-shadow: var(--shadow-hover-md);
    transform: translateY(-5px);
    z-index: 10;
}

.product-image {
    width: 100%;
    height: 200px;
    background: var(--bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-emerald);
    font-size: 3rem;
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.product-image .product-img-default {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.product-image .product-img-hover {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.product-card:hover .product-image .product-img-hover {
    opacity: 1;
}

.product-image.product-image-clickable {
    cursor: pointer;
}

.product-info {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.product-info h3 {
    color: var(--primary-emerald);
    margin-bottom: var(--spacing-xs);
    font-size: 1.2rem;
}

.product-part-number {
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-primary, 'Montserrat', sans-serif);
}

.product-category-tag {
    display: inline-block;
    background: var(--bg-gray);
    color: var(--accent-emerald);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

.product-description {
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xs);
    line-height: 1.6;
    flex: 1;
}

.product-description-list {
    margin: 0 0 var(--spacing-xs);
    padding-left: 1.1rem;
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.5;
}

.product-description-list li {
    margin-bottom: 0.15rem;
}

.product-specs {
    margin-bottom: var(--spacing-md);
    font-size: 0.85rem;
    color: var(--text-dark);
}

.product-specs li {
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.product-specs i {
    color: var(--accent-emerald);
    font-size: 0.75rem;
}

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

.product-actions .btn {
    flex: 1;
    padding: 0.75rem;
    font-size: 0.9rem;
    text-align: center;
}

/* No Results */
.no-results {
    text-align: center;
    padding: var(--spacing-xxl);
    color: var(--text-dark);
}

.no-results i {
    font-size: 4rem;
    color: var(--light-gray);
    margin-bottom: var(--spacing-md);
}

.no-results h3 {
    color: var(--primary-emerald);
    margin-bottom: var(--spacing-sm);
}

/* Responsive */
@media (max-width: 768px) {
    .product-filters {
        top: 120px;
    }

    .product-category[id] {
        scroll-margin-top: calc(7.5rem + 15rem);
    }
    
    .filters-wrapper {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
        min-width: auto;
    }
    
    .filter-controls {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .filter-select,
    .custom-filter-select {
        flex: 1;
        min-width: 150px;
        width: 100%;
    }
    
    .products-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .products-grid.list-view .product-card {
        flex-direction: column;
    }
    
    .products-grid.list-view .product-image {
        width: 100%;
    }
}

