/* Search form styles */
.book-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  border: none;
}

.book-search-form input {
  border: 2px solid var(--ktn-light-blue);
  height: 2.5rem;
}

.book-search-form input::placeholder {
  font-size: 1rem;
  color: #9aa0a6;
  font-weight: 400;
  padding-left: 0.5rem;
}

.book-search-button {
  background-color: var(--ktn-light-blue);
  border: none;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
}

.book-search-button:hover {
  background-color: var(--ktn-dark-blue);
}

.book-search-button:hover img {
  filter: brightness(0) invert(1);
}

/* Table base styles */
.list-booksforsale {
  width: 100%;
  border-collapse: collapse;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 1rem;
}

/* Desktop table layout */
.list-booksforsale-header {
  display: table-header-group;
}

.list-booksforsale-header tr {
  display: table-row;
}

.list-booksforsale-header th {
  display: table-cell;
  text-align: left;
  font-weight: bold;
  padding: 1rem;
  font-size: 1.2rem;
  color: var(--ktn-dark-blue);
  border-bottom: 2px solid var(--ktn-dark-blue);
}

.list-booksforsale tbody {
  display: table-row-group;
}

.list-booksforsale tbody tr {
  display: table-row;
}

.list-booksforsale tbody tr:hover {
  background-color: #f9f9f9;
}

.list-booksforsale td {
  display: table-cell;
  text-align: left;
  padding: 1rem;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}



/* Kategorie jako pills */
.book-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-pill {
    display: inline-block;
    color: #000;
    background-color: var(--ktn-light-blue);
    border-radius: 12px;
    padding: 4px 12px;
    margin: 2px;
    font-size: 0.875rem;
    white-space: nowrap;
    }

.no-results {
  padding: 2rem;
  text-align: center;
  font-style: italic;
  color: #666;
}

/* Mobile responsive (max-width: 60em) */
@media (max-width: 60em) {
  .list-booksforsale-header {
    display: none;
  }

  .list-booksforsale {
    padding-top: 1rem;
    display: block;
  }

  .list-booksforsale tbody {
    display: block;
    width: 100%;
  }

  .list-booksforsale tbody tr {
    display: block;
    width: 100%;
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    box-sizing: border-box;
  }

  .list-booksforsale td {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: none;
    width: 100%;
    box-sizing: border-box;
  }

  .list-booksforsale td::before {
    content: attr(data-label) ": ";
    font-weight: bold;
    color: var(--ktn-dark-blue);
    flex-shrink: 0;
    min-width: 80px;
  }

  .book-category {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    flex: 1;
  }
}

/* Skrýt labely na desktopu */
.book-label {
  display: none;
}

@media (min-width: 60em) {
  .bookforsale {
    flex-wrap: nowrap;
  }
  
  .bookforsale > span {
    min-width: 0;
  }
}

@media (max-width: 60em) {
  .list-booksforsale-header {
    display: none;
  }

  .list-booksforsale {
    padding-top: 1rem;
}
  
  .bookforsale {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  /* Zobrazit labely na mobilech */
  .book-label {
    display: inline;
    font-weight: bold;
    color: var(--ktn-dark-blue);
    margin-right: 0.25rem;
  }

  .bookforsale {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
    align-items: start;
  }
  
  .label-mobile {
    font-weight: bold;
    text-align: left;
    padding-right: 0.5rem;
    color: var(--ktn-dark-blue);
  }
}