/* ============================================================
   SEARCH PAGE — search.css
   ============================================================ */

.sr-page { background: #f7f8fc; min-height: 100vh; padding: 1.5rem 0 4rem; }


/* ============================================================
   RESULTS AREA
   ============================================================ */
.sr-results { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }


/* Toolbar */
.sr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.sr-toolbar__left { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; flex: 1; min-width: 0; }
.sr-toolbar__right { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

.sr-result-count { font-size: .85rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.sr-result-count span { color: #4169e1; }


.sr-sort {
  padding: .45rem .75rem;
  border: 1.5px solid #e4e5ee;
  border-radius: 8px;
  font-size: .82rem;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
}
.sr-sort:focus { border-color: #4169e1; }

.sr-view-btns { display: flex; gap: .2rem; }
.sr-view-btn {
  width: 34px; height: 34px;
  border: 1.5px solid #e4e5ee;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-muted);
}
.sr-view-btn svg { width: 16px; height: 16px; stroke: currentColor; }
.sr-view-btn.active { background: #4169e1; border-color: #4169e1; color: #fff; }
.sr-view-btn:hover:not(.active) { border-color: #c5cbee; color: var(--text); }

.sr-mobile-filter-btn {
  display: none;
  align-items: center;
  gap: .35rem;
  padding: .45rem .85rem;
  border: 1.5px solid #e4e5ee;
  border-radius: 8px;
  background: #fff;
  font-size: .82rem;
  font-weight: 700;
  font-family: var(--font);
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
}
.sr-mobile-filter-btn svg { width: 16px; height: 16px; stroke: currentColor; }
.sr-mobile-filter-btn:hover { border-color: #4169e1; color: #4169e1; }

/* ============================================================
   GRID VIEW
   ============================================================ */
.sr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 1rem;
}

/* List view override */
.sr-grid.list-view {
  grid-template-columns: 1fr;
  gap: .75rem;
}
.sr-grid.list-view .book-card {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  padding: .85rem;
  border-radius: 12px;
  border: 1px solid #e4e5ee;
  background: #fff;
}
.sr-grid.list-view .book-card__img-wrap {
  width: 72px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
}
.sr-grid.list-view .book-card__img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.sr-grid.list-view .book-card__body { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.sr-grid.list-view .book-card__title { font-size: .95rem; font-weight: 700; }
.sr-grid.list-view .book-card__footer { display: flex; align-items: center; justify-content: space-between; }

.sr-tag {
  padding: .25rem .8rem;
  background: #f0f1f7;
  border: 1px solid #e4e5ee;
  border-radius: 9999px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  transition: all .15s;
}
.sr-tag:hover { background: #eef0fa; border-color: #c5cbee; color: #4169e1; }

/* Highlight matched text */
.sr-highlight { background: #fef3c7; color: #b45309; border-radius: 3px; padding: 0 2px; font-weight: 700; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.sr-empty {
  background: #fff;
  border: 1px solid #e4e5ee;
  border-radius: 16px;
  padding: 3.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.sr-empty__icon { font-size: 3.5rem; }
.sr-empty h2 { font-size: 1.2rem; font-weight: 800; }
.sr-empty p  { font-size: .88rem; color: var(--text-muted); }
.sr-suggestions { margin-top: .5rem; }
.sr-suggestions p { font-size: .82rem; color: var(--text-muted); margin-bottom: .5rem; }
.sr-suggestions__tags { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   PAGINATION
   ============================================================ */
.sr-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding-top: .5rem;
}
.sr-page-btn {
  width: 36px; height: 36px;
  border: 1.5px solid #e4e5ee;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-muted);
}
.sr-page-btn svg { width: 16px; height: 16px; stroke: currentColor; }
.sr-page-btn:hover:not(:disabled) { border-color: #4169e1; color: #4169e1; }
.sr-page-btn:disabled { opacity: .35; cursor: not-allowed; }
.sr-page-nums { display: flex; gap: .3rem; }
.sr-page-num {
  width: 36px; height: 36px;
  border: 1.5px solid #e4e5ee;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text-muted);
  transition: all .15s;
}
.sr-page-num:hover { border-color: #4169e1; color: #4169e1; }
.sr-page-num.active { background: #4169e1; border-color: #4169e1; color: #fff; }
.sr-page-num--dots { border: none; background: none; cursor: default; color: #aaa; }

/* Skeleton loader */
.sr-skeleton {
  background: #fff;
  border: 1px solid #e4e5ee;
  border-radius: 12px;
  overflow: hidden;
}
.sr-skeleton__img  { height: 180px; background: linear-gradient(90deg, #f0f1f7 25%, #e8e9f0 50%, #f0f1f7 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.sr-skeleton__body { padding: .75rem; display: flex; flex-direction: column; gap: .4rem; }
.sr-skeleton__line { height: 10px; border-radius: 6px; background: linear-gradient(90deg, #f0f1f7 25%, #e8e9f0 50%, #f0f1f7 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.sr-skeleton__line--short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 768px) {
  .sr-grid { grid-template-columns: repeat(3, 1fr); gap: .75rem; }
  .sr-toolbar { flex-direction: column; align-items: stretch; gap: .75rem; }
  .sr-toolbar__left { justify-content: space-between; }
  .sr-toolbar__right { justify-content: space-between; }
  .sr-page { padding: 1rem 0; }
  .sr-sort { flex: 1; }
}

@media (max-width: 600px) {
  .sr-grid { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
  .sr-toolbar { gap: .5rem; }
  .sr-toolbar__left { flex-direction: column; gap: .5rem; }
  .sr-toolbar__right { width: 100%; }
  .sr-sort { font-size: .75rem; padding: .4rem .55rem; flex: 1; }
  .sr-view-btns { display: none; }
  .sr-card__body { padding: .5rem; }
  .sr-card__title { font-size: .78rem; }
  .sr-card__author { font-size: .7rem; }
  .sr-card__price { font-size: .85rem; }
  .sr-empty { padding: 2rem 1rem; }
  .sr-empty h2 { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  .sr-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .sr-card__img-wrap { aspect-ratio: 2/3; }
  .sr-card__body { padding: .45rem; }
  .sr-card__title { font-size: .75rem; -webkit-line-clamp: 2; line-clamp: 2; }
  .sr-card__author { font-size: .65rem; }
  .sr-card__price { font-size: .8rem; }
  .sr-result-count { font-size: .85rem; }
}
