/* =========================================================
   tablem3-theme.css
   Tutaj zarządzasz kolorystyką i odstępami tabeli / kart.
   ========================================================= */

:root {
  /* GŁÓWNE KOLORY */
  --page-bg: #ffffff;
  --card-bg: #ffffff;
  --table-head-bg: #eee9e6;
  --table-row-alt: #faf8f7;
  --text: #1f2933;
  --muted: #6b7280;
  --line: #e66b6b;

  /* AKCENT / PRZYCISKI */
  --accent: #0b3d2e;
  --accent-hover: #0f513d;
  --button-text: #ffffff;

  /* STATUSY */
  --status-free: #14833b;
  --status-reserved: #d97706;
  --status-sold: #b91c1c;
  --status-unavailable: #6b7280;

  /* WYGLĄD */
  --radius: 18px;
  --shadow: 0 12px 28px rgba(0, 0, 0, .10);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 16px;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font);
}

.np-listing {
  color: var(--text);
  font-family: var(--font);
}

.wrap {
  max-width: 100%;
  overflow: auto;
  background: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

/* =======================
   WIDOK DESKTOP
   ======================= */

.desktop-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  font-size: 15px;
  line-height: 1.35;
}

.desktop-table thead th {
  padding: 12px 10px;
  background: var(--table-head-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  text-align: left;
}

.desktop-table tbody td {
  padding: 11px 10px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

.desktop-table tbody tr:nth-child(even) {
  background: var(--table-row-alt);
}

/* =======================
   WIDOK MOBILE – KARTY
   ======================= */

.mobile-cards,
.show-next-wrap {
  display: none;
}

@media (max-width: 900px) {
  body {
    margin: 10px;
  }

  .wrap {
    overflow: visible;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .desktop-table {
    display: none;
  }

  .mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .mobile-card {
    display: none;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, .10);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .mobile-card.is-visible {
    display: block;
  }

  .mobile-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 12px;
    background: var(--table-head-bg);
    border-bottom: 1px solid rgba(0, 0, 0, .08);
  }

  .mobile-card__eyebrow {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
  }

  .mobile-card__title {
    color: var(--text);
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
  }

  .mobile-card__status {
    flex-shrink: 0;
    text-align: right;
  }

  .status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ffffff;
    font-size: 12px;
    line-height: 1;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
  }

  .status--free {
    color: var(--status-free);
  }

  .status--reserved {
    color: var(--status-reserved);
  }

  .status--sold {
    color: var(--status-sold);
  }

  .status--unavailable {
    color: var(--status-unavailable);
  }

  .mobile-card__main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(0, 0, 0, .08);
  }

  .metric {
    min-height: 74px;
    padding: 12px;
    background: var(--card-bg);
  }

  .metric__label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
  }

  .metric__value {
    display: block;
    color: var(--text);
    font-size: 18px;
    line-height: 1.2;
    font-weight: 900;
  }

  .price-box {
    padding: 8px 14px 12px;
  }

  .price-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(0, 0, 0, .10);
  }

  .price-row span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.25;
    font-weight: 750;
  }

  .price-row strong {
    color: var(--text);
    font-size: 15px;
    line-height: 1.2;
    font-weight: 900;
    text-align: right;
    white-space: nowrap;
  }

  .price-row--total {
    margin-top: 4px;
    padding-top: 12px;
    border-bottom: 0;
  }

  .price-row--total span,
  .price-row--total strong {
    color: var(--text);
  }

  .price-row--total strong {
    font-size: 17px;
  }

  .mobile-card__footer {
    padding: 0 14px 14px;
  }

  .pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--button-text);
    font-size: 16px;
    font-weight: 900;
    text-decoration: none;
    text-align: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }

  .pill-btn:hover {
    background: var(--accent-hover);
  }

  .show-next-wrap {
    position: sticky;
    bottom: 0;
    z-index: 999;
    display: flex;
    justify-content: center;
    padding: 14px 0 8px;
    background: linear-gradient(to top, rgba(255,255,255,.98), rgba(255,255,255,.78), rgba(255,255,255,0));
    margin-top: 4px;
  }

  .show-next {
    width: min(520px, 94vw);
    min-height: 52px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--button-text);
    padding: 14px 22px;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }

  .show-next:active {
    transform: scale(.99);
  }

  .show-next:disabled {
    opacity: .48;
    cursor: not-allowed;
  }
}

@media (max-width: 420px) {
  body {
    margin: 8px;
  }

  .mobile-card__header {
    padding: 12px;
  }

  .mobile-card__title {
    font-size: 25px;
  }

  .status {
    padding: 5px 8px;
    font-size: 11px;
  }

  .metric {
    min-height: 66px;
    padding: 10px;
  }

  .metric__label {
    font-size: 11px;
  }

  .metric__value {
    font-size: 16px;
  }

  .price-row {
    gap: 8px;
    padding: 8px 0;
  }

  .price-row span {
    font-size: 12px;
  }

  .price-row strong {
    font-size: 14px;
  }
}

