/* =========================================================
   Página Livros — complementa aulas.css
   ========================================================= */

.page-livros .aulas-card__badge.is-digital {
  background: rgba(34, 35, 34, 0.88);
}

.page-livros .aulas-card__badge.is-fisico {
  background: #f8ae2e;
  color: #222322;
}

.page-livros .course-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  width: auto;
  color: #222322;
  background: rgba(34, 35, 34, 0.06);
}

.page-livros .course-type.is-digital {
  background: rgba(3, 178, 101, 0.12);
  color: #028a4f;
}

.page-livros .course-type.is-fisico {
  background: rgba(248, 174, 46, 0.18);
  color: #8a5f00;
}

.page-livros .aulas-card .course-footer {
  flex-wrap: wrap;
  gap: 8px;
}

.page-livros .livros-planos {
  background: #f5f5f5;
  padding-top: 10px;
  padding-bottom: 40px;
}

/* =========================================================
   Detalhe do livro (venda)
   ========================================================= */

.page-livro-item #wrapper {
  background: #f5f5f5;
}

.livro-detail {
  padding: 28px 0 72px;
  background:
    radial-gradient(ellipse 55% 40% at 0% 0%, rgba(248, 174, 46, 0.08), transparent 60%),
    #f5f5f5;
}

.livro-detail__nav {
  margin-bottom: 20px;
}

.livro-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #6b6b6b !important;
  text-decoration: none !important;
  transition: color 0.2s ease, gap 0.2s ease;
}

.livro-detail__back:hover {
  color: #222322 !important;
  gap: 12px;
}

.livro-detail__back i {
  font-size: 12px;
  color: #f8ae2e;
}

.livro-detail__panel {
  background: #fff;
  border: 1px solid rgba(34, 35, 34, 0.06);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 12px 36px rgba(34, 35, 34, 0.06);
  margin-bottom: 24px;
  animation: livroFadeUp 0.55s ease both;
}

@keyframes livroFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Galeria --- */
.livro-gallery {
  position: relative;
  margin-bottom: 16px;
}

.livro-gallery__main {
  position: relative;
  background:
    linear-gradient(160deg, #fafafa 0%, #f0f0f0 100%);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(34, 35, 34, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 28px;
}

.livro-gallery__main .tab-pane {
  width: 100%;
  text-align: center;
}

.livro-gallery__main img {
  max-width: 100%;
  width: auto !important;
  height: auto !important;
  max-height: 460px;
  object-fit: contain;
  border-radius: 4px;
  box-shadow:
    0 18px 40px rgba(34, 35, 34, 0.18),
    0 2px 0 rgba(255, 255, 255, 0.4) inset;
  transition: transform 0.35s ease;
}

.livro-gallery:hover .livro-gallery__main img {
  transform: scale(1.02);
}

.livro-gallery__badge {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 3;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: rgba(34, 35, 34, 0.88);
}

.livro-gallery__badge.is-fisico {
  background: #f8ae2e;
  color: #222322;
}

.livro-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.livro-gallery__thumbs .nav-item {
  margin: 0;
}

.livro-gallery__thumbs a {
  display: block;
  width: 72px;
  height: 88px;
  padding: 4px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.livro-gallery__thumbs a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

.livro-gallery__thumbs a.active,
.livro-gallery__thumbs a:hover {
  border-color: #f8ae2e;
  box-shadow: 0 4px 12px rgba(248, 174, 46, 0.25);
}

/* --- Painel de compra --- */
.livro-buy {
  padding: 8px 4px 4px 12px;
}

.livro-buy__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.livro-buy__discipline {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f8ae2e;
}

.livro-buy .course-type {
  margin: 0;
}

.livro-buy__title {
  margin: 0 0 10px;
  font-size: clamp(24px, 3.2vw, 24px);
  font-weight: 700;
  line-height: 1.2;
  color: #222322;
  font-family: var(--font_family_heading);
}

.livro-buy__author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 14px;
  color: #6b6b6b;
}

.livro-buy__author i {
  color: #f8ae2e;
  font-size: 13px;
}

.livro-buy__rating {
  margin: 0 0 18px;
}

.livro-buy__rating .rating-count {
  color: #6b6b6b;
  font-size: 13px;
}

.livro-buy__price {
  margin: 0 0 22px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: #222322;
  font-family: var(--font_family_heading);
  letter-spacing: -0.02em;
}

.livro-buy__price.is-free {
  color: #03b265;
  font-size: 28px;
}

.livro-buy__actions .action-area {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.livro-buy__actions .action-area > li {
  width: auto;
}

.page-livro-item .cart-btn-add,
.page-livro-item .cart-btn,
.page-aula-item .cart-btn-add,
.page-aula-item .cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 200px;
  height: 52px;
  padding: 0 28px;
  border: none;
  border-radius: 14px;
  background: #222322;
  color: #fff !important;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font_family_heading);
  cursor: pointer;
  text-decoration: none !important;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 20px rgba(34, 35, 34, 0.18);
}

.page-livro-item .cart-btn-add:hover,
.page-livro-item .cart-btn:hover,
.page-aula-item .cart-btn-add:hover,
.page-aula-item .cart-btn:hover {
  background: #f8ae2e;
  color: #222322 !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(248, 174, 46, 0.35);
}

.livro-buy__unavailable {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(34, 35, 34, 0.06);
  color: #6b6b6b;
  font-size: 14px;
  font-weight: 600;
}

#frm_retorno_msg {
  margin-top: 12px;
  max-width: 360px;
}

#frm_retorno_msg .alert {
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 0;
}

