.products-page {
    width: min(100%, 1600px);
    margin: 0 auto;
    padding: 60px clamp(20px, 5vw, 80px);
}

.products-header {
    text-align: center;
    margin-bottom: 40px;
}

.products-header h1 {
    margin-bottom: 15px;
    color: var(--green-800);
    font-size: clamp(32px, 4vw, 42px);
    line-height: 1.15;
}

.products-header p {
    max-width: 700px;
    margin-inline: auto;
    color: #555;
    font-size: clamp(16px, 2vw, 18px);
    line-height: 1.6;
}

/* Kategorie */
.category-bar {
    width: 100%;
    margin-bottom: 35px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin-inline: auto;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 18px;
    border: 0;
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    color: #333;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.filter-btn i {
    color: var(--green-700);
}

.filter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.filter-btn.active {
    background: var(--green-700);
    color: #fff;
}

.filter-btn.active i {
    color: #fff;
}

/* Układ: filtry + wyniki */
.products-layout {
    display: grid;
    grid-template-columns: minmax(230px, 260px) minmax(0, 1fr);
    gap: 30px;
    align-items: start;
    margin-top: 30px;
}

.products-content {
    min-width: 0;
}

.filters-panel {
    position: sticky;
    top: 20px;
    min-width: 0;
    padding: 25px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.filters-panel h2 {
    margin-bottom: 25px;
    color: var(--green-800);
    font-size: 24px;
}

.filter-box {
    min-width: 0;
    margin-bottom: 25px;
}

.filter-box > label {
    display: block;
    margin-bottom: 10px;
    color: #444;
    font-weight: 600;
}

.filter-box input[type="text"],
.filter-box input[type="number"],
.filter-box select {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.filter-box input:focus,
.filter-box select:focus {
    border-color: var(--green-700);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

.price-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.checkbox {
    display: flex !important;
    align-items: center;
    gap: 10px;
    min-height: 24px;
    margin: 0 !important;
    cursor: pointer;
    font-weight: 400 !important;
}

.checkbox input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
}

.filter-buttons {
    display: grid;
    gap: 10px;
}

.filter-submit,
.filter-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 14px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: transform 0.25s ease, background 0.25s ease;
}

.filter-submit {
    background: var(--green-700);
    color: #fff;
}

.filter-submit:hover {
    background: var(--green-900);
    transform: translateY(-2px);
}

.filter-reset {
    background: #eee;
    color: #444;
}

.filter-reset:hover {
    background: #ddd;
}

/* Siatka produktów */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 25px;
}

.products-page .card {
    display: flex;
    min-width: 0;
    min-height: 470px;
    flex-direction: column;
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.products-page .card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.products-page .card-image {
    position: relative;
    height: clamp(190px, 18vw, 240px);
    overflow: hidden;
    background: #f3f6f1;
}

.products-page .card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.products-page .card:hover .card-image img {
    transform: scale(1.035);
}

.products-page .product-category {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 30px);
    padding: 8px 12px;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
    color: var(--green-900);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.products-page .product-category i {
    flex: 0 0 auto;
    margin-right: 5px;
}

.products-page .card-content {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    padding: 20px;
}

.products-page .card h3 {
    margin-bottom: 12px;
    overflow-wrap: anywhere;
    font-size: 20px;
    line-height: 1.3;
}

.products-page .card h3 a {
    color: #222;
    text-decoration: none;
    transition: color 0.25s ease;
}

.products-page .card h3 a:hover {
    color: var(--green-700);
}

.products-page .description {
    display: -webkit-box;
    overflow: hidden;
    color: #666;
    font-size: 14px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.products-page .product-info {
    display: block;
    margin-top: auto;
}

.products-page .price {
    margin: 15px 0 5px;
    color: var(--green-800);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.products-page .stock {
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
}

.products-page .stock.available {
    color: var(--green-800);
}

.products-page .stock.unavailable {
    color: #d32f2f;
}

.products-page .product-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 15px;
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--green-700);
    color: #fff;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.25s ease, transform 0.25s ease;
}

.products-page .product-button:hover {
    background: var(--green-900);
    transform: translateY(-2px);
}

.no-products {
    display: flex;
    min-height: 350px;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 25px;
    border-radius: 25px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.no-products h2 {
    margin-bottom: 15px;
    color: var(--green-800);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
}

.no-products p {
    max-width: 500px;
    color: #666;
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.6;
}

/* Mniejsze laptopy */
@media (max-width: 1320px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1050px) {
    .products-page {
        padding-inline: 28px;
    }

    .products-layout {
        grid-template-columns: 230px minmax(0, 1fr);
        gap: 22px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

/* Tablet — panel filtrów nad produktami */
@media (max-width: 820px) {
    .products-page {
        padding-top: 42px;
        padding-bottom: 50px;
    }

    .products-header {
        margin-bottom: 28px;
    }

    .category-bar {
        margin-bottom: 24px;
        overflow: hidden;
    }

    .filters {
        flex-wrap: nowrap;
        justify-content: flex-start;
        max-width: none;
        padding: 4px 2px 12px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
        scroll-snap-type: inline proximity;
    }

    .filter-btn {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .products-layout {
        grid-template-columns: 1fr;
        margin-top: 20px;
    }

    .filters-panel {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px 20px;
        padding: 22px;
    }

    .filters-panel h2,
    .filter-buttons {
        grid-column: 1 / -1;
    }

    .filters-panel h2,
    .filter-box {
        margin-bottom: 0;
    }

    .filter-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Telefon */
@media (max-width: 600px) {
    .products-page {
        padding: 32px 16px 42px;
    }

    .products-header h1 {
        font-size: 32px;
    }

    .filters-panel {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 20px 16px;
        border-radius: 16px;
    }

    .filters-panel h2,
    .filter-buttons {
        grid-column: auto;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .products-page .card {
        min-height: 0;
        border-radius: 16px;
    }

    .products-page .card-image {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .products-page .card-content {
        padding: 18px;
    }

    .products-page .description {
        -webkit-line-clamp: 4;
    }

    .products-page .product-button {
        width: 100%;
    }

    .no-products {
        min-height: 260px;
        padding: 35px 18px;
        border-radius: 18px;
    }
}

@media (max-width: 380px) {
    .products-page {
        padding-inline: 12px;
    }

    .price-inputs,
    .filter-buttons {
        grid-template-columns: 1fr;
    }

    .filter-btn {
        padding-inline: 14px;
        font-size: 14px;
    }
}

@media (hover: none) {
    .filter-btn:hover,
    .products-page .card:hover,
    .products-page .card:hover .card-image img,
    .filter-submit:hover,
    .products-page .product-button:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .filter-btn,
    .products-page .card,
    .products-page .card-image img,
    .filter-submit,
    .filter-reset,
    .products-page .product-button {
        transition: none;
    }
}