/* Pasek nad listą produktów: wyszukiwarka + sortowanie; pusty wynik */
.pt-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 28px;
    font-family: 'Gilroy', sans-serif;
}

.pt-bar *,
.pt-filters *,
.pt-empty * {
    letter-spacing: normal;
}

/* ---------- Wyszukiwarka ---------- */
.pt-search {
    position: relative;
    flex: 1 1 200px;
    max-width: 340px;
    margin: 0;
}

.pt-search .fa-search {
    position: absolute;
    top: 50%;
    left: 12px;
    color: #9a9a9a;
    font-size: 12px;
    transform: translateY(-50%);
    pointer-events: none;
}

.pt-bar #search-text {
    width: 100%;
    height: 32px;
    padding: 0 34px 0 32px;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    background: #fff;
    box-shadow: none;
    color: #1e1e1e;
    font-family: 'Gilroy', sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: border-color .15s ease, background-color .15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.pt-bar #search-text::placeholder {
    color: #9a9a9a;
}

/* Własny przycisk czyszczenia zamiast przeglądarkowego */
.pt-bar #search-text::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.pt-bar #search-text:hover,
.pt-bar #pt-order:hover {
    border-color: #c8c8c8;
}

.pt-bar #search-text:focus {
    border-color: #1e1e1e;
    outline: none;
}

.pt-bar .pt-clear {
    position: absolute;
    top: 50%;
    right: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f0f0f0;
    color: #1e1e1e;
    font-size: 15px;
    line-height: 1;
    transform: translateY(-50%);
    cursor: pointer;
}

.pt-bar .pt-clear:hover {
    background: #e2e2e2;
}

/* Podpowiedź skrótu "/" - tylko na komputerze i gdy pole jest puste i nieaktywne */
.pt-kbd {
    position: absolute;
    top: 50%;
    right: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
    color: #9a9a9a;
    font-family: 'Gilroy', sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    transform: translateY(-50%);
    pointer-events: none;
}

.pt-search:focus-within .pt-kbd,
.pt-search #search-text:not(:placeholder-shown) ~ .pt-kbd {
    display: none;
}

@media (hover: none), (max-width: 991px) {
    .pt-kbd {
        display: none;
    }
}

/* ---------- Sortowanie ---------- */
.pt-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 0 auto;
    font-weight: 500;
}

.pt-sort-label {
    color: #6b6b6b;
    font-size: 13px;
    white-space: nowrap;
}

.pt-bar #pt-order {
    height: 32px;
    padding: 0 32px 0 14px;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231e1e1e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 10px 7px;
    box-shadow: none;
    color: #1e1e1e;
    font-family: 'Gilroy', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.pt-bar #pt-order:focus {
    outline: none;
}

.pt-bar #pt-order:focus-visible {
    border-color: #1e1e1e;
}

/* ---------- Filtry: cena, promocje, cały sklep (w tym samym wierszu co wyszukiwarka) ---------- */
.pt-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    font-family: 'Gilroy', sans-serif;
}

.pt-price {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    background: #fff;
    transition: border-color .15s ease;
}

.pt-price:hover {
    border-color: #c8c8c8;
}

.pt-price:focus-within {
    border-color: #1e1e1e;
}

.pt-filter-label {
    margin-right: 2px;
    color: #6b6b6b;
    font-size: 13px;
    font-weight: 500;
}

