/*
 * Front wyszukiwarki przetargów — Biznes Przetargi.
 * Łączy granatowy pasek filtrów (wzorzec bg-pow-hero z pluginu nieruchomości)
 * z tabelą wyników i numerowaną paginacją (wzorzec panelu REKORD).
 * Pełna szerokość, bez sidebara. Własne klasy rp- (brak kolizji z motywem).
 */

.rp-hub { width: 100%; }

/* ---- Granatowy pasek filtrów (hero) ---- */
.rp-hero {
    position: relative;
    background-color: var(--bg-navy, #071925);
    background-position: center;
    background-size: cover;
    margin-bottom: 2rem;
}
.rp-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7,25,37,.55), rgba(7,25,37,.75));
}
.rp-hero__inner {
    position: relative;
    margin: 0 auto;
    max-width: var(--bg-maxw, 1200px);
    padding: 3rem 1rem;
}
.rp-hero__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0 0 .5rem;
}
.rp-hero__title {
    margin: 0;
    color: #fff;
    font-family: var(--bg-font-serif, Georgia, serif);
    font-size: 2.2rem;
    line-height: 1.15;
}
.rp-hero__switch {
    flex-shrink: 0;
    display: inline-block;
    padding: .6rem 1.4rem;
    background: var(--bg-red, #cc1f2d);
    color: #fff;
    font-family: var(--bg-font-sans, system-ui, sans-serif);
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    border-radius: var(--bg-radius, 4px);
    white-space: nowrap;
}
.rp-hero__switch:hover { background: var(--bg-red-dark, #a01824); color: #fff; }
.rp-hero__lead {
    margin: 0 0 1.5rem;
    max-width: 640px;
    color: rgba(255,255,255,.85);
    font-family: var(--bg-font-sans, system-ui, sans-serif);
}

/* Formularz filtrów na białym tle (jak bg-pow-hero__form .bg-pow-filters) */
.rp-hero__form .rp-filters {
    background: rgba(255,255,255,.96);
    margin-bottom: 0;
}
.rp-filters {
    background: var(--bg-wash, #f7f8fa);
    border: 1px solid var(--bg-line, #e4e6ea);
    border-radius: var(--bg-radius, 3px);
    padding: 1.25rem;
}
.rp-filters__row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}
.rp-filters__field {
    display: flex;
    flex-direction: column;
}
.rp-filters__field--grow { flex: 1 1 360px; }
.rp-filters__label {
    margin-bottom: .35rem;
    color: var(--bg-ink, #16181d);
    font-family: var(--bg-font-sans, system-ui, sans-serif);
    font-size: .85rem;
    font-weight: 600;
}
.rp-filters__input,
.rp-filters__select {
    background: var(--bg-paper, #fff);
    border: 1px solid var(--bg-line, #d8d8d8);
    border-radius: var(--bg-radius, 3px);
    color: var(--bg-ink, #16181d);
    padding: .6rem .8rem;
    font-size: 1rem;
}
.rp-filters__input:focus,
.rp-filters__select:focus {
    border-color: var(--bg-red, #cc1f2d);
    outline: none;
}
.rp-filters__actions { display: flex; }
.rp-filters__submit {
    background: var(--bg-red, #cc1f2d);
    border: none;
    border-radius: var(--bg-radius, 3px);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    padding: .65rem 1.6rem;
    font-size: 1rem;
}
.rp-filters__submit:hover { background: var(--bg-red-dark, #a01824); }

/* ---- Treść ---- */
.rp-hub__body { padding-bottom: 2.5rem; }

/* Pigułki statusów */
.rp-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 1.25rem;
}
.rp-pill {
    padding: 6px 14px;
    border-radius: 16px;
    background: #f1f1f1;
    color: #444;
    border: 1px solid #ddd;
    font-size: 13px;
    text-decoration: none;
}
.rp-pill:hover { background: #e6e6e6; }
.rp-pill--active {
    background: var(--bg-navy, #1e40af);
    color: #fff;
    border-color: var(--bg-navy, #1e40af);
}
.rp-pill__count { opacity: .85; }

.rp-count {
    margin: 0 0 1rem;
    color: var(--bg-muted, #6b7280);
    font-size: .9rem;
}
.rp-empty {
    padding: 2.5rem 0;
    text-align: center;
    color: var(--bg-muted, #6b7280);
}

/* ---- Tabela wyników ---- */
.rp-table-wrap { overflow-x: auto; }
.rp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}
.rp-table thead th {
    text-align: left;
    padding: .6rem .75rem;
    border-bottom: 2px solid var(--bg-line, #e4e6ea);
    color: var(--bg-muted, #6b7280);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    white-space: nowrap;
}
.rp-table tbody td {
    padding: .75rem;
    border-bottom: 1px solid var(--bg-line, #ececec);
    vertical-align: top;
}
.rp-table__num {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--bg-muted, #6b7280);
    white-space: nowrap;
}
.rp-table__title a {
    color: var(--bg-ink, #16181d);
    font-weight: 600;
    text-decoration: none;
}
.rp-table__title a:hover { color: var(--bg-red, #cc1f2d); }
.rp-table__details {
    color: var(--bg-red, #cc1f2d);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}

/* Status badge */
.rp-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ---- Paginacja numerowana ---- */
/* Pasek paginacji: numeracja + skok w jednej linii, wyrównane do prawej. */
.rp-pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin: 1.75rem 0 0;
}
.rp-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: 0;
}
.rp-page {
    display: inline-block;
    min-width: 2.2rem;
    text-align: center;
    padding: .4rem .6rem;
    border: 1px solid var(--bg-line, #d8d8d8);
    border-radius: 4px;
    text-decoration: none;
    color: var(--bg-ink, #16181d);
    font-size: .9rem;
}
.rp-page:hover { background: var(--bg-wash, #f3f4f6); }
.rp-page--active {
    background: var(--bg-red, #cc1f2d);
    color: #fff;
    border-color: var(--bg-red, #cc1f2d);
}
.rp-page--nav { font-weight: 700; }

/* ---- Pojedynczy przetarg ---- */
.rp-single-page { width: 100%; }
.rp-wrap { padding-top: 1.5rem; padding-bottom: 2.5rem; }
.rp-single { width: 100%; max-width: 100%; padding-top: 1rem; }
.rp-meta {
    display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: .5rem;
}
.rp-meta__item { font-size: .9rem; }
.rp-facts { width: 100%; border-collapse: collapse; margin: 1.25rem 0; }
.rp-facts th, .rp-facts td {
    text-align: left; padding: .55rem .75rem;
    border-bottom: 1px solid var(--bg-line, #ececec); vertical-align: top;
}
.rp-facts__label { width: 38%; color: var(--bg-muted, #6b7280); font-weight: 600; }
.rp-body { margin: 1.5rem 0; }
.rp-source { margin: 1.5rem 0 0; }
.rp-source__link { font-weight: 700; color: var(--bg-red, #cc1f2d); text-decoration: none; }

/* Responsywność */
@media (max-width: 768px) {
    .rp-hero__title { font-size: 1.6rem; }
    .rp-filters__field--grow { flex: 1 1 100%; }
}

/* ===================================================================
   SZCZEGÓŁY POJEDYNCZEGO PRZETARGU (wzorzec renderDetail)
   =================================================================== */
.rp-back { margin: 0 0 .75rem; }
.rp-back a { color: var(--bg-navy, #1e40af); text-decoration: none; }
.rp-back a:hover { text-decoration: underline; }

.rp-detail__title {
    margin: 0 0 .5rem;
    font-size: 1.7rem;
    line-height: 1.2;
    color: var(--bg-ink, #16181d);
}
.rp-detail__badges {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin: 0 0 1.25rem;
}
.rp-source-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    background: #eef2f7;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

/* Karta (biały panel z obwódką jak we wzorcu) */
.rp-detail-card {
    background: #fff;
    border: 1px solid var(--bg-line, #e4e6ea);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}
/* Odstęp 20px między przyciskiem „Zobacz ogłoszenie w BZP" a ramką treści,
   żeby przycisk nie nachodził na kartę „Pełna treść ogłoszenia". */
.rp-detail-card--body {
    margin-top: 20px;
}

/* Tabela faktów */
.rp-detail-table {
    width: 100%;
    border-collapse: collapse;
}
.rp-detail-table th,
.rp-detail-table td {
    text-align: left;
    padding: .8rem .5rem;
    border-bottom: 1px solid var(--bg-line, #eef0f3);
    vertical-align: top;
}
.rp-detail-table tr:last-child th,
.rp-detail-table tr:last-child td { border-bottom: 0; }
.rp-detail-table__label {
    width: 34%;
    color: var(--bg-muted, #6b7280);
    font-weight: 600;
    font-size: .95rem;
}
.rp-detail-table__value { color: var(--bg-ink, #16181d); }

/* Przyciski */
.rp-detail__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.25rem;
}
.rp-btn {
    display: inline-block;
    padding: .65rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: .95rem;
}
.rp-btn--primary {
    background: var(--bg-navy, #2563eb);
    color: #fff;
}
.rp-btn--primary:hover { filter: brightness(1.08); }

/* Nagłówek sekcji treści */
.rp-detail__h2 {
    margin: 0 0 1rem;
    font-size: 1.2rem;
    color: var(--bg-ink, #16181d);
}

/* TREŚĆ OGŁOSZENIA — iframe 1:1 jak panel źródłowy (style BZP działają w środku,
   wygląd identyczny). Wymiary i ramka 1:1 z oryginałem. */
.rp-body-frame {
    width: 100%;
    height: 70vh;
    border: 1px solid var(--bg-line, #e5e7eb);
    border-radius: 6px;
    background: #fff;
}
/* Tekstowa wersja treści dla Googlebota — w DOM (indeksowalna), ale wizualnie
   ukryta (iframe pokazuje ładną wersję). NIE używamy display:none ani
   visibility:hidden, bo to ukrywa treść także przed wyszukiwarką. Technika
   klipowania pozostawia tekst w drzewie dostępności i dla botów. */
.rp-body-seo {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: normal;
    border: 0;
}

.rp-detail__note {
    margin: .75rem 0 0;
    font-size: .8rem;
    color: var(--bg-muted, #6b7280);
}

/* Wielokropek w paginacji */
.rp-page--gap {
    border: 0;
    background: transparent;
    cursor: default;
    color: var(--bg-muted, #6b7280);
    min-width: 1.4rem;
}

/* ===================================================================
   POLE „PRZEJDŹ DO STRONY"
   =================================================================== */
.rp-jump {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    flex-wrap: wrap;
}
.rp-jump__label {
    font-size: .9rem;
    color: var(--bg-muted, #6b7280);
}
.rp-jump__input {
    width: 84px;
    padding: .4rem .6rem;
    border: 1px solid var(--bg-line, #d8d8d8);
    border-radius: 4px;
    font-size: .9rem;
}
.rp-jump__btn {
    padding: .4rem 1rem;
    border: 1px solid var(--bg-navy, #1e40af);
    background: var(--bg-navy, #1e40af);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
}
.rp-jump__btn:hover { filter: brightness(1.08); }
.rp-jump__total {
    font-size: .9rem;
    color: var(--bg-muted, #6b7280);
}
