/* ─── Hero Section ──────────────────────────────────────────────────────────── */

.search-hero {
  padding: 53px 16px 0;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-flow: column nowrap;
}

@media only screen and (max-width: 640px) {
  .search-hero {
    padding: 24px 16px 0;
  }
}

.search-hero__heading {
  margin: 0;
  font-family: 'Parkinsans', 'Helvetica Neue', Arial, sans-serif;
  color: #22252a;
  text-align: center;
  max-width: 1260px;
  width: 100%;
  font-size: 28px;
  font-style: normal;
  font-weight: 400;
  line-height: 33.6px;
}

@media only screen and (max-width: 640px) {
  .search-hero__heading {
    max-width: 304px;
    font-size: 31px;
    font-style: normal;
    font-weight: 400;
    line-height: 37.2px;
    letter-spacing: -1px;
  }
}

.search-hero__search-bar {
  width: 100%;
  max-width: 791px;
  margin-top: 24px;
  padding-bottom: 24px;
}

@media only screen and (max-width: 640px) {
  .search-hero__search-bar {
    max-width: 328px;
  }
}

.search-hero__filter-btn {
  display: none;
}

@media only screen and (max-width: 640px) {
  .search-hero__filter-btn {
    display: inline-flex;
    width: 100%;
    max-width: 328px;
  }
}

.search-hero__filters {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-flow: row wrap;
  gap: 24px;
}

@media only screen and (max-width: 640px) {
  .search-hero__filters {
    max-width: 328px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-flow: column nowrap;
    gap: 16px;
  }

  .search-hero__filters--mobile-hidden {
    display: none;
  }
}

.search-hero__city-wrapper {
  width: 180px;
}

@media only screen and (max-width: 640px) {
  .search-hero__city-wrapper {
    width: 100%;
  }
}

.search-hero__sentinel {
  height: 0;
  width: 100%;
}

.search-page--register-flow .search-hero__search-bar,
.search-page--register-flow .search-hero__filter-btn,
.search-page--register-flow .search-hero__parent-tag,
.search-page--register-flow .search-filter-select,
.search-page--register-flow .search-results__reset-btn {
  display: none !important;
}

.search-page--register-flow .search-hero__filters {
  margin-top: 32px;
  justify-content: center;
}

.search-page--register-flow .search-hero__city-wrapper {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

@media only screen and (max-width: 640px) {
  .search-page--register-flow .search-hero__filters {
    display: flex;
  }
}

.search-create-tile {
  box-sizing: border-box;
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 220px;
  padding: 32px;
  text-align: center;
}

.search-create-tile__text {
  margin: 0;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 19.6px;
  color: #22252a;
}

.search-create-tile__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 20px;
  background-color: transparent;
  border: 1px solid #22252a;
  color: #22252a;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: normal;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.search-create-tile__btn:hover {
  background-color: rgba(34, 37, 42, 0.06);
}

/* ─── Parent tag (visible when navigating from org page) ────────────────────── */

.search-hero__parent-tag {
  margin-top: -6px;
  padding-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.search-hero__parent-tag-prefix {
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  color: #22252a;
  font-size: 14px;
  line-height: 19.6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-hero__parent-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #0daa76;
  color: #ffffff;
  border-radius: 20px;
  padding: 3px 5px 3px 12px;
  font-size: 13px;
  font-weight: 500;
  max-width: 300px;
  line-height: normal;
}

.search-hero__parent-tag-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-hero__parent-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  flex-shrink: 0;
}

@media only screen and (max-width: 640px) {
  .search-hero__parent-tag {
    max-width: 328px;
    width: 100%;
    justify-content: flex-start;
  }
}

/* iOS: input min 16px, żeby focus nie wyzwalał auto-zoomu na mobile */
@media only screen and (max-width: 991px) {
  .beneficiary-search-gr-page input {
    font-size: 16px;
  }
}

/* ─── Search Input component ────────────────────────────────────────────────── */

