/**
 * Products Catalog Styles
 * For Inverters, Batteries, and Panels pages
 */

/* Page Hero */
.page-hero {
    background: linear-gradient(135deg, #0D3B6E 0%, #1565C0 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.page-hero h1 {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    font-weight: 800;
}

.page-hero p {
    font-size: 1.125rem;
    margin: 0;
    opacity: 0.95;
}

/* Products Container */
.products-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

/* Filters Sidebar */
.filters-sidebar {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 90px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #E2E8F0;
}

.filter-header h2 {
    font-size: 1.25rem;
    color: #0D3B6E;
    margin: 0;
}

.btn-clear-filters {
    font-size: 0.875rem;
    color: #EF4444;
    text-decoration: none;
    font-weight: 600;
}

.btn-clear-filters:hover {
    text-decoration: underline;
}

.filter-section {
    margin-bottom: 25px;
}

/* Dual Range Slider */
.range-slider-container {
    margin: 15px 0;
}

.range-slider {
    position: relative;
    height: 6px;
    margin: 30px 0 20px 0;
}

.range-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background: #E2E8F0;
    border-radius: 3px;
}

.range-fill {
    position: absolute;
    height: 6px;
    background: linear-gradient(90deg, #0D3B6E 0%, #1565C0 100%);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.range-input {
    position: absolute;
    width: 100%;
    height: 6px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    top: 0;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #0D3B6E;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.range-input::-webkit-slider-thumb:active {
    transform: scale(1.1);
    background: #0D3B6E;
}

.range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #0D3B6E;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.range-input::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.range-input::-moz-range-thumb:active {
    transform: scale(1.1);
    background: #0D3B6E;
}

.range-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #0D3B6E;
    font-weight: 600;
    margin-top: 10px;
}

.range-values span {
    padding: 5px 10px;
    background: #EFF6FF;
    border-radius: 6px;
}

.filter-label {
    display: block;
    font-weight: 600;
    color: #0D3B6E;
    margin-bottom: 8px;
    font-size: 0.9375rem;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: border-color 0.3s ease;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #1565C0;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-input-small {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    font-size: 0.875rem;
}

.filter-input-small:focus {
    outline: none;
    border-color: #1565C0;
}

.range-inputs span {
    color: #64748B;
    font-size: 0.875rem;
}

.range-hint {
    font-size: 0.75rem;
    color: #64748B;
    margin-top: 5px;
}

.btn-block {
    width: 100%;
}

.compare-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #E2E8F0;
}

.compare-hint {
    font-size: 0.75rem;
    color: #64748B;
    text-align: center;
    margin-top: 8px;
}

/* Products Main */
.products-main {
    min-height: 600px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #E2E8F0;
}

.results-info h2 {
    font-size: 1.5rem;
    color: #0D3B6E;
    margin: 0 0 5px 0;
}

.active-filters {
    font-size: 0.875rem;
    color: #10B981;
    margin: 0;
    font-weight: 600;
}

.results-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-sort label {
    font-weight: 600;
    color: #475569;
    font-size: 0.9375rem;
}

.sort-select {
    padding: 8px 12px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    font-size: 0.9375rem;
    cursor: pointer;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-badge.hybrid {
    background: #D1FAE5;
    color: #065F46;
}

.product-badge.on-grid {
    background: #DBEAFE;
    color: #1E40AF;
}

.product-badge.off-grid {
    background: #FEF3C7;
    color: #92400E;
}

.product-image-placeholder {
    width: 100%;
    height: 180px;
    background: #F8FAFC;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.product-icon {
    font-size: 4rem;
}

.product-company {
    font-size: 0.8125rem;
    color: #64748B;
    margin-bottom: 5px;
    font-weight: 500;
}

.product-name {
    font-size: 1.125rem;
    color: #0D3B6E;
    margin: 0 0 15px 0;
    font-weight: 700;
    min-height: 50px;
}

.product-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.spec-item {
    background: #F8FAFC;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.spec-label {
    display: block;
    font-size: 0.75rem;
    color: #64748B;
    margin-bottom: 3px;
}

.spec-value {
    display: block;
    font-size: 0.9375rem;
    color: #0D3B6E;
    font-weight: 700;
}

.product-price {
    font-size: 1.5rem;
    color: #10B981;
    font-weight: 800;
    margin: 15px 0;
    text-align: center;
}

.product-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 0.875rem;
}

.btn-outline {
    background: white;
    color: #0D3B6E;
    border: 2px solid #0D3B6E;
}

.btn-outline:hover {
    background: #0D3B6E;
    color: white;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 20px;
}

