/* assets/frontend.css */

/* --- bazowe --- */
.jd-front-wrap {
  position: relative;
}

.jd-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.jd-front-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
  background: #fff;
}

/* ✅ KLUCZ: stała wysokość wiersza (wyrówna linie) */
.jd-front-table tbody tr {
  height: 56px;
}

/* minimalistyczne separatory: tylko linia pod wierszem */
.jd-front-table tbody tr {
  border-bottom: 0;
}

.jd-front-table th,
.jd-front-table td {
  padding: 12px 14px;
  border: 0;
  vertical-align: middle;
  white-space: nowrap;
}

/* naprzemienne tło wierszy */
.jd-front-table tbody tr:nth-child(odd) td {
  background: #fff;
}
.jd-front-table tbody tr:nth-child(even) td {
  background: #fcfcfc;
}

/* hover na wierszu */
.jd-front-table tbody tr:hover td {
  background: #f6f6f6;
}

/* chwilowe podświetlenie po wejściu w hash (np. #jd-mieszkanie-m1) */
.jd-front-table tbody tr.jd-hash-highlight td {
  background: rgba(192, 166, 141, 0.18) !important;
  box-shadow: inset 0 0 0 2px rgba(192, 166, 141, 0.55);
  transition:
    background 1.2s ease,
    box-shadow 1.2s ease;
}

.jd-front-table thead th {
  position: sticky;
  top: 0;
  background: #fafafa;
  z-index: 1;
  border-bottom: 0;
}

.jd-front-table thead th:first-child {
  border-top-left-radius: 0;
}
.jd-front-table thead th:last-child {
  border-top-right-radius: 0;
}

.jd-front-table th.jd-sort {
  cursor: pointer;
  user-select: none;
}

.jd-front-table th.jd-sort::after {
  content: " ⇅";
  opacity: 0.35;
  font-size: 12px;
}

.jd-front-table th.jd-no-sort {
  cursor: default;
}

/* --- STATUS: wyrównanie + kolor zależny od statusu --- */
.jd-front-table td.jd-status {
  font-weight: 700;
  line-height: 1.2;

  /* ✅ wyrównanie w pionie jak w ikonach */
  height: 56px;
}

/* tylko kolor tekstu (prosto i czytelnie) */
.jd-st-available td.jd-status {
  color: #1f7a1f;
}
.jd-st-reserved td.jd-status {
  color: #b26a00;
}
.jd-st-sold td.jd-status {
  color: #b00020;
  opacity: 0.9;
}
.jd-st-soon td.jd-status {
  color: #005bbb;
}
.jd-st-other td.jd-status {
  color: #444;
}

/* opcjonalnie: lekko przygaś cały wiersz dla Sprzedane */
.jd-st-sold td {
  opacity: 0.88;
}

/* --- CECHY: wyrównanie bez psucia tabeli --- */
.jd-front-table td.jd-features {
  /* zostaje flex tylko dla tej komórki */
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;

  /* ✅ zamiast min-height — dopasuj do wiersza */
  height: 56px;
}

.jd-feature-empty {
  opacity: 0.5;
  display: inline-flex;
  align-items: center;
  height: 34px;
  line-height: 34px;
}

/* ikonki */
.jd-feature-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  background: #c0a68d;
  color: #fff;
  cursor: pointer;
  padding: 0;
  transition:
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

/* --- Plan / Rzut: przyciski typu pill --- */
.jd-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: #c0a68d;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.jd-pill-btn:hover {
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* nie zmieniaj koloru tekstu na hover (często nadpisywane przez motyw) */
.jd-pill-btn:hover,
.jd-pill-btn:focus,
.jd-pill-btn:visited {
  color: #fff;
}

.jd-doc-cell {
  white-space: nowrap;
}

/* --- Prospekt informacyjny pod tabelą --- */
.jd-prospect-wrap {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.jd-prospect-btn {
  font-weight: 600;
}

.jd-feature-btn svg {
  width: 18px;
  height: 18px;
}

.jd-feature-btn svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jd-feature-btn:hover {
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.jd-feature-btn:hover,
.jd-feature-btn:focus {
  color: #fff;
}

/* --- Cena brutto: cena + zegar w jednej linii --- */
.jd-front-table td.jd-price-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  min-width: 180px;

  /* ✅ wyrównanie do wysokości wiersza */
  height: 56px;
}

.jd-front-table td.jd-price-cell .jd-price-text {
  display: inline-block;
}

/* zegar */
.jd-price-history-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid #e2e2e2;
  background: #fff;
  cursor: pointer;
  padding: 0;
  vertical-align: middle;
  transition:
    box-shadow 0.15s ease,
    transform 0.15s ease;

  /* kolor ikonki zegara */
  color: #c0a68d;
}

.jd-price-history-btn svg {
  width: 16px;
  height: 16px;
}

.jd-price-history-btn svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jd-price-history-btn:hover {
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);

  /* utrzymaj kolor ikonki */
  color: #c0a68d;
}

