.api-indicator {
  position: absolute;
  background: #f9ab45;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  right: 6px;
}

.book-grid {
  display: grid;
  gap: 1.5rem;
  padding: 1rem 0;
}

.book-grid--cols-7 {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.book-grid:has(.book-card--skeleton) {
  display: grid;
}

.book {
  background: url(/img/book-paper.png);
  background-size: 100% 100%;
  perspective: 1000px;
  width: 175px;
  height: 255px;
  border-radius: 4px;
}

.book img {
  width: 175px;
  height: 255px;
  transition: 1s cubic-bezier(0.25, 1, 0.5, 1);
  transform: rotate(0);
  transform-origin: left;
  border-radius: 4px;
  filter: drop-shadow(0px 20px 13px rgba(27, 37, 58, 0.1)) drop-shadow(0px 8px 5px rgba(27, 37, 58, 0.06));
}

.book:before {
  content: "";
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0%, rgba(255, 255, 255, 0.4) 100%);
  width: 2px;
  margin-left: 8px;
  height: 100%;
  display: block;
  position: absolute;
  z-index: 2;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.book:hover img {
  transition: 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  transform: rotateY(-40deg);
  pointer-events: none;
}

.book:hover:before {
  margin-left: 6px;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
}

/* ── btn-top50 ── */
.btn-top50 {
  position: relative;
  display: inline-block;
  padding: 12px 28px !important;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff7043, #ff5722);
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 1rem;
  text-decoration: none;
  transition: box-shadow 0.3s ease, color 0.3s ease;
  border: 1px solid rgba(255, 87, 34, 0.2);
  box-shadow: 0 2px 8px rgba(255, 87, 34, 0.15);
}

.btn-top50-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-top50:hover {
  box-shadow: 0 6px 16px rgba(33, 150, 243, 0.3);
  color: #fff !important;
  text-decoration: none;
}

/* ── btn-top50-green ── */
.btn-top50-green {
  position: relative;
  display: inline-block;
  padding: 12px 28px !important;
  border-radius: 12px;
  background: linear-gradient(135deg, #24b04f, #1e8e43);
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 1rem;
  text-decoration: none;
  transition: box-shadow 0.3s ease, color 0.3s ease;
  border: 1px solid rgba(36, 176, 79, 0.2);
  box-shadow: 0 2px 8px rgba(36, 176, 79, 0.15);
}

.btn-top50-green-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-top50-green:hover {
  box-shadow: 0 6px 16px rgba(36, 176, 79, 0.25);
  color: #fff !important;
  text-decoration: none;
}

/* ── Locked state ── */
.book-item.book-locked:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2;
  border-radius: 8px 8px 0 0;
}

.book-item.book-locked .lock-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: url('/img/icon-lock-item.svg') no-repeat center center;
  background-size: 50px;
  width: 50px;
  height: 67px;
  z-index: 3;
  cursor: pointer;
}

