/* public/assets/ui/framework/12_profile_public_tables.css
   KomodUI Public Profile Tables v0.1
   Mobile-safe price tables: no layout break, scroll, sticky header, better tap.
*/

/* Wrap is already in markup: .pp-table-wrap */
.pp-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;

  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-white);

  /* prevents parent flex/grid from stretching */
  min-width: 0;
}

/* Keyboard focus (wrap has tabindex=0) */
.pp-table-wrap:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

/* The table itself */
.pp-price-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;

  /* Critical: allow scrolling by giving table a min width */
  min-width: 560px;
}

/* Cells */
.pp-price-table th,
.pp-price-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.pp-price-table tr:last-child td {
  border-bottom: 0;
}

/* Header row */
.pp-price-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;

  background: var(--color-bg-body);
  color: var(--color-text-heading);
  font-weight: 800;
}

/* Better readability for long service titles */
.pp-price-table td:first-child {
  white-space: normal;
  max-width: 520px;
}

/* Price column typically last */
.pp-price-table td:last-child,
.pp-price-table th:last-child {
  text-align: right;
  font-weight: 700;
}

/* Row hover (desktop) */
@media (hover: hover) and (pointer: fine) {
  .pp-price-table tbody tr:hover td {
    background: rgba(79, 70, 229, 0.04);
  }
}

/* Mobile tuning */
@media (max-width: 576px) {
  .pp-table-wrap {
    border-radius: var(--radius-md);
  }

  .pp-price-table {
    min-width: 520px;
  }

  .pp-price-table th,
  .pp-price-table td {
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  .pp-price-table td:first-child {
    max-width: 420px;
  }
}

/* Ultra small devices */
@media (max-width: 360px) {
  .pp-price-table {
    min-width: 500px;
  }
}  