/* Category Page Styles */

.category-header {
    margin: 0px 0 0px;
    padding-bottom: 0px;
    border-bottom: 2px solid var(--border-color);
}

.category-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 14px;
}

.subcategories-nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.subcategory-link {
    padding: 10px 20px;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-block;
}

.subcategory-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.1);
}

.subcategory-link.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.subcategory-link.active:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.2);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 18px;
}

/* Filters and Sort */
.category-filters-sort {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.filters-form {
    width: 100%;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.filter-group {
    flex: 0 1 auto;
}

.filter-group.filter-search {
    flex: 1 1 200px;
    min-width: 200px;
}

.filter-group.filter-search input {
    width: 100%;
}

.filter-group:not(.filter-search) {
    flex: 0 0 auto;
    min-width: 140px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0;
}

.filter-group input,
.filter-group select {
    padding: 6px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    background: white;
    color: var(--text-dark);
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    height: 32px;
}

/* Rok od / Rok do w jednym wierszu */
.filter-year-range .filter-year-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-year-range .filter-year-input {
    flex: 1 1 0;
    min-width: 0;
}

.filter-year-range .filter-year-separator {
    font-size: 13px;
    color: var(--text-muted);
    flex: 0 0 auto;
}

.filter-group input:hover,
.filter-group select:hover {
    border-color: #c0c0c0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.filter-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 30px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-filter,
.btn-reset {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    height: 32px;
}

.btn-filter {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
}

.btn-filter:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #3d8b40 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.25);
}

.btn-filter:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(76, 175, 80, 0.15);
}

.btn-reset {
    background: white;
    color: var(--text-dark);
    border: 1.5px solid #e0e0e0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-reset:hover {
    background: #f5f5f5;
    border-color: #c0c0c0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.products-info {
    margin: 15px 0 12px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 500;
}

.products-info strong {
    color: var(--primary-dark);
    font-weight: 700;
}

/* Sort pod licznikiem wyników */
.products-sort {
    margin: 0 0 20px;
    display: flex;
    justify-content: flex-end;
}

.products-sort-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.products-sort-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.products-sort-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-dark);
}

.products-sort-select {
    padding: 8px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    background: #ffffff;
    cursor: pointer;
}

/* Mobile view toggle (1 / 4 kafelki) */
.view-toggle-mobile {
    display: none; /* desktop domyślnie ukryty */
    align-items: center;
    gap: 6px;
}

.view-btn-mobile {
    border: 1.5px solid #e0e0e0;
    background: #ffffff;
    border-radius: 6px;
    padding: 4px 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.view-btn-mobile .view-icon {
    display: grid;
}

.view-btn-mobile .tile {
    width: 6px;
    height: 6px;
    background: #bdbdbd;
    border-radius: 1px;
}

.view-btn-1 .view-icon {
    grid-template-columns: 1fr;
}

.view-btn-1 .tile-full {
    width: 12px;
    height: 12px;
}

.view-btn-4 .view-icon-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
}

.view-btn-mobile.active {
    border-color: #0b538b;
    background: #e3f2fd;
}

.view-btn-mobile.active .tile {
    background: #0b538b;
}

.products-info-error {
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    border-left: 3px solid #f44336;
    color: #c62828;
}

.products-info-error strong {
    color: #d32f2f;
}

/* Pagination */
.pagination-wrapper {
    margin: 40px 0;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-white);
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
}

.pagination-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-light);
}

.pagination-link-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    cursor: default;
}

.pagination-link-active:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    color: var(--text-light);
    font-size: 14px;
}

/* Widok 2 kolumn (4 kafelki) tylko dla kategorii na mobile */
@media (max-width: 768px) {
    body.mobile-grid-2col .machines-grid:not(.products-slider) {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* ============================================
   CATEGORY PAGE MOBILE STYLES
   ============================================ */

@media (max-width: 768px) {
    .category-header {
        margin: 0;
        padding-bottom: 0;
    }

    .category-title {
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .subcategories-nav {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .subcategory-link {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .category-filters-sort {
        margin: 15px 0;
        padding: 12px;
        border-radius: 6px;
    }
    
    .filters-row {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .filter-group {
        width: 100%;
        min-width: 100%;
    }

    .filter-group.filter-search {
        flex: 1 1 100%;
        min-width: 100%;
    }

    /* Rok od / Rok do obok siebie na mobile */
    .filter-year-range .filter-year-range-row {
        display: flex;
        gap: 8px;
    }

    .filter-year-range .filter-year-input {
        font-size: 16px;
        height: 40px;
    }
    
    .filter-group label {
        font-size: 10px;
    }

    .filter-group input,
    .filter-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 8px 10px;
        height: 40px;
    }
    
    .filter-actions {
        width: 100%;
        justify-content: stretch;
        gap: 8px;
        padding-top: 10px;
        margin-top: 8px;
    }
    
    .btn-filter,
    .btn-reset {
        flex: 1;
        height: 40px;
        font-size: 14px;
        padding: 0 16px;
    }

    .products-info {
        margin: 12px 0 6px;
        padding: 10px 12px;
        font-size: 12px;
    }

    .products-sort {
        justify-content: flex-start;
        margin: 0 0 20px;
    }

    .products-sort-inner {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .products-sort-form {
        flex: 1;
        justify-content: flex-start;
    }

    .products-sort-select {
        flex: 0 1 200px;
        font-size: 16px;
        height: 40px;
    }

    .view-toggle-mobile {
        display: inline-flex;
    }
    
    .pagination {
        gap: 4px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination-link {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }

    .pagination-ellipsis {
        min-width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .category-title {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .subcategories-nav {
        gap: 6px;
    }
    
    .subcategory-link {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .category-filters-sort {
        padding: 10px;
        margin: 12px 0;
    }
    
    .filters-row {
        gap: 8px;
    }

    .filter-group input,
    .filter-group select {
        padding: 7px 9px;
        height: 38px;
        font-size: 16px;
    }
    
    .filter-actions {
        gap: 6px;
        padding-top: 8px;
    }
    
    .btn-filter,
    .btn-reset {
        height: 38px;
        font-size: 13px;
        padding: 0 12px;
    }

    .products-info {
        padding: 8px 10px;
        font-size: 11px;
    }

    .products-sort-inner {
        flex-direction: row;
        align-items: center;
    }

    .products-sort-select {
        flex: 1 1 auto;
    }
    
    .pagination {
        gap: 3px;
    }
    
    .pagination-link {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }

    .pagination-ellipsis {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