/* --- Popover --- */
.jd-feature-popover {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.jd-feature-popover.is-open {
  display: flex;
}

.jd-feature-popover-inner {
  width: min(760px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.28);
  position: relative;
  padding: 18px 18px 14px;
}

.jd-feature-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #e2e2e2;
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: box-shadow 0.15s ease;
}

.jd-feature-close:hover {
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.08);
}

.jd-feature-content h4 {
  margin: 0 0 10px;
  font-size: 18px;
}

.jd-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.jd-feature-item {
  border: 1px solid #eee;
  border-radius: 0;
  padding: 10px 12px;
  background: #fafafa;
}

.jd-feature-item .k {
  display: block;
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 4px;
}

.jd-feature-item .v {
  font-weight: 600;
}

/* tabela historii w popupie */
.jd-price-history-table th,
.jd-price-history-table td {
  padding: 8px 6px;
  border: 0;
  text-align: left;
  white-space: nowrap;
}

/* mobile */
@media (max-width: 600px) {
  .jd-feature-grid {
    grid-template-columns: 1fr;
  }
  .jd-front-table {
    min-width: 980px;
  }

  /* ✅ na mobile trochę niższe wiersze */
  .jd-front-table tbody tr {
    height: 52px;
  }
  .jd-front-table td.jd-features,
  .jd-front-table td.jd-price-cell,
  .jd-front-table td.jd-status {
    height: 52px;
  }
}

/* --- FIX: równe bordery w tabeli --- */

/* usuń stałe wysokości (one + padding powodują dziwne wyliczenia) */
.jd-front-table tbody tr {
  height: auto;
}

/* NIE rób flexa na TD */
.jd-front-table td.jd-features,
.jd-front-table td.jd-price-cell {
  display: table-cell;
  height: auto;
}

/* zamiast gap z flexa: odstępy przez marginesy */
.jd-front-table td.jd-features .jd-feature-btn {
  margin-right: 8px;
}
.jd-front-table td.jd-features .jd-feature-btn:last-child {
  margin-right: 0;
}

.jd-front-table td.jd-price-cell .jd-price-text {
  margin-right: 10px;
}

/* nie przygaszaj borderów w "Sprzedane" */
.jd-st-sold td {
  opacity: 1;
} /* border zostaje równy */
.jd-st-sold td > * {
  opacity: 0.88;
} /* przygaś tylko zawartość */

/* === Cechy lokalu: ciemne boxy === */
.jd-feature-btn {
  background: #1e1e1e;
  border-color: #2a2a2a;
  color: #fff;
}

.jd-feature-btn svg * {
  stroke: #fff;
}

.jd-feature-btn:hover {
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

/* niedostępne / sprzedane */
.jd-feature-btn.jd-feature-disabled {
  background: #f2f2f2;
  border-color: #ddd;
  color: #888;
  cursor: not-allowed;
}

.jd-feature-btn.jd-feature-disabled svg * {
  stroke: #888;
}

.jd-feature-btn.jd-feature-disabled:hover {
  box-shadow: none;
  transform: none;
}

/* === Status w popupie (kolory) === */
.jd-feature-item .v.jd-status-available {
  color: #1f7a1f;
}

.jd-feature-item .v.jd-status-reserved {
  color: #b26a00;
}

.jd-feature-item .v.jd-status-sold {
  color: #b00020;
}

.jd-feature-item .v.jd-status-unavailable {
  color: #666;
}

/* Plan / rzut jako box-link */
a.jd-feature-btn.jd-doc-btn {
  text-decoration: none;
}

/* Animacja podświetlenia */
@keyframes jdHighlight {
  0% {
    background-color: #f6f6f6;
  }
  100% {
    background-color: transparent;
  }
}

/* Działa tylko dla sekcji mieszkań */
[id^="jd-mieszkanie-"]:target {
  animation: jdHighlight 2s ease-out;
}

.jd-feature-btn,
.jd-pill-btn {
  background: #c0a68d;
  color: #fff;
  border: 0;
}

.jd-feature-btn:hover,
.jd-pill-btn:hover {
  background: #b79a80; /* lekko ciemniejszy odcień */
  color: #fff; /* wymuszenie białego tekstu */
}

table caption + thead tr:first-child td,
table caption + thead tr:first-child th,
table colgroup + thead tr:first-child td,
table colgroup + thead tr:first-child th,
table thead:first-child tr:first-child td,
table thead:first-child tr:first-child th {
  border-top: 0;
}

.jd-front-table tbody tr {
  transition:
    background-color 0.4s ease,
    box-shadow 0.4s ease;
}

.jd-front-table tbody tr.jd-hash-highlight {
  background-color: rgba(192, 166, 141, 0.18);
  box-shadow: inset 0 0 0 2px rgba(192, 166, 141, 0.5);
}

/* --- poprawki: popup historia cen --- */
.jd-price-history-table,
.jd-price-history-table th,
.jd-price-history-table td {
  border: 0 !important;
}

.jd-feature-close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;
    padding: 0;

    font-size: 22px;
    line-height: 1;
    font-weight: 600;

    background: transparent;
    border: none;
    cursor: pointer;

    text-align: center;
}



.jd-price-history-btn:hover{
	background-color: #1e191b;
}