/* Tripivo /oferty — booking-style split list + map
   Lewa kolumna: filtry + lista kart
   Prawa kolumna: sticky mapa Leaflet z klastrami
*/

/* DESKTOP: na stronach listingowych body=100vh bez page-scrolla — wszystko mieści się w viewport */
body.page-offers, html:has(body.page-offers) {
  height: 100vh;
  overflow: hidden;
}
body.page-offers main {
  height: calc(100vh - 80px);
  overflow: hidden;
}
/* MOBILE wraca do normalnego page-scroll (body+main z auto wysokością) */
@media (max-width: 991.98px) {
  body.page-offers, html:has(body.page-offers) {
    height: auto;
    overflow: visible;
  }
  body.page-offers main {
    height: auto;
    overflow: visible;
  }
}

/* DESKTOP layout: 3 kolumny x 100vh — każda przewija się NIEZALEŻNIE we własnym pojemniku.
   Strona NIE scrolluje się jako całość — wszystko mieści się w viewport, scroll jest w każdej kolumnie. */
.bk-shell {
  display: grid;
  grid-template-columns: 320px 1fr 1.15fr;
  gap: 0;
  background: #F8FAFC;
  height: calc(100vh - 80px);    /* stała pełna wysokość = viewport - header */
  overflow: hidden;              /* żeby przeglądarka nie scrollowała body, tylko kolumny */
}

.bk-filters {
  background: #fff;
  border-right: 1px solid #E5E7EB;
  padding: 22px 20px;
  height: 100%;
  overflow-y: auto;              /* własny scroll filtrów */
}
.bk-filters h3 {
  font-size: 1rem;
  margin: 0 0 14px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.bk-filter-group {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #F1F5F9;
}
.bk-filter-group:last-child { border-bottom: 0; }
.bk-filter-group label.bk-lbl {
  display: block;
  font-weight: 600;
  font-size: .82rem;
  color: #1F2937;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.bk-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: .92rem;
  cursor: pointer;
}
.bk-check input { width: 16px; height: 16px; cursor: pointer; }
.bk-check .count {
  margin-left: auto;
  color: #6B7280;
  font-size: .82rem;
  background: #F3F4F6;
  padding: 1px 8px;
  border-radius: 999px;
}
.bk-price-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.bk-price-row input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
}
.bk-input, .bk-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  font-family: inherit;
  font-size: .95rem;
  background: #fff;
  outline: none;
}
.bk-input:focus, .bk-select:focus { border-color: #347D80; box-shadow: 0 0 0 3px rgba(52,125,128,.12); }

/* LISTA: 100% wysokości kolumny, własny scroll w pionie */
.bk-list {
  padding: 22px 22px 60px;
  height: 100%;
  overflow-y: auto;
}
.bk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.bk-toolbar h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -.02em;
}
.bk-toolbar .count {
  color: #6B7280;
  font-weight: 500;
  font-size: .95rem;
}
.bk-toolbar .sort {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bk-toolbar .sort select {
  padding: 7px 11px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: .9rem;
  cursor: pointer;
}

/* Karta booking-style */
.bk-card {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 16px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  transition: transform .15s, box-shadow .2s, border-color .2s;
  position: relative;
}
.bk-card:hover {
  transform: translateY(-2px);
  border-color: #347D80;
  box-shadow: 0 12px 24px -8px rgba(52,125,128,.15);
}
.bk-card.is-highlight {
  border-color: #4FA5A8;
  box-shadow: 0 0 0 3px rgba(199,126,44,.18);
}
.bk-card-img {
  width: 200px;
  height: 150px;
  border-radius: 10px;
  overflow: hidden;
  background: #F1F5F9;
  position: relative;
}
.bk-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.bk-card-img .bk-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(31,41,55,.85);
  color: #fff;
  padding: 4px 10px;
  font-size: .72rem;
  border-radius: 999px;
  letter-spacing: .03em;
}
.bk-card-img .bk-fav {
  position: absolute;
  top: 8px; right: 8px;
  width: 32px; height: 32px;
  display: flex;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,.92);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  color: #DC2626;
}