.pt-filters .pt-price-input {
    width: 46px;
    height: 24px;
    padding: 0 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #1e1e1e;
    font-family: 'Gilroy', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.pt-filters .pt-price-input::-webkit-outer-spin-button,
.pt-filters .pt-price-input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.pt-filters .pt-price-input::placeholder {
    color: #9a9a9a;
    font-weight: 500;
}

.pt-filters .pt-price-input:focus {
    outline: none; /* aktywne pole wyróżnia ramka całej kontrolki ceny */
}

.pt-price-sep,
.pt-price-cur {
    color: #9a9a9a;
    font-size: 13px;
}

/* Ptaszek zatwierdzający cenę; wyróżniony, gdy wpisana cena nie jest jeszcze zastosowana */
.pt-price {
    padding-right: 4px;
}

.pt-filters .pt-price-apply {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 2px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f0f0f0;
    color: #6b6b6b;
    font-size: 11px;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.pt-filters .pt-price-apply:hover,
.pt-price.is-dirty .pt-price-apply {
    background: #1e1e1e;
    color: #fff;
}

.pt-price.is-dirty .pt-price-apply:hover {
    background: #CD0000;
}

.pt-filters .pt-price-apply:focus-visible {
    outline: 2px solid #CD0000;
    outline-offset: 2px;
}

/* Przełącznik w kształcie pigułki (checkbox schowany, ale dostępny z klawiatury) */
.pt-chip {
    position: relative;
    display: inline-flex;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font-family: 'Gilroy', sans-serif;
    cursor: pointer;
}

.pt-chip input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}

.pt-chip > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    background: #fff;
    color: #1e1e1e;
    font-size: 13px;
    font-weight: 600;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.pt-chip > span .fa {
    color: #CD0000;
    font-size: 12px;
}

.pt-chip:hover > span {
    border-color: #c8c8c8;
}

.pt-chip input:checked + span,
.pt-chip--on > span {
    border-color: #1e1e1e;
    background: #1e1e1e;
    color: #fff;
}

.pt-chip input:checked + span .fa {
    color: #fff;
}

.pt-chip input:focus-visible + span,
.pt-chip:focus-visible > span {
    outline: 2px solid #CD0000;
    outline-offset: 2px;
}

.pt-chip:focus {
    outline: none;
}

.pt-chip-x {
    margin-left: 2px;
    font-size: 15px;
    line-height: 1;
    opacity: .75;
}

/* Link "Wyczyść filtry" (na pasku i pod pustym wynikiem); przyciski b-btn z klasą pt-reset mają własny wygląd */
.pt-filters .pt-reset,
.pt-empty .pt-empty-link {
    padding: 0 4px;
    border: 0;
    background: none;
    color: #6b6b6b;
    font-family: 'Gilroy', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.pt-filters .pt-reset:hover,
.pt-empty .pt-empty-link:hover {
    color: #CD0000;
}

/* ---------- Brak wyników ---------- */
.pt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Na pełną wysokość kolumny produktów, jak pierścień pierwszego wczytania */
    min-height: max(360px, calc(100vh - 240px));
    padding: 56px 24px 52px;
    border: 1px dashed #dcdcdc;
    border-radius: 16px;
    background: #fff;
    font-family: 'Gilroy', sans-serif;
    text-align: center;
}

.pt-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: #fdf1f1;
    color: #CD0000;
    font-size: 24px;
}

.pt-empty .pt-empty-title {
    max-width: 520px;
    margin: 0 0 8px;
    color: #1e1e1e;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.pt-empty .pt-empty-title strong {
    color: #CD0000;
    font-weight: 700;
    word-break: break-word;
}

.pt-empty .pt-empty-hint {
    max-width: 460px;
    margin: 0;
    color: #6b6b6b;
    font-size: 15px;
    line-height: 1.5;
}

.pt-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.pt-empty-actions .b-btn .fa {
    margin-right: 2px;
}

.pt-empty .pt-empty-link {
    margin-top: 14px;
}

/* ---------- Telefon ---------- */
@media (max-width: 767px) {
    .pt-bar {
        margin-bottom: 20px;
    }

    .pt-empty {
        min-height: max(320px, calc(100vh - 320px));
        padding: 40px 18px 36px;
    }

    .pt-empty .pt-empty-title {
        font-size: 18px;
    }

    .pt-search {
        flex-basis: 100%;
        max-width: none;
    }

    .pt-sort {
        flex: 1 1 100%;
        margin-left: 0;
    }

    .pt-bar #pt-order {
        flex: 1;
        min-width: 0;
    }
}

/* Na komputerze pasek w jednej linii z polem "Szukaj grupy" (pod nadtytułem "Grupy produktów") */
@media (min-width: 992px) {
    .pt-bar {
        margin-top: 27px;
    }
}

