/* ───────── LOKALE USŁUGOWE ─────────
   Kolorystyka wg wizualizacji: ciemny nagłówek i pas kontaktowy (#272727),
   niebieski akcent przycisków i nagłówków kolumn, jasne tło strony.
   Wszystkie kolory są zmiennymi — wystarczy podmienić je w tym bloku. */
.page-template-page-commercial {
  --ngc-accent: #2f55d4;
  --ngc-accent-dark: #2444b0;
  --ngc-dark: #272727;
  --ngc-ink: #1d1d1f;
  --ngc-muted: #5e5e5e;
  --ngc-line: #e3e6ec;
  --ngc-bg: #eef0f4;
  --ngc-white: #fff;
  --ngc-available: #44bc44;
  --ngc-reserved: #eca241;
  --ngc-sold: #d14835;
}

.page-template-page-commercial .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reguła UA [hidden]{display:none} przegrywa z autorskim display, więc każdy
   element sterowany atrybutem musi mieć własną regułę. */
.commercial-tabs[hidden],
.commercial-row[hidden],
.commercial-section[hidden],
.commercial-empty[hidden],
.commercial-form[hidden],
.commercial-filter[hidden],
.commercial-modal[hidden] {
  display: none;
}

/* ─── Hero ─── */
.commercial-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(280px, 36vw, 480px);
  background: var(--ngc-dark);
  color: var(--ngc-white);
  overflow: hidden;
}

.commercial-hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.commercial-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 24, 33, 0.55) 0%, rgba(20, 24, 33, 0) 60%);
}

.commercial-hero .container {
  position: relative;
  z-index: 1;
}

.commercial-hero__caption {
  max-width: 560px;
  padding: 40px 0;
}

.commercial-hero__caption h1 {
  margin: 0 0 12px;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(32px, 3.6vw, 56px);
  font-weight: 600;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--ngc-white);
}

.commercial-hero__caption p {
  display: inline-block;
  margin: 0;
  padding: 8px 14px 8px 0;
  font-size: clamp(16px, 1.4vw, 22px);
  line-height: 1.35;
  color: var(--ngc-white);
}

.commercial-intro {
  padding: 40px 0 0;
  background: var(--ngc-bg);
}

/* ─── Rama ─── */
.commercial {
  width: 100%;
  background: var(--ngc-bg);
  padding: clamp(24px, 3vw, 44px) 0 clamp(24px, 3vw, 48px);
  color: var(--ngc-ink);
}

.commercial-lead {
  max-width: 62%;
  margin: 0 0 clamp(8px, 1.6vw, 24px);
  font-size: 16px;
  color: var(--ngc-ink);
}

.commercial-none {
  margin: 0;
  color: var(--ngc-muted);
}

/* ─── Liczniki ─── */
.commercial-counters {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 3vw, 64px);
  margin: 0 0 24px;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--ngc-line);
}

.commercial-counter {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}

.commercial-counter__value {
  margin: 0;
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 700;
  white-space: nowrap;
}

.commercial-counter__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ngc-muted);
}

/* ─── Zakładki i filtr ─── */
.commercial-tabs {
  display: flex;
  flex-wrap: wrap;
  margin: 24px 0 0;
  border-bottom: 1px solid var(--ngc-line);
}

.commercial-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1 1 0;
  width: auto;
  min-height: 52px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ngc-muted);
  font: 600 13px/1.2 'Nunito', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}

.commercial-tab:hover,
.commercial-tab.is-active {
  color: var(--ngc-ink);
}

.commercial-tab.is-active {
  border-bottom-color: var(--ngc-accent);
}

.commercial-tab__count {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--ngc-muted);
}

.commercial-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
}

.commercial-summary {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.commercial-filter {
  display: flex;
  align-items: center;
  gap: 12px;
}

.commercial-filter__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ngc-muted);
  white-space: nowrap;
}

.commercial-select {
  min-width: 210px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ngc-line);
  border-radius: 2px;
  background: var(--ngc-white);
  color: var(--ngc-ink);
  font: 400 15px/1.2 'Nunito', sans-serif;
}

.commercial-select:hover,
.commercial-select:focus {
  border-color: var(--ngc-accent);
}

/* ─── Sekcja inwestycji ─── */
.commercial-section {
  display: block;
  margin: 0 0 clamp(28px, 3vw, 44px);
}

.commercial-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin: 0 0 16px;
}

.commercial-section__intro {
  flex: 1 1 320px;
}

.commercial-section__title {
  margin: 0 0 6px;
  font-family: 'Nunito', sans-serif;
  font-size: clamp(26px, 2.6vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ngc-ink);
}

.commercial-section__kicker {
  margin: 0 0 4px;
  font-size: clamp(16px, 1.3vw, 20px);
}

.commercial-section__meta {
  margin: 0;
  font-size: 14px;
  color: var(--ngc-muted);
}