.no-results-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 1.75rem;
    color: #0D3B6E;
    margin-bottom: 10px;
}

.no-results p {
    color: #64748B;
    margin-bottom: 25px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination-btn {
    padding: 10px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    border-color: #0D3B6E;
    color: #0D3B6E;
    background: #F8FAFC;
}

.pagination-btn.active {
    background: #0D3B6E;
    color: white;
    border-color: #0D3B6E;
}

/* Product Detail Page */
.product-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.product-detail-image {
    background: #F8FAFC;
    border-radius: 16px;
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.product-detail-image .product-icon {
    font-size: 10rem;
}

.product-detail-info h1 {
    font-size: 2rem;
    color: #0D3B6E;
    margin-bottom: 10px;
}

.product-detail-company {
    font-size: 1.125rem;
    color: #64748B;
    margin-bottom: 20px;
}

.product-detail-price {
    font-size: 2.5rem;
    color: #10B981;
    font-weight: 800;
    margin-bottom: 30px;
}

.product-detail-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.detail-spec-item {
    background: #F8FAFC;
    padding: 20px;
    border-radius: 12px;
}

.detail-spec-label {
    font-size: 0.875rem;
    color: #64748B;
    margin-bottom: 5px;
}

.detail-spec-value {
    font-size: 1.25rem;
    color: #0D3B6E;
    font-weight: 700;
}

.product-detail-actions {
    display: flex;
    gap: 15px;
}

.product-detail-actions .btn {
    flex: 1;
}

.product-tabs {
    margin-top: 60px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #E2E8F0;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 15px 30px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: #64748B;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #0D3B6E;
    border-bottom-color: #0D3B6E;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.specs-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.specs-table table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table th {
    background: #0D3B6E;
    color: white;
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
}

.specs-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #E2E8F0;
}

.specs-table tr:last-child td {
    border-bottom: none;
}

.specs-table tr:nth-child(even) {
    background: #F8FAFC;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    font-weight: 600;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 4px solid #10B981;
}

.notification-info {
    background: #DBEAFE;
    color: #1E40AF;
    border-left: 4px solid #3B82F6;
}

.notification-warning {
    background: #FEF3C7;
    color: #92400E;
    border-left: 4px solid #F59E0B;
}

.notification-error {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid #EF4444;
}

/* Floating Comparison Widget */
.comparison-widget {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 350px !important;
    background: white !important;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 9999 !important;
    overflow: hidden;
    transition: all 0.3s ease;
    display: none; /* Start hidden by default */
}

.comparison-widget.minimized .widget-body {
    display: none;
}

.widget-header {
    background: linear-gradient(135deg, #0D3B6E 0%, #1565C0 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.widget-title {
    font-weight: 700;
    font-size: 1rem;
}

.widget-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.widget-close:hover {
    background: rgba(255,255,255,0.3);
}

.widget-body {
    padding: 15px;
}

.widget-items {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.widget-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #F8FAFC;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.widget-item:hover {
    background: #EFF6FF;
}

.widget-item-name {
    font-size: 0.875rem;
    color: #0D3B6E;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.widget-item-remove {
    background: #EF4444;
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.125rem;
    line-height: 1;
    flex-shrink: 0;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.widget-item-remove:hover {
    background: #DC2626;
    transform: scale(1.1);
}

.widget-actions {
    display: flex;
    gap: 8px;
}

.widget-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.widget-btn-primary {
    background: #10B981;
    color: white;
}

.widget-btn-primary:hover {
    background: #059669;
    transform: translateY(-2px);
}

.widget-btn-secondary {
    background: #EF4444;
    color: white;
}

.widget-btn-secondary:hover {
    background: #DC2626;
    transform: translateY(-2px);
}

.widget-btn-disabled {
    background: #E2E8F0;
    color: #94A3B8;
    cursor: not-allowed;
}

/* Widget scrollbar */
.widget-items::-webkit-scrollbar {
    width: 6px;
}

.widget-items::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 3px;
}

.widget-items::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

.widget-items::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .products-container {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        position: static;
    }
    
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .page-hero h1 {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .product-detail-specs {
        grid-template-columns: 1fr;
    }
    
    .product-detail-actions {
        flex-direction: column;
    }
    
    .tab-buttons {
        overflow-x: auto;
    }
    
    /* Mobile widget adjustments */
    .comparison-widget {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        bottom: 10px;
    }
    
    .widget-title {
        font-size: 0.875rem;
    }
    
    .widget-item-name {
        font-size: 0.8125rem;
    }
    
    .widget-btn {
        font-size: 0.8125rem;
        padding: 8px 12px;
    }
}
