/* ========= DETALHES — detalhes-o-peso-invisivel.html ========= */

.detail-hero {
  padding: 6.5rem 0 6rem;
  background-image: radial-gradient(circle at 12% 8%, rgba(208,187,108,0.1), transparent 18%),
                    radial-gradient(circle at 88% 90%, rgba(208,187,108,0.05), transparent 22%),
                    radial-gradient(circle at top left, #1b3a57 0, #10283d 55%, #10283d 100%);
  color: #f9fafb;
}

.detail-hero .wrapper {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3.6rem;
  align-items: start;
}

.detail-cover {
  position: relative;
  overflow: visible;
  max-width: 360px;
}

.detail-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  pointer-events: none;
  box-shadow: none;
}

.detail-cover-card {
  background: transparent;
  border-radius: 4px;
  padding: 0;
  position: relative;
  z-index: 1;
  overflow: visible;
  cursor: zoom-in;
  transition: transform 0.18s ease;
}

.detail-cover-card:hover img {
  transform: scale(1.18);
}

.detail-cover-card img {
  display: block;
  width: 100%;
  border-radius: 2px;
  object-fit: contain;
  transition: transform 0.4s ease, box-shadow 0.18s ease;
  transform-origin: 100% 50%;
  will-change: transform;
  height: auto;
  max-width: 100%;
  border: none;
  position: relative;
  z-index: 1;
  box-shadow:
    0 0 0 1px rgba(208, 187, 108, 0.85),
    2px 2px 0 1px #f1e9d8,
    4px 4px 0 1px #e6dac0,
    6px 6px 0 1px #dccca8,
    8px 8px 0 1px #d2be90,
    12px 16px 30px rgba(0, 0, 0, 0.5);
}

.detail-cover-card .book-badge {
  top: auto;
  bottom: 20px;
  right: -14px;
  z-index: 20;
  transition: opacity 0.25s ease;
}

.detail-cover-card:hover .book-badge {
  opacity: 0;
}

.detail-badge {
  display: none;
  position: absolute;
  left: 50%;
  top: -1.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  background: rgba(16, 40, 61, 0.9);
  border: 1px solid rgba(208, 187, 108, 0.4);
  color: #e5e7eb;
  z-index: 15;
  white-space: nowrap;
  transform: translateX(-50%) translateZ(0);
}

.detail-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 2.6rem;
  line-height: 1.08;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.detail-subtitle {
  color: #e6d6a8;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.detail-highlight {
  background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  padding: 0.9rem 1rem;
  border-radius: 12px;
  display: inline-block;
  font-size: 0.95rem;
  color: #d9dee4;
  margin-bottom: 1.1rem;
}

.detail-highlight strong {
  color: #e5e7eb;
}

.detail-meta {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 1.6rem;
}

.detail-meta span + span::before {
  content: "•";
  margin: 0 0.45rem;
  opacity: 0.6;
}

.detail-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 0.75rem;
}

.detail-buttons .btn {
  padding: 0.82rem 1.15rem;
  border-radius: 12px;
  font-weight: 600;
  min-width: 140px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

/* Cores herdadas do sistema global de botões (.btn-primary / .btn-outline em styles.css) */

.detail-purchase {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.6rem 0 1rem;
}

.detail-purchase .price {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  background: none;
  padding: 0.1rem 0.25rem;
}

.detail-purchase .price-badge {
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  color: #e8ebee;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(16,40,61,0.45);
}

.detail-purchase .purchase-note {
  font-size: 0.85rem;
  color: #d9dee4;
}

.detail-price-note {
  font-size: 0.82rem;
  color: #9ca3af;
}

.detail-price-note strong {
  color: #e5e7eb;
}

.detail-section {
  padding: 3.5rem 0 0;
}

.detail-section .wrapper-narrow {
  max-width: 800px;
  margin: 0 auto;
}

.detail-section h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.detail-lead {
  font-size: 1rem;
  line-height: 1.8;
  color: #374151;
  text-align: justify;
  margin-bottom: 2.2rem;
}

.detail-grid-lista {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 3rem;
  margin-bottom: 2.5rem;
}

.detail-grid-lista ul {
  list-style: none;
  padding: 1rem;
  margin: 0;
}

.detail-grid-lista li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.7rem;
  font-size: 0.95rem;
  color: #374151;
}

.detail-grid-lista li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.05rem;
  font-size: 0.85rem;
  color: var(--primary);
}

.detail-tech-block {
  background: #f9fafb;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  padding: 1.6rem 1.8rem;
  margin-bottom: 3rem;
}

.detail-tech-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 3rem;
  font-size: 0.9rem;
}

.detail-tech-item dt {
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.1rem;
}

.detail-tech-item dd {
  margin: 0;
  color: #6b7280;
}