.search-input {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-input__field {
  width: 100%;
  border: 1px solid #dfe1e6;
  border-radius: 20px;
  height: 40px;
  padding: 0 40px 0 16px;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 19.6px;
  color: #020408;
  background-color: #ffffff;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.search-input__field::-webkit-search-cancel-button {
  display: none;
}

.search-input__field:focus {
  border: 2px solid #e40148;
}

.search-input__field::placeholder {
  color: #22252a;
}

.search-input__field--with-icon {
  padding-left: 44px;
}

.search-input__icon {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  color: #22252a;
  pointer-events: none;
  flex-shrink: 0;
}

.search-input__clear {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #9096a3;
  transition: color 0.15s;
}

.search-input__clear:hover {
  color: #22252a;
}

.search-input__clear--hidden {
  display: none;
}

/* ─── Filter multiselect dropdown ───────────────────────────────────────────── */

.search-filter-select {
  position: relative;
}

@media only screen and (max-width: 640px) {
  .search-hero__filters .search-filter-select,
  .search-hero__filters .search-filter-select__trigger,
  .search-hero__filters .search-filter-select__panel {
    width: 100%;
  }
}

.search-filter-select__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 16px;
  width: 180px;
  border-radius: 20px;
  border: 1px solid #dfe1e6;
  background-color: #ffffff;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 19.6px;
  color: #22252a;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.search-filter-select__label {
  overflow: hidden;
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.search-filter-select__placeholder {
  color: #22252a;
}

.search-filter-select__trigger--active {
  border-color: #e40148;
  color: #e40148;
}

.search-filter-select__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background-color: #e40148;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 0 5px;
}

.search-filter-select__count--hidden {
  display: none;
}

.search-filter-select__chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.search-filter-select--open .search-filter-select__chevron {
  transform: rotate(180deg);
}

.search-filter-select__panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 99;
  min-width: 240px;
  max-height: 280px;
  overflow-y: auto;
  background-color: #ffffff;
  border: 1px solid #e40148;
  border-radius: 5px;
  box-shadow: 0 0 30px -5px rgba(0, 23, 92, 0.3);
  padding: 8px 0;
}

.search-filter-select--open .search-filter-select__panel {
  display: block;
}

.search-filter-select__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 22.4px;
  color: #22252a;
}

.search-filter-select__item:hover {
  background-color: #f8f9fb;
}

.search-filter-select__item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #e40148;
  flex-shrink: 0;
  cursor: pointer;
}

/* Chip inside active filter trigger — like TagChip deletable in React */
.search-filter-select__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #0daa76;
  color: #ffffff;
  border-radius: 20px;
  padding: 3px 5px 3px 12px;
  font-size: 13px;
  font-weight: 500;
  max-width: 140px;
  line-height: normal;
  flex-shrink: 1;
  min-width: 0;
}

.search-filter-select__chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.search-filter-select__chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  flex-shrink: 0;
}

.search-filter-select__counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #0daa76;
  color: #ffffff;
  border-radius: 20px;
  width: 29px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
}

/* ─── Filter Drawer (mobile only) ───────────────────────────────────────────── */

.search-filter-drawer {
  display: none;
}

@media only screen and (max-width: 640px) {
  .search-filter-drawer {
    position: fixed;
    inset: 0;
    z-index: 200;
    background-color: #ffffff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    flex-flow: column nowrap;
  }

  .search-filter-drawer--open {
    transform: translateX(0);
  }
}

.search-filter-drawer__header {
  padding: 24px 16px 16px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-flow: row nowrap;
}

.search-filter-drawer__title {
  margin: 0;
  font-family: 'Parkinsans', 'Helvetica Neue', Arial, sans-serif;
  color: #020408;
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: 28.8px;
}

.search-filter-drawer__close-btn {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #22252a;
  display: flex;
  align-items: center;
}

.search-filter-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px;
}

.search-filter-drawer__section {
  border-top: 1px solid #dfe1e6;
}

.search-filter-drawer__section-header {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 16px 0;
  width: 100%;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  color: #22252a;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 19.6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-flow: row nowrap;
}

.search-filter-drawer__section-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.search-filter-drawer__section-chevron--open {
  transform: rotate(180deg);
}

.search-filter-drawer__section-content {
  padding-bottom: 8px;
}

.search-filter-drawer__section-content--collapsed {
  display: none;
}

.search-filter-drawer__checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 22.4px;
  color: #22252a;
  cursor: pointer;
}

.search-filter-drawer__checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #e40148;
  flex-shrink: 0;
  cursor: pointer;
}

.search-filter-drawer__footer {
  flex-shrink: 0;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-flow: column nowrap;
  gap: 16px;
}

.search-filter-drawer__apply-btn {
  width: 100%;
}

.search-filter-drawer__reset-btn[hidden] {
  display: none;
}

.search-filter-drawer__reset-btn {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  color: #22252a;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 19.6px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-flow: row nowrap;
  gap: 4px;
}

/* ─── Results Section ───────────────────────────────────────────────────────── */

.search-results {
  padding: 0 16px;
  width: 100%;
  max-width: 1232px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-flow: column nowrap;
}

.search-results__toolbar {
  width: 100%;
  max-width: 1200px;
  padding: 24px 0 16px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-flow: row nowrap;
  gap: 12px;
}

@media only screen and (max-width: 640px) {
  .search-results__toolbar {
    max-width: 328px;
  }
}

.search-results__count {
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  color: #22252a;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 19.6px;
}

