.price-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-bright);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
  th {
    background-color: var(--color-primary);
    color: var(--color-bright);
    padding: 0.75rem;
    text-align: left;
  }

  td {
    padding-block: 0.5rem;
    padding-inline: 0.75rem;
    border-bottom: 1px solid var(--color-border);
  }
}

.price-table tr:last-child td {
  border-bottom: none;
}

.price-table tr:not(.category-header):hover {
  background-color: var(--color-background);
}

.category-header {
  background-color: var(--color-secondary);
  color: var(--color-bright);
  font-size: 1.1rem;
}

section:first-of-type .price-table {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

section:nth-of-type(2) .price-table {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

@media (max-width: 768px) {
  .price-table,
  .price-table thead,
  .price-table tbody,
  .price-table th,
  .price-table td,
  .price-table tr {
    display: block;
  }

  .price-table {
    border-radius: 0;
    box-shadow: none;

    thead tr {
      position: absolute;
      top: -9999px;
      left: -9999px;
    }

    tr {
      border-bottom: 1px solid var(--color-border);
      margin-bottom: 0.5rem;
      padding-inline: 0.75rem;

      &:last-child {
        border-bottom: none;
        margin-bottom: 0;
      }
    }

    td {
      border: none;
      position: relative;
      padding-left: 4rem;
      text-align: right;
      min-height: 30px;

      &::before {
        position: absolute;
        top: 0.5rem;
        left: 0.5rem;
        width: 35%;
        white-space: nowrap;
        font-weight: bold;
        text-align: left;
      }
    }
  }

  .price-table tr:not(.category-header) td:nth-of-type(1):before {
    content: "Usługa";
  }

  .price-table tr:not(.category-header) td:nth-of-type(2):before {
    content: "Czas";
  }

  .price-table tr:not(.category-header) td:nth-of-type(3):before {
    content: "Cena";
  }

  .category-header {
    text-align: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    td {
      padding-left: 0;
      text-align: center;

      &::before {
        content: none;
      }
    }
  }
}

@media (min-width: 992px) {
  .price-table {
    font-size: 1rem;

    th,
    td {
      padding: 1rem;
    }
  }

  section:first-of-type .price-table th:first-child {
    border-top-left-radius: 8px;
  }

  section:first-of-type .price-table th:last-child {
    border-top-right-radius: 8px;
  }
}