.commercial-visual {
  flex: 0 1 clamp(220px, 28%, 272px);
  margin: 0;
}

.commercial-visual img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 272 / 116;
  object-fit: cover;
}

/* ─── Tabela ─── */
.commercial-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--ngc-white);
  box-shadow: 0 1px 2px rgba(20, 24, 33, 0.06);
}

.commercial-table th {
  padding: 14px 20px;
  background: #f3f5f9;
  color: var(--ngc-accent);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.commercial-table td {
  padding: 10px 20px;
  border-top: 1px solid var(--ngc-line);
  font-size: 15px;
  vertical-align: middle;
}

.commercial-table tbody tr:first-child td {
  border-top: 0;
}

.commercial-table tbody tr:hover td {
  background: #f8f9fc;
}

.commercial-cell--strong {
  font-weight: 700;
}

/* ─── Układ kolumn ───
   Stałe szerokości kolumn (table-layout: fixed), identyczne we wszystkich
   sekcjach, więc kolumny różnych inwestycji leżą dokładnie pod sobą.
   Kolumna „Lokal” bierze całą resztę szerokości. */
.commercial-table {
  table-layout: fixed;
}

.commercial-table th,
.commercial-table td {
  padding: 14px 20px;
  vertical-align: middle;
  text-align: left;
}

.commercial-col--building { width: 160px; }
.commercial-col--floor    { width: 120px; }
.commercial-col--area     { width: 180px; }
.commercial-col--rent     { width: 240px; }
.commercial-col--contact  { width: 190px; }
.commercial-col--card     { width: 100px; }

.commercial-table td {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Przyciski w kolumnach „Stawka najmu” i „Kontakt”: ta sama wysokość
   i szerokość, żeby tworzyły równe pionowe rzędy. */
.commercial-table .commercial-btn {
  display: flex;
  width: 100%;
  max-width: 170px;
  min-height: 36px;
  padding: 0 14px;
  box-sizing: border-box;
}

.commercial-table .commercial-link {
  display: inline-block;
  padding: 4px 0;
}

.commercial-id {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.commercial-badge {
  padding: 2px 8px;
  border-radius: 2px;
  color: var(--ngc-white);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.commercial-badge--available { background: var(--ngc-available); }
.commercial-badge--reserved  { background: var(--ngc-reserved); }
.commercial-badge--sold      { background: var(--ngc-sold); }

.commercial-ask {
  color: var(--ngc-ink);
}

.commercial-link {
  color: var(--ngc-accent);
  font-weight: 600;
  text-decoration: none;
}

.commercial-link:hover {
  text-decoration: underline;
}

.commercial-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 93px;
  min-height: 30px;
  padding: 0 16px;
  border-radius: 2px;
  background: var(--ngc-accent);
  color: var(--ngc-white);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s ease;
}

.commercial-btn:hover,
.commercial-btn:focus-visible {
  background: var(--ngc-accent-dark);
  color: var(--ngc-white);
}

.commercial-btn:focus-visible,
.commercial-link:focus-visible,
.commercial-cta__phone:focus-visible {
  outline: 2px solid var(--ngc-ink);
  outline-offset: 2px;
}

.commercial-btn--rent {
  background: var(--ngc-white);
  border: 1px solid var(--ngc-accent);
  color: var(--ngc-accent);
}

.commercial-btn--rent:hover,
.commercial-btn--rent:focus-visible {
  background: var(--ngc-accent);
  color: var(--ngc-white);
}

.commercial-btn {
  gap: 6px;
  white-space: nowrap;
}

.commercial-arrow {
  font-size: .9em;
  line-height: 1;
}

.commercial-section__note {
  margin: 0;
  padding: 12px 20px;
  background: var(--ngc-white);
  border-top: 1px solid var(--ngc-line);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ngc-muted);
}

.commercial-empty {
  margin: 24px 0 0;
  color: var(--ngc-muted);
}

.commercial-note {
  margin: 24px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ngc-muted);
}

/* ─── Sekcja z formularzem (widoczna, gdy nie ma JS-u) ─── */
.commercial-form {
  width: 100%;
  background: var(--ngc-bg);
  padding: 0 0 clamp(36px, 4vw, 64px);
}

.commercial-form__card {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 40px);
  background: var(--ngc-white);
}

.commercial-form__card h2 {
  margin: 0 0 20px;
  font-size: 24px;
}

.commercial-form__card input[type="text"],
.commercial-form__card input[type="email"],
.commercial-form__card input[type="tel"],
.commercial-form__card textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ngc-line);
  border-radius: 2px;
  font: 400 15px/1.4 'Nunito', sans-serif;
}

.commercial-form__card input[type="submit"] {
  padding: 12px 28px;
  border: 0;
  border-radius: 2px;
  background: var(--ngc-accent);
  color: var(--ngc-white);
  font-weight: 600;
  cursor: pointer;
}

