/* ===================================================
   Przedsiębiorstwa Społeczne – Frontend v1.3.0
   =================================================== */

.ps-wrap *, .ps-wrap *::before, .ps-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
.ps-wrap {
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1a1a2e;
}

/* ─── TOOLBAR ──────────────────────────────────── */
.ps-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 0 28px;
}

/* Wyszukiwarka */
.ps-search-box {
    position: relative;
    flex: 0 0 280px;
    min-width: 180px;
}
.ps-search-ico {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: #9ca3af;
    pointer-events: none;
    flex-shrink: 0;
}
.ps-search-input {
    width: 100%;
    padding: 9px 14px 9px 40px !important;  /* ← chroni przed motywem */
    border: 1.5px solid #d1d5db;
    border-radius: 25px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    outline: none;
    line-height: 1.4;
    transition: border-color .18s, box-shadow .18s;
    font-family: inherit;
    -webkit-appearance: none;
}
.ps-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.ps-search-input::placeholder { color: #9ca3af; }

/* Przyciski kategorii */
.ps-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.ps-cat-btn {
    padding: 8px 18px;
    border: 1.5px solid #d1d5db;
    border-radius: 999px;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    color: #374151;
    cursor: pointer;
    line-height: 1.4;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
    -webkit-appearance: none;
}
.ps-cat-btn:hover {
    border-color: #009fe3;
    color: #009fe3;
    background: #eff6ff;
}
.ps-cat-btn.active {
    background: #009fe3;
    border-color: #009fe3;
    color: #fff;
    font-weight: 600;
}

/* ─── SIATKA ───────────────────────────────────── */
.ps-grid {
    display: grid;
    gap: 22px;
    /* domyślne kolumny – można nadpisać przez atrybut style z PHP */
    grid-template-columns: repeat(var(--ps-cols, 4), 1fr);
}

/* ─── KARTA ────────────────────────────────────── */
.ps-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .22s, transform .22s;
    display: flex;
    flex-direction: column;
}
.ps-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.11);
    transform: translateY(-3px);
}

.ps-card:hover .ps-card-title {
    color: #009fe3;
    transition: color .2s;
}

/* Obrazek */
.ps-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;   /* ← kwadrat */
    overflow: hidden;
    background: #f3f4f6;
    flex-shrink: 0;
    /* height: 170px  ← usuń tę linię */
}
.ps-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .3s;
}
.ps-card:hover .ps-card-img img { transform: scale(1.04); }

.ps-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
    padding: 12px;
}

/* Treść */
.ps-card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Badge */
.ps-badge {
    display: inline-block;
    background: #eff6ff;
    color: #009fe3;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
    margin-bottom: 12px;
    letter-spacing: .01em;
    width: fit-content;
}

.ps-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
    margin-bottom: 9px;
}

.ps-card-desc {
    font-size: 13.5px;
    color: #6b7280;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 16px;
}

/* Footer karty */
.ps-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.ps-city {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #6b7280;
}
.ps-city svg { width: 13px; height: 13px; flex-shrink: 0; color: #9ca3af; }

.ps-www {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #009fe3;
    text-decoration: none;
    font-weight: 500;
    transition: color .15s;
}
.ps-www:hover { color: #009fe3; text-decoration: underline; }
.ps-www svg  { width: 11px; height: 11px; }

/* ─── BRAK WYNIKÓW ─────────────────────────────── */
.ps-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 64px 24px;
    color: #9ca3af;
    text-align: center;
}
.ps-empty svg { width: 44px; height: 44px; margin-bottom: 14px; }
.ps-empty p   { font-size: 15px; color: #6b7280; margin-bottom: 18px; }
.ps-reset-btn {
    padding: 9px 22px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .18s;
}
.ps-reset-btn:hover { background: #2563eb; }

/* ─── PAGINACJA ────────────────────────────────── */
.ps-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 32px 0 8px;
    flex-wrap: wrap;
}
.ps-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    color: #374151;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ps-page-btn:hover:not(:disabled) {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}
.ps-page-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    font-weight: 700;
}
.ps-page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}
.ps-page-info {
    font-size: 13px;
    color: #6b7280;
    padding: 0 6px;
}

/* ─── RESPONSIVE ───────────────────────────────── */
@media (max-width: 900px) {
    .ps-grid { --ps-cols: 2 !important; }
}
@media (max-width: 540px) {
    .ps-grid { --ps-cols: 1 !important; }
    .ps-search-box { flex: 1 1 100%; }
    .ps-toolbar { gap: 10px; }
    .ps-card-img { height: 140px; }
}