.detail-carousel {
  padding: 3rem 0 4rem;
  margin-top: 2rem;
}

.detail-carousel h2 {
  font-family: 'Cinzel', Georgia, serif;
  margin-bottom: 2rem;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
}

.carousel-container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
}

.detail-carousel-row {
  display: flex;
  gap: 1.75rem;
  overflow-x: auto;
  flex: 1;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 1rem 0.5rem 1.5rem;
  margin: -1rem -0.5rem -0.5rem;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

.detail-carousel-row::-webkit-scrollbar {
  display: none;
}

.detail-carousel-card {
  scroll-snap-align: start;
}

.carousel-nav {
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary-soft);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  position: relative;
  z-index: 10;
}

.carousel-nav:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  box-shadow: 0 8px 20px rgba(27, 58, 87, 0.35);
  transform: scale(1.08);
}

.carousel-nav:active {
  transform: scale(0.96);
}

.carousel-nav:active {
  transform: scale(0.95);
}

.carousel-nav svg {
  width: 20px;
  height: 20px;
}

.carousel-nav-prev {
  order: -1;
}

.carousel-nav-next {
  order: 1;
}

.detail-carousel-card {
  flex: 0 0 auto;
}

/* Estilo do card como mini página de livro */
.book-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  cursor: pointer;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}

.book-card-cover {
  width: 100px;
  height: 140px;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.book-card-cover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3%;
  bottom: 3%;
  width: 10%;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent);
  z-index: 2;
  pointer-events: none;
}

.book-card-cover img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
  box-shadow:
    1px 1px 0 1px #f1e9d8,
    2px 2px 0 1px #e6dac0,
    3px 3px 0 1px #dccca8,
    4px 4px 0 1px #d2be90,
    6px 8px 16px rgba(20, 12, 4, 0.35);
}

.book-card:hover .book-card-cover img {
  filter: brightness(0.86);
  transform: translateY(-4px);
  box-shadow:
    1px 1px 0 1px #f1e9d8,
    2px 2px 0 1px #e6dac0,
    3px 3px 0 1px #dccca8,
    4px 4px 0 1px #d2be90,
    8px 12px 20px rgba(20, 12, 4, 0.45);
}

/* Botão "Detalhes" no centro da capa */
.book-card-cover::after {
  content: 'Detalhes';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(208, 187, 108, 0.9);
  color: #16232f;
  padding: 0.4rem 0.8rem;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 5;
  letter-spacing: 0.5px;
}

.book-card:hover .book-card-cover::after {
  opacity: 1;
}

.book-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.5rem 0;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

.book-card-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
  word-break: break-word;
  text-align: center;
  transition: color 0.3s ease;
  white-space: normal;
  hyphens: auto;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.book-card:hover .book-card-title {
  color: var(--gold-deep);
}

/* ========= RESPONSIVO ========= */
@media (max-width: 900px) {
  .detail-hero {
    padding-top: 5rem;
  }

  .detail-hero .wrapper {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-cover {
    max-width: 320px;
    margin: 0 auto 1.5rem;
  }

  /* No celular a capa já fica centralizada na tela, então o zoom cresce a
     partir do centro — no desktop ele cresce a partir da borda direita pra
     não invadir a coluna de texto ao lado, o que aqui não existe. */
  .detail-cover-card img {
    transform-origin: 50% 50%;
  }

  .detail-title {
    font-size: 1.9rem;
  }

  .detail-grid-lista {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-tech-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .detail-buttons {
    flex-direction: column;
    gap: 0.9rem;
  }

  .detail-buttons .btn {
    width: 100%;
    text-align: center;
    padding: 0.9rem 1rem;
    font-size: 1rem;
  }

  .detail-purchase {
    justify-content: center;
    text-align: center;
    flex-direction: column;
  }

  .detail-purchase .price {
    font-size: 1.35rem;
  }
  
  /* Carrossel mobile com scroll touch */
  .detail-carousel-row {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 1.5rem;
    padding: 0.5rem 0;
  }
  
  .detail-carousel-row::-webkit-scrollbar {
    display: none;
  }
  
  .book-card {
    scroll-snap-align: start;
    /* Espaço pro título não encostar na capa (a sombra de "pilha de
       páginas" desce alguns pixels e invadia o texto) */
    gap: 0.9rem;
  }

  .book-card-info {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .carousel-nav {
    display: none;
  }

  /* Ajustar títulos do carrossel no mobile */
  .book-card-title {
    font-size: 0.8rem;
    line-height: 1.35;
    margin-top: 0.15rem;
    text-align: center;
    width: 100%;
    letter-spacing: 0.01em;
  }
  
  .book-card-cover::after {
    font-size: 0.6rem;
    padding: 0.3rem 0.6rem;
  }
}