/* ---------- Podpowiedzi wyszukiwarki ---------- */
.pt-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 50;
    min-width: 300px;
    max-height: 420px;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    border: 1px solid #ececec;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
    list-style: none;
}

.pt-suggest[hidden] {
    display: none;
}

.pt-suggest a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    border-radius: 8px;
    color: #1e1e1e;
    text-decoration: none;
}

.pt-suggest a:hover,
.pt-suggest a:focus,
.pt-suggest .is-active a {
    background: #f5f4f2;
    color: #1e1e1e;
    text-decoration: none;
}

.pt-suggest img,
.pt-suggest-noimg {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: #f5f4f2;
    object-fit: contain;
}

.pt-suggest-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pt-suggest-name {
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pt-suggest-name mark {
    padding: 0;
    background: none;
    color: inherit;
    font-weight: 700;
}

.pt-suggest-code {
    color: #8a8a8a;
    font-size: 12px;
}

.pt-suggest-all {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #ececec;
}

.pt-suggest-all a {
    padding: 9px 8px;
    color: #CD0000;
    font-size: 13px;
    font-weight: 600;
}

.pt-suggest-all a:hover,
.pt-suggest-all.is-active a {
    color: #a80000;
}

/* Ostatnie wyszukiwania */
.pt-suggest-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 4px;
    color: #8a8a8a;
    font-size: 12px;
    font-weight: 600;
}

.pt-recent-clear {
    padding: 0;
    border: 0;
    background: none;
    color: #8a8a8a;
    font-family: 'Gilroy', sans-serif;
    font-size: 12px;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
}

.pt-recent-clear:hover {
    color: #CD0000;
}

.pt-suggest-recent a {
    gap: 10px;
    padding: 8px;
    font-size: 14px;
    font-weight: 500;
}

.pt-suggest-recent .fa {
    width: 14px;
    color: #9a9a9a;
    text-align: center;
}

/* ---------- Ładowanie listy produktów ---------- */
@keyframes pl-spin {
    to { transform: rotate(360deg); }
}

.pl-ring {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(205, 0, 0, .15);
    border-top-color: #CD0000;
    border-radius: 50%;
    animation: pl-spin .8s linear infinite;
}

/* Pierwsze wczytanie: sam pierścień na środku widocznej części kolumny produktów */
.pl-first {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: max(360px, calc(100vh - 240px));
}

/* Kolejne wczytania: obecne produkty przygaszone, pierścień nad nimi */
.pl-loading {
    position: relative;
    min-height: 200px;
}

.pl-loading > * {
    opacity: .4;
    pointer-events: none;
    transition: opacity .15s ease;
}

.pl-loading::after {
    content: "";
    position: absolute;
    top: var(--pl-y, 160px);
    left: 50%;
    z-index: 5;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border: 3px solid rgba(205, 0, 0, .15);
    border-top-color: #CD0000;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 6px #fff, 0 6px 20px rgba(0, 0, 0, .12);
    animation: pl-spin .8s linear infinite;
}

/* Podpowiedzi: zamiast lupy mały pierścień, gdy trwa wyszukiwanie */
.pt-search.is-loading .fa-search {
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border: 2px solid rgba(30, 30, 30, .15);
    border-top-color: #1e1e1e;
    border-radius: 50%;
    transform: none;
    animation: pl-spin .7s linear infinite;
}

.pt-search.is-loading .fa-search::before {
    content: none;
}

@media (prefers-reduced-motion: reduce) {
    .pl-ring,
    .pl-loading::after,
    .pt-search.is-loading .fa-search {
        animation-duration: 2s;
    }
}

/* Kotwica #oferta (powrót na początek listy) nie chowa się pod przypiętym paskiem menu */
#oferta {
    scroll-margin-top: 56px;
}

/* Lista produktów zaczyna się blisko menu (motyw dawał 60 px odstępu nad i 120 px pod) */
.shop-left-sidebar-area#oferta {
    padding-top: 4px;
    padding-bottom: 64px;
}

@media (max-width: 767px) {
    .shop-left-sidebar-area#oferta {
        padding-top: 4px;
        padding-bottom: 40px;
    }
}