.bk-card-body { display: flex; flex-direction: column; min-width: 0; }
.bk-card-cat {
  font-size: .72rem;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bk-card-cat i { color: #347D80; }
.bk-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1F2937;
  margin: 0 0 4px;
  letter-spacing: -.01em;
  line-height: 1.3;
}
.bk-card-title a { color: inherit; }
.bk-card-title a:hover { color: #347D80; }
.bk-card-venue {
  font-size: .85rem;
  color: #6B7280;
  margin: 0 0 8px;
}
.bk-card-venue i { color: #347D80; margin-right: 3px; }
.bk-card-feat {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 6px;
}
.bk-card-feat span {
  font-size: .76rem;
  background: #F1F5F9;
  color: #475569;
  padding: 3px 9px;
  border-radius: 6px;
}
.bk-card-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: #1F2937;
  margin-top: auto;
}
.bk-card-rating .score {
  background: #347D80;
  color: #fff;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: .82rem;
}
.bk-card-rating .reviews { color: #6B7280; }

.bk-card-price {
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
}
.bk-card-price .from { font-size: .75rem; color: #6B7280; }
.bk-card-price .val {
  font-size: 1.5rem;
  font-weight: 800;
  color: #347D80;
  letter-spacing: -.02em;
  margin: 2px 0 0;
}
.bk-card-price .pp { font-size: .72rem; color: #6B7280; margin-top: -2px; }
.bk-card-price .btn {
  margin-top: 12px;
  background: #347D80;
  color: #fff;
  border: 0;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  display: inline-block;
}
.bk-card-price .btn:hover { background: #266467; color: #fff; }
.bk-card-price .stock {
  font-size: .72rem;
  color: #DC2626;
  font-weight: 600;
  margin-top: 6px;
}
.bk-card-price .stock.low { color: #4FA5A8; }
.bk-card-price .stock.ok  { color: #047857; }

.bk-empty {
  background: #fff;
  border: 1px dashed #E5E7EB;
  border-radius: 14px;
  padding: 40px 20px;
  text-align: center;
  color: #6B7280;
}

/* MAPA: 100% wysokości kolumny, NIE przewija się (mapa Leaflet ma własne pan/zoom) */
.bk-map-wrap {
  height: 100%;
  overflow: hidden;
  background: #EFF6F7;
}
#bkMap { width: 100%; height: 100%; }

/* Marker cenowy na mapie */
.bk-pin {
  background: #fff;
  color: #1F2937;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  border: 2px solid #347D80;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  font-size: .8rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s;
}
.bk-pin:hover, .bk-pin.is-active {
  background: #347D80;
  color: #fff;
  transform: scale(1.08);
  z-index: 1000;
}

/* Popup na mapie */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}
.leaflet-popup-content { margin: 0 !important; }
.bk-popup {
  width: 240px;
  font-family: 'Inter', system-ui, sans-serif;
}
.bk-popup-img {
  width: 100%; height: 130px;
  object-fit: cover;
  display: block;
  background: #F1F5F9;
}
.bk-popup-body { padding: 10px 12px 12px; }
.bk-popup-title {
  font-size: .92rem;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.3;
}
.bk-popup-title a { color: #1F2937; }
.bk-popup-title a:hover { color: #347D80; }
.bk-popup-venue {
  font-size: .78rem;
  color: #6B7280;
  margin: 0 0 8px;
}
.bk-popup-price {
  font-size: 1rem;
  font-weight: 700;
  color: #347D80;
  margin: 0;
}
.bk-popup-price span { font-size: .68rem; color: #6B7280; font-weight: 500; }

/* Klaster (marker cluster) */
.marker-cluster {
  background: rgba(52,125,128,.85) !important;
  color: #fff !important;
  font-weight: 700;
  border-radius: 50% !important;
  border: 3px solid #fff !important;
  box-shadow: 0 4px 10px rgba(0,0,0,.2);
}
.marker-cluster div { background: transparent !important; color: #fff !important; }
.marker-cluster span { line-height: 26px !important; font-weight: 800; }

/* Mobile: ukryj mapę, dodaj toggle */
.bk-mobile-toggle {
  display: none;
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: #1F2937;
  color: #fff;
  border: 0;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9rem;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  cursor: pointer;
}
.bk-mobile-toggle i { margin-right: 6px; }

@media (max-width: 1199.98px) {
  .bk-shell { grid-template-columns: 300px 1fr 1fr; }
  .bk-card-img { width: 160px; height: 130px; }
}

@media (max-width: 991.98px) {
  /* MOBILE: kolumny układają się w stos — mapa na górze (220px), filtry pod nią, lista na dole.
     STRONA scrolluje się normalnie (overflow: visible); kolumny nie mają own scrolla. */
  .bk-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 220px auto 1fr;
    height: auto;                  /* mobile: strona ma normalną wysokość */
    overflow: visible;             /* mobile: page-level scroll */
  }

  /* Mapa "podglądowa" 220px na górze, widoczna od startu */
  .bk-map-wrap {
    order: 1;
    display: block !important;
    height: 220px;
    border-bottom: 1px solid #E5E7EB;
  }
  .bk-filters {
    order: 2;
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #E5E7EB;
    padding: 16px;
  }
  .bk-list {
    order: 3;
    height: auto;
    overflow: visible;             /* mobile: scroll page-level, nie wewnętrzny */
    padding: 16px 14px 80px;
  }

  /* Toggle "Pełen ekran" mapy */
  .bk-mobile-toggle { display: inline-flex; align-items: center; }
  body.bk-map-on .bk-map-wrap {
    position: fixed;
    inset: 0;
    top: 0;
    z-index: 998;
    height: 100vh;
    border-bottom: 0;
  }
  body.bk-map-on { overflow: hidden; }
  body.bk-map-on .bk-mobile-toggle { background: #347D80; }
}

@media (max-width: 575.98px) {
  .bk-card { grid-template-columns: 1fr; }
  .bk-card-img { width: 100%; height: 180px; }
  .bk-card-price { text-align: left; align-items: flex-start; flex-direction: row; justify-content: space-between; }
}