.livro-buy__share {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.livro-buy__share > li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.livro-buy__share-label {
  font-size: 13px;
  font-weight: 600;
  color: #6b6b6b;
}

.livro-buy__share .social {
  margin: 0;
  padding: 0;
  list-style: none;
}

.livro-buy__share .social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(3, 178, 101, 0.12);
  color: #03b265 !important;
  font-size: 18px;
  transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.livro-buy__share .social a:hover {
  background: #03b265;
  color: #fff !important;
  transform: translateY(-2px);
}

.livro-buy__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0;
  padding: 18px 0 0;
  list-style: none;
  border-top: 1px solid rgba(34, 35, 34, 0.08);
}

.livro-buy__trust li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #6b6b6b;
}

.livro-buy__trust i {
  color: #f8ae2e;
  font-size: 13px;
}

/* --- Abas descrição / avaliações --- */
.livro-detail__tabs {
  background: #fff;
  border: 1px solid rgba(34, 35, 34, 0.06);
  border-radius: 20px;
  padding: 8px 28px 28px;
  box-shadow: 0 12px 36px rgba(34, 35, 34, 0.06);
  animation: livroFadeUp 0.65s ease 0.08s both;
}

.livro-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 20px;
  padding: 12px 0;
  list-style: none;
  border-bottom: 1px solid rgba(34, 35, 34, 0.08);
}

.livro-tabs .nav-item {
  margin: 0;
}

.livro-tabs a {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #6b6b6b !important;
  text-decoration: none !important;
  border: none !important;
  background: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.livro-tabs a:hover {
  color: #222322 !important;
  background: rgba(34, 35, 34, 0.05);
}

.livro-tabs a.active {
  background: #222322 !important;
  color: #fff !important;
}

.livro-desc {
  font-size: 15px;
  line-height: 1.75;
  color: #3a3a3a;
  max-width: 820px;
}

.livro-reviews {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.livro-review.review-box {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid rgba(34, 35, 34, 0.06);
  border-radius: 14px;
  background: #fafafa;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.livro-review.review-box:hover {
  border-color: rgba(248, 174, 46, 0.35);
  box-shadow: 0 6px 18px rgba(34, 35, 34, 0.05);
}

.livro-review__avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0;
}

.livro-review__avatar img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #ececec;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(34, 35, 34, 0.08);
}

.livro-review__body {
  flex: 1;
  min-width: 0;
  padding: 0 !important;
}

.livro-review__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.livro-review__who {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.livro-review__name {
  font-size: 13px;
  font-weight: 600;
  color: #222322;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.livro-review .rating-date {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  color: #9a9a9a;
}

.livro-review__stars {
  margin: 0;
  padding: 0;
  list-style: none;
  display: inline-flex;
  gap: 2px;
}

.livro-review__stars li {
  margin: 0;
  font-size: 11px;
  color: #f8ae2e;
}

.livro-review__stars .far.fa-star {
  color: #d4d4d4;
}

.livro-review__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: #4a4a4a;
}

.livro-reviews__empty {
  text-align: center;
  padding: 36px 16px;
  color: #6b6b6b;
  font-size: 14px;
  border-radius: 14px;
  background: #fafafa;
  border: 1px dashed rgba(34, 35, 34, 0.1);
}

.livro-reviews__empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(248, 174, 46, 0.16);
  color: #222322;
  font-size: 18px;
}

.livro-reviews__empty p {
  margin: 0;
  line-height: 1.55;
}

/* --- Relacionados --- */
.livro-related {
  margin-top: 36px;
  padding: 28px 28px 12px;
  background: #fff;
  border: 1px solid rgba(34, 35, 34, 0.06);
  border-radius: 20px;
  box-shadow: 0 12px 36px rgba(34, 35, 34, 0.06);
  animation: livroFadeUp 0.7s ease 0.12s both;
}

.livro-related__head {
  margin-top: 0;
  margin-bottom: 24px;
  align-items: flex-end;
}

.livro-related__eyebrow {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(248, 174, 46, 0.18);
  color: #222322;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.livro-related__all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #222322 !important;
  text-decoration: none !important;
  transition: gap 0.2s ease, color 0.2s ease;
  margin-bottom: 4px;
}

.livro-related__all:hover {
  color: #f8ae2e !important;
  gap: 12px;
}

.livro-related .aulas-card-link {
  margin-bottom: 20px;
}

.livro-related .aulas-card .title {
  font-size: 15px !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.livro-related .aulas-card .sub-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 991px) {
  .livro-buy {
    padding: 24px 0 0;
  }

  .livro-gallery__main {
    min-height: 320px;
  }
}

@media (max-width: 767px) {
  .livro-detail {
    padding: 18px 0 56px;
  }

  .livro-detail__panel,
  .livro-detail__tabs {
    padding: 18px 16px 20px;
    border-radius: 16px;
  }

  .livro-related {
    margin-top: 24px;
    padding: 18px 14px 6px;
    border-radius: 16px;
  }

  .livro-related__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .livro-gallery__main {
    min-height: 280px;
    padding: 18px;
  }

  .livro-buy__price {
    font-size: 28px;
  }

  .page-livro-item .cart-btn-add,
  .page-livro-item .cart-btn,
  .page-aula-item .cart-btn-add,
  .page-aula-item .cart-btn {
    width: 100%;
  }

  .livro-buy__trust {
    flex-direction: column;
    gap: 8px;
  }

  .livro-tabs {
    gap: 6px;
  }

  .livro-tabs a {
    padding: 8px 12px;
    font-size: 13px;
  }
}
