/* ========================================
   Products Overview Page - Premium Design System
   Version 1.0 - Strukturiert & Professionell
======================================== */

/* ========================================
   1. PAGE LAYOUT
======================================== */
.products-overview-page {
    padding-top: 64px;
    /* Höhe der Navbar */
    background: #fff;
    min-height: 100vh;
}

.products-overview-page .container {
    max-width: 1400px;
    padding-bottom: var(--space-3xl);
}

/* ========================================
   2. PRODUCTS HERO
======================================== */
.products-hero {
    position: relative;
    padding: 40px 0 50px;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 50%, #fff 100%);
    overflow: hidden;
    width: 100%;
    margin-bottom: var(--space-2xl);
    border-bottom: 1px solid var(--gray-100);
}

.products-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(ellipse, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.products-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.products-hero-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Title */
.products-hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.1;
    margin-bottom: var(--space-md);
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: -0.5px;
}

/* Hero Subtitle */
.products-hero-subtitle {
    font-size: 1.15rem;
    color: var(--gray-600);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto var(--space-lg);
}

/* Products Count Badge */
.products-count-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: white;
    padding: 10px 20px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
}

.count-number {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: var(--primary-600);
}

.count-text {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-600);
}

/* ========================================
   3. PRODUCTS LAYOUT (Sidebar + Main)
======================================== */
.products-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
    align-items: start;
}

@media (max-width: 1024px) {
    .products-layout {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
}

/* ========================================
   4. SIDEBAR FILTERS
======================================== */
.products-sidebar {
    position: relative;
    top: auto;
}

.mobile-filter-trigger {
    display: none;
    width: 100%;
    padding: 14px 20px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.mobile-filter-trigger:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
}

.sidebar-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--gray-100);
}

/* Filter Sections */
.filter-section {
    margin-bottom: var(--space-md);
    padding: var(--space-sm);
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-100);
    transition: all var(--transition-base);
}

.filter-section:hover {
    border-color: var(--primary-200);
    box-shadow: var(--shadow-sm);
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--gray-500);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.filter-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--primary-500);
    border-radius: 2px;
}

/* Filter Options */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

/* Scrollable Options */
.filter-options.scrollable-options {
    max-height: 160px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom Scrollbar for Filter Options */
.filter-options.scrollable-options::-webkit-scrollbar {
    width: 6px;
}

.filter-options.scrollable-options::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

.filter-options.scrollable-options::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.filter-options.scrollable-options::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.filter-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.filter-option:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--gray-300);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.filter-option input[type="checkbox"]:checked {
    background-color: var(--primary-500);
    border-color: var(--primary-500);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.filter-option input[type="checkbox"]:checked+.filter-label {
    color: var(--primary-700);
    font-weight: 600;
}

.filter-label {
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-fast);
}

.filter-unit {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 500;
}

/* Special styling for Functions section */
.filter-section.functions-section {
    background: var(--primary-50);
    border-color: var(--primary-100);
}

.filter-section.functions-section .filter-title {
    color: var(--primary-700);
    border-bottom-color: var(--primary-200);
}

.filter-section.functions-section .filter-title::before {
    content: '';
    background: var(--primary-600);
}

.filter-section.functions-section .filter-option {
    background: rgba(255, 255, 255, 0.9);
}

.filter-section.functions-section .filter-option:hover {
    background: var(--primary-100);
    border-color: var(--primary-300);
}

.filter-section.functions-section .filter-option input[type="checkbox"]:checked {
    background-color: var(--primary-600);
    border-color: var(--primary-600);
}

.filter-section.functions-section .filter-option input[type="checkbox"]:checked+.filter-label {
    color: var(--primary-800);
}

/* Price Range */
.price-range {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.range-inputs input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--gray-700);
}

.range-inputs input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.range-separator {
    color: var(--gray-400);
    font-weight: 500;
}

.btn-filter-apply {
    padding: 8px 16px;
    background: var(--primary-600);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-filter-apply:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
}

/* Sort Select */
.sort-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--gray-700);
    background: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

/* Filter Actions */
.filter-actions {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-100);
}

.btn-filter-reset {
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-filter-reset:hover {
    background: var(--gray-50);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

/* ========================================
   5. PRODUCTS MAIN AREA
======================================== */
.products-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    align-items: stretch;
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Product Card (von index.php übernommen und angepasst) */
.product-card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-base);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

/* Card Badge - Subtle Design */
.card-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-md);
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.badge-gold {
    background: #fff;
    color: #b45309;
    border: 1.5px solid #fde68a;
}

.badge-blue {
    background: #fff;
    color: var(--primary-700);
    border: 1.5px solid var(--primary-200);
}

.badge-green {
    background: #fff;
    color: #047857;
    border: 1.5px solid #a7f3d0;
}

.badge-icon {
    font-size: 12px;
}

/* Card Image */
.card-image-link {
    display: block;
    overflow: hidden;
}

.card-image {
    position: relative;
    padding-top: 66.67%;
    /* 3:2 Aspect Ratio */
    background: #fff;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: var(--space-lg);
    transition: transform var(--transition-base);
}

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

/* Card Content */
.card-content {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-category {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title-link {
    text-decoration: none;
    color: inherit;
}

.card-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 0 var(--space-sm) 0;
    line-height: 1.3;
    transition: color var(--transition-fast);
}

.card-title-link:hover .card-title {
    color: var(--primary-600);
}

.card-description {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    line-height: 1.5;
    margin: 0 0 var(--space-md) 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Rating */
.card-rating {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.rating-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.rating-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    border-radius: 3px;
    transition: width var(--transition-base);
}

.rating-value {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-700);
    min-width: 60px;
    text-align: right;
}

/* Card Features */
.card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-md);
}

.feature {
    display: inline-block;
    padding: 3px 6px;
    background: var(--gray-50);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    color: var(--gray-600);
    border: 1px solid var(--gray-100);
    white-space: nowrap;
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-100);
    margin-top: auto;
}

.card-price {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: var(--gray-900);
}

.btn-small {
    padding: 8px 16px;
    background: var(--primary-500);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-small:hover {
    background: var(--primary-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* No Products Message */
.no-products-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-2xl);
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-100);
}

.no-products-message p {
    color: var(--gray-500);
    font-size: var(--font-size-base);
    margin: 0;
}

/* ========================================
   6. PAGINATION
======================================== */
.products-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-100);
}

.pagination-btn {
    padding: 10px 20px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--gray-200);
    color: var(--gray-800);
}

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

.pagination-info {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    font-weight: 500;
}

/* ========================================
   7. RESPONSIVE ADJUSTMENTS
======================================== */
@media (max-width: 1024px) {
    .mobile-filter-trigger {
        display: flex;
    }

    .products-sidebar .sidebar-card {
        display: none;
        animation: fadeIn 0.3s ease-out;
    }

    .products-sidebar.active .sidebar-card {
        display: block;
    }

    .products-sidebar {
        position: static;
        margin-bottom: var(--space-lg);
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

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

    .products-hero-title {
        font-size: 1.75rem;
    }

    .products-hero-subtitle {
        font-size: 1rem;
    }

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

    .products-pagination {
        flex-direction: column;
        gap: var(--space-md);
    }
}

@media (max-width: 480px) {
    .products-hero-title {
        font-size: 1.5rem;
    }

    .products-count-badge {
        flex-direction: column;
        gap: 4px;
        padding: 8px 16px;
    }

    .card-footer {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: stretch;
    }

    .btn-small {
        width: 100%;
        text-align: center;
    }
}