/* ── Grade filter pills ── */
.bg-grades1 { background: linear-gradient(45deg, #3B82F6, #2563EB); }
.bg-grades2 { background: linear-gradient(45deg, #F97316, #EA580C); }
.bg-grades3 { background: linear-gradient(45deg, #10B981, #059669); }

.grade-filters {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.grade-filters .pill-bubble {
  padding: 6px 12px;
  font-size: 0.9em;
}

.filter-pill {
  border: none;
  border-radius: 20px;
  font-weight: 500;
  transition: all 0.2s ease;
  opacity: 1;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.filter-pill.active { opacity: 1 !important; }
.filter-pill:not(.active) { opacity: 0.6; }

.pill-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 12px 25px;
  border-radius: 50px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  color: white;
  cursor: pointer;
  background-size: 200% auto;
}

.pill-bubble:hover {
  background-position: right center;
  box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(255, 255, 255, 0.15) inset;
}

.emoji-wrapper {
  margin-right: 6px;
  font-size: 1.1rem;
  display: inline-block;
  position: relative;
  z-index: 2;
  padding: 4px;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.emoji-wrapper::before {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  background: white;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.4s ease;
}

.pill-bubble:hover .emoji-wrapper { transform: rotate(15deg) scale(1.1); }
.pill-bubble:hover .emoji-wrapper::before {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ── Keyframes ── */
@keyframes spinner-border {
  to { transform: rotate(360deg); }
}

@keyframes shine {
  0%   { transform: translateX(-150%) rotate(45deg); }
  100% { transform: translateX(150%) rotate(45deg); }
}

/* ── Grid wrapper ── */
.wrapper-book-item-and-amazon {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ── Book Card ── */
.book-card {
  --book-surface: #ffffff;
  --book-border: rgba(15, 23, 42, 0.08);
  --book-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 8px 28px rgba(15,23,42,0.07);
  --book-shadow-hover: 0 2px 4px rgba(15,23,42,0.04), 0 20px 48px rgba(15,23,42,0.12);
  --book-indigo: #4f46e5;
  --book-text: #111827;
  --book-muted: #6b7280;
  --book-chip-bg: #f3f4f6;
  --book-radius: 18px;
  position: relative; display: flex; flex-direction: column;
  height: 100%; background: var(--book-surface);
  border-radius: var(--book-radius); border: 1px solid var(--book-border);
  box-shadow: var(--book-shadow); overflow: hidden;
  transition: box-shadow 0.28s ease, border-color 0.28s ease;
}

.book-card--featured { border-color: rgba(79,70,229,0.22); }
.book-card:focus-within { box-shadow: var(--book-shadow-hover), 0 0 0 3px rgba(79,70,229,0.28); }

/* ── Book Item (article) ── */
.book-item {
  position: relative;
  overflow: hidden;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ── Media (capa) ── */
.book-item-media {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 0;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 55%);
}
.book-cover-frame { position: relative; aspect-ratio: 3/4; width: 100%; border-radius: 14px; overflow: hidden; background: linear-gradient(145deg, #f3f4f6, #e5e7eb); }
.book-card .book-cover { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }

/* ── Badge de rank ── */
.book-badge {
  position: absolute; top: 8px; left: 8px; z-index: 4;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px 5px 9px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  color: #fff; background: rgba(15,23,42,0.42);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.22); box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.book-badge__icon { font-size: 0.68rem; opacity: 0.92; }
.book-badge__rank { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Body ── */
.book-card .book-body { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 16px; }
.book-title { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.015em; color: var(--book-text, #111827); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-author { margin: -4px 0 0; font-size: 0.875rem; font-weight: 500; color: var(--book-muted, #6b7280); }

/* ── Chips de meta ── */
.book-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.book-meta-item { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; color: #111827; background: #f3f4f6; border: 1px solid rgba(15,23,42,0.06); }
.book-meta-icon { font-size: 0.72rem; color: #6b7280; }

/* ── Tags (tipo e nível BT) ── */
.book-tags-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.book-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em; border: 1px solid transparent; }
.book-tag--type  { color: #312e81; background: #eef2ff; border-color: rgba(99,102,241,0.18); }
.book-tag--cool  { color: #1e40af; background: #eff6ff; border-color: rgba(59,130,246,0.35); }
.book-tag--spark { color: #c2410c; background: #fff7ed; border-color: rgba(249,115,22,0.38); }
.book-tag--fire  { color: #166534; background: #f0fdf4; border-color: rgba(34,197,94,0.38); }
.book-tag__label { display: inline-flex; align-items: baseline; gap: 4px; }
.book-tag__meta  { font-weight: 500; color: #1f2937; }

/* ── ISBN row ── */
.isbn-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; width: 100%; margin-top: auto;
  padding: 8px 2px 2px; border: none; background: transparent;
  cursor: pointer; text-align: left; color: #374151;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.01em;
  transition: color 0.2s ease;
}
.isbn-row:hover { color: #1f2937; }
.isbn-row__code { font-variant-numeric: tabular-nums; color: #111827; font-weight: 600; }
.isbn-row__action { font-size: 0.85rem; color: #4b5563; transition: color 0.2s ease; }
.isbn-row:focus-visible { outline: none; border-radius: 8px; box-shadow: 0 0 0 2px rgba(79,70,229,0.25); }

/* ── Amazon CTA (acima da capa) ── */
.book-item-media .book-card-cta { flex-shrink: 0; width: 100%; padding: 0; background: transparent; }
.book-card .btn-amazon {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin: 0; min-height: 40px; padding: 8px 12px;
  border-radius: 12px; border: 1px solid #f0b800; background: #ffd814;
  color: #0f1111 !important; text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(15,17,17,0.08), inset 0 1px 0 rgba(255,255,255,0.35);
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  position: relative; overflow: hidden;
}
.book-card .btn-amazon:hover { background: #f7ca00; border-color: #e6a800; }
.book-card .btn-amazon__logo { width: 100%; height: 32px; object-fit: contain; display: block; }
.book-card .btn-amazon::before { display: none; }
.book-card .btn-amazon:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(15,17,17,0.35); }

/* ── Skeleton loading ── */
.book-card--skeleton { pointer-events: none; }
.book-card-skeleton-media {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 18px 0;
}
.book-card-skeleton-cover {
  aspect-ratio: 3/4;
  border-radius: 14px;
  background: linear-gradient(90deg, #f3f4f6 0%, #eceff3 45%, #f3f4f6 90%);
  background-size: 200% 100%;
  animation: book-card-shimmer 1.2s ease-in-out infinite;
}
.book-card-skeleton-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.book-card-skeleton-line {
  height: 12px; border-radius: 8px;
  background: linear-gradient(90deg, #f3f4f6 0%, #eceff3 45%, #f3f4f6 90%);
  background-size: 200% 100%; animation: book-card-shimmer 1.2s ease-in-out infinite;
}
.book-card-skeleton-line--lg  { width: 88%; height: 14px; }
.book-card-skeleton-line--md  { width: 62%; }
.book-card-skeleton-line--sm  { width: 48%; height: 10px; }
.book-card-skeleton-chips     { display: flex; gap: 8px; }
.book-card-skeleton-chip      { width: 56px; height: 22px; border-radius: 999px; background: linear-gradient(90deg, #f3f4f6 0%, #eceff3 45%, #f3f4f6 90%); background-size: 200% 100%; animation: book-card-shimmer 1.2s ease-in-out infinite; }
.book-card-skeleton-cta       { height: 40px; border-radius: 12px; background: linear-gradient(90deg, #e5e7eb 0%, #d1d5db 50%, #e5e7eb 100%); background-size: 200% 100%; animation: book-card-shimmer 1.2s ease-in-out infinite; }
@keyframes book-card-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Badges de grade ── */
.s-badge {
  position: absolute;
  top: 6px;
  left: 5px;
  background-color: #ff9800;
  color: white;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  z-index: 5 !important;
}

.list-group-item { font-size: 15px; }

@media (max-width: 1000px) {
  .book-grid--cols-7 {
    gap: 1rem;
  }
}