.search-results__count strong {
  font-weight: 700;
}

.search-results__reset-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-flow: row nowrap;
  gap: 4px;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  color: #22252a;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 19.6px;
  cursor: pointer;
}

.search-results__reset-btn:hover {
  color: #e40148;
}


.search-results__empty {
  margin: 0;
  padding: 64px 0;
  text-align: center;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  color: #9096a3;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 22.4px;
}

.search-results__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
  max-width: 1200px;
}

@media only screen and (max-width: 991px) {
  .search-results__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media only screen and (max-width: 640px) {
  .search-results__grid {
    grid-template-columns: 1fr;
    gap: 18px;
    max-width: 328px;
    margin: 0 auto;
  }
}

/* Override beneficiary-tile fixed sizes inside search grid */
.search-results__grid .beneficiary-tile,
.search-results__tile {
  min-width: unset;
  max-width: unset;
  width: 100%;
}

/* Odstęp nad logotypem, żeby nie nachodził na badge kategorii */
.search-results__tile .beneficiary-tile__logo-wrapper {
  padding-top: 12px;
}

.search-results__pagination {
  padding: 40px 0;
}

/* ─── Register-flow tile with admin note ─────────────────────────────────────── */

.beneficiary-tile--with-note {
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.beneficiary-tile__body {
  display: flex;
  flex-flow: column nowrap;
  gap: 8px;
  padding: 32px;
  text-decoration: none;
  color: inherit;
}

.beneficiary-tile--with-note .beneficiary-tile__admin-note {
  margin-top: auto;
  display: flex;
  flex-flow: column nowrap;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 24px;
  background-color: #f8f9fb;
}

.beneficiary-tile__admin-text {
  margin: 0;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  line-height: 18px;
  color: #22252a;
}

.beneficiary-tile__admin-link {
  color: #22252a;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.beneficiary-tile__admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border: 1px solid #e40148;
  border-radius: 20px;
  background-color: #e40148;
  color: #ffffff;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: normal;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.beneficiary-tile__admin-btn:hover {
  background-color: #bc013b;
  border-color: #bc013b;
}

/* ─── Sticky Search Bar (mobile only) ───────────────────────────────────────── */

.search-sticky-bar {
  display: none;
}

@media only screen and (max-width: 640px) {
  .search-sticky-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 101;
    height: 60px;
    padding: 10px 16px;
    background-color: #ffffff;
    box-shadow: 1px 2px 9px 0 rgba(144, 150, 163, 0.18);
    transform: translateY(-100%);
    transition: transform 0.25s ease;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-flow: row nowrap;
    gap: 8px;
  }

  .search-sticky-bar--visible {
    transform: translateY(0);
  }
}

.search-sticky-bar__input-wrapper {
  flex: 1;
  min-width: 0;
}

.search-sticky-bar__input {
  border-radius: 20px;
  height: 40px;
}

/* ─── CTA Section ────────────────────────────────────────────────────────────── */

.search-cta {
  padding: 48px 16px 64px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-flow: row nowrap;
}

@media only screen and (max-width: 991px) {
  .search-cta {
    padding: 32px 16px 48px;
  }
}

.search-cta__card {
  text-align: center;
  background-color: #f4faff;
  border-radius: 20px;
  padding: 64px 120px;
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-flow: column nowrap;
}

@media only screen and (max-width: 991px) {
  .search-cta__card {
    padding: 40px 24px;
  }
}

.search-cta__subtitle {
  margin: 0;
  font-family: 'Parkinsans', 'Helvetica Neue', Arial, sans-serif;
  color: #22252a;
  font-size: 28px;
  font-style: normal;
  font-weight: 400;
  line-height: 33.6px;
}

@media only screen and (max-width: 991px) {
  .search-cta__subtitle {
    font-size: 24px;
    font-style: normal;
    font-weight: 400;
    line-height: 28.8px;
  }
}

.search-cta__heading {
  margin: 14px 0 0;
  font-family: 'Parkinsans', 'Helvetica Neue', Arial, sans-serif;
  color: #22252a;
  max-width: 792px;
  font-size: 40px;
  font-style: normal;
  font-weight: 400;
  line-height: 48px;
  letter-spacing: -1px;
}

@media only screen and (max-width: 991px) {
  .search-cta__heading {
    font-size: 31px;
    font-style: normal;
    font-weight: 400;
    line-height: 37.2px;
    letter-spacing: -1px;
  }
}

.search-cta__description {
  margin: 20px 0 32px;
  font-family: 'DMSans', 'Helvetica Neue', Arial, sans-serif;
  color: #22252a;
  max-width: 789px;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 22.4px;
}

@media only screen and (max-width: 991px) {
  .search-cta__description {
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 19.6px;
  }
}