.commercial-form__card input[type="submit"]:hover {
  background: var(--ngc-accent-dark);
}

.commercial-form__privacy {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ngc-muted);
}

/* ─── Pas kontaktowy ─── */
.commercial-cta {
  width: 100%;
  background: var(--ngc-bg);
  padding: 0 0 clamp(36px, 4vw, 64px);
}

.commercial-cta__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
  padding: clamp(24px, 3vw, 40px) clamp(20px, 2.5vw, 40px);
  background: var(--ngc-dark);
  color: var(--ngc-white);
}

.commercial-cta__text {
  flex: 1 1 420px;
}

.commercial-cta__eyebrow {
  margin: 0 0 8px;
  color: #6f8cf0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.commercial-cta__heading {
  margin: 0 0 8px;
  font-family: 'Nunito', sans-serif;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 700;
  color: var(--ngc-white);
}

.commercial-cta__lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #d6d6d6;
}

.commercial-cta__phone {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-height: 56px;
  padding: 0 32px;
  background: var(--ngc-accent);
  color: var(--ngc-white);
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 700;
  text-decoration: none;
  transition: background-color .15s ease;
}

.commercial-cta__phone:hover {
  background: var(--ngc-accent-dark);
  color: var(--ngc-white);
}

/* ───────── MODAL FORMULARZA ───────── */
.commercial-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 48px);
  background: rgba(12, 11, 10, 0.82);
  overflow-y: auto;
}

.commercial-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 620px;
  padding: clamp(24px, 3vw, 44px);
  background: var(--ngc-white, #fff);
  border-radius: 2px;
}

.commercial-modal__title {
  margin: 0 0 20px;
  padding-right: 44px;
  font-size: clamp(18px, 1.5vw, 24px);
  font-weight: 700;
}

.commercial-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid #e3e6ec;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
}

.commercial-modal__close:hover {
  border-color: #2f55d4;
}

.commercial-modal__close span {
  position: absolute;
  inset: 0;
}

.commercial-modal__close span::before,
.commercial-modal__close span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 1px;
  background: #1d1d1f;
}

.commercial-modal__close span::before { transform: translate(-50%, -50%) rotate(45deg); }
.commercial-modal__close span::after  { transform: translate(-50%, -50%) rotate(-45deg); }

/* Karta formularza wędruje do okna z sekcji na stronie — zdejmujemy jej
   własne tło i padding. */
.commercial-modal__body .commercial-form__card {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
}

/* ───────── RESPONSIVE ───────── */
@media (max-width: 992px) {
  .commercial-lead {
    max-width: 100%;
  }

  .commercial-table th,
  .commercial-table td {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Poniżej 740 px wiersz tabeli staje się kartą „etykieta | wartość”. */
@media (max-width: 740px) {
  .commercial-visual {
    flex: 1 1 100%;
    order: -1;
  }

  .commercial-table,
  .commercial-table tbody {
    display: block;
  }

  .commercial-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .commercial-row {
    display: block;
    margin: 0 0 12px;
    padding: 6px 0;
    background: var(--ngc-white);
    border: 1px solid var(--ngc-line);
  }

  .commercial-row[hidden] {
    display: none;
  }

  .commercial-table td {
    display: grid;
    grid-template-columns: 9em 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px 14px;
    border: 0;
  }

  .commercial-table td::before {
    content: attr(data-label);
    color: var(--ngc-accent);
    font-size: 12px;
    font-weight: 600;
  }

  .commercial-table td.commercial-cell--contact {
    width: auto;
  }

  .commercial-table .commercial-btn {
    width: 100%;
    max-width: none;
    min-height: 40px;
  }

  .commercial-cta__phone {
    width: 100%;
    justify-content: center;
  }

  .commercial-tab {
    flex: 1 1 100%;
  }
}

/* ─── Układ pól formularza CF7 (markup z formularza „Zapytanie o lokal”) ─── */
.commercial-form__card p {
  margin: 0 0 14px;
}

.commercial-form__card .cf-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.commercial-form__card .cf-row .cf-field {
  flex: 1 1 220px;
}

.commercial-form__card .cf-field {
  display: block;
}

.commercial-form__card .cf-label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ngc-muted, #5e5e5e);
}

.commercial-form__card input[readonly] {
  background: #f3f5f9;
}

.commercial-form__card .cf-meta {
  font-size: 13px;
  line-height: 1.5;
}

.commercial-form__card .cf-meta a {
  color: #2f55d4;
}

.commercial-form__card .wpcf7-not-valid-tip {
  font-size: 12px;
  color: #d14835;
}

.commercial-form__card .wpcf7-response-output {
  margin: 14px 0 0;
  padding: 10px 14px;
  font-size: 14px;
}
