/* ===========================
   ESTILO GERAL
=========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ===========================
   TOPO VERMELHO
=========================== */
.topo-vermelho {
  background-color: #c41e3a;
  padding: 15px 0;
}

.topo-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo img {
  height: 50px;
  width: auto;
}

.busca-topo {
  flex: 1;
  max-width: 500px;
}

.busca-topo form {
  display: flex;
}

.busca-topo input {
  flex: 1;
  padding: 10px 15px;
  border: none;
  border-radius: 4px 0 0 4px;
  font-size: 14px;
}

.busca-topo button {
  padding: 10px 20px;
  background-color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  color: #c41e3a;
  font-size: 16px;
  font-weight: bold;
}

.busca-topo button:hover {
  background-color: #f0f0f0;
}

.botoes-topo {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-topo {
  padding: 10px 20px;
  background-color: #fff;
  color: #c41e3a;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.3s;
}

.btn-topo:hover {
  background-color: #f0f0f0;
  color: #c41e3a;
  text-decoration: none;
}

/* Added user dropdown styles for logged-in users */
.user-dropdown {
  position: relative;
}

.btn-user-dropdown {
  padding: 10px 20px;
  background-color: #fff;
  color: #c41e3a;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.btn-user-dropdown:hover {
  background-color: #f0f0f0;
}

.btn-user-dropdown i.fa-user-circle {
  font-size: 18px;
}

.btn-user-dropdown i.fa-chevron-down {
  font-size: 12px;
  transition: transform 0.3s;
}

.user-dropdown.active .btn-user-dropdown i.fa-chevron-down {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.user-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.3s;
  border-bottom: 1px solid #f0f0f0;
}

.user-dropdown-menu .dropdown-item:last-child {
  border-bottom: none;
}

.user-dropdown-menu .dropdown-item:hover {
  background-color: #f8f8f8;
  color: #c41e3a;
}

.user-dropdown-menu .dropdown-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* ===========================
   MENU PRINCIPAL
=========================== */
.menu-principal {
  background-color: #1e3a5f;
}

.menu-principal ul {
  list-style: none;
  display: flex;
}

.menu-principal li {
  flex: 1;
}

.menu-principal a {
  display: block;
  padding: 15px 20px;
  color: #fff;
  text-decoration: none;
  text-align: center;
  font-weight: 500;
  transition: background-color 0.3s;
}

.menu-principal a:hover {
  background-color: #2c5282;
}

/* ===========================
   BANNER ROTATIVO
=========================== */
.banner-rotativo {
  width: 100%;
  height: 357px;
  position: relative;
  overflow: hidden;
  margin-bottom: 40px;
}

.banner-slide {
  display: none;
  width: 100%;
  height: 100%;
}

.banner-slide.active {
  display: block;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.banner-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.3s;
}

.banner-dot.active {
  background-color: #fff;
}

/* ===========================
   SEÇÕES
=========================== */
.secao {
  background-color: #f5f5f5;
  padding: 40px 0;
}

.secao-titulo {
  font-size: 24px;
  color: #333;
  margin-bottom: 30px;
  font-weight: bold;
  text-align: left;
  padding-bottom: 15px;
  border-bottom: 2px solid #ddd;
}

.ebooks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ===========================
   CARD DO EBOOK
=========================== */
.ebook-card {
  background-color: #fff;
  border-radius: 4px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}

.ebook-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.badge-desconto {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #4a90e2;
  color: #fff;
  padding: 5px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
}

.ebook-capa {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
}

.ebook-titulo {
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
  min-height: 40px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.ebook-preco {
  font-size: 22px;
  font-weight: bold;
  color: #5cb85c;
  margin-bottom: 12px;
}

.ebook-preco-consulte {
  font-size: 22px;
  font-weight: bold;
  color: #c41e3a;
  margin-bottom: 12px;
}

.btn-detalhes,
.btn-ler-livro {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  text-decoration: none;
  color: #fff;
  transition: background-color 0.3s;
}

.btn-detalhes {
  background-color: #4a90e2;
  margin-bottom: 8px;
}

.btn-detalhes:hover {
  background-color: #357abd;
}

.btn-ler-livro {
  background-color: #28a745;
}

.btn-ler-livro:hover {
  background-color: #218838;
}

/* ===========================
   PÁGINA DE DETALHES
=========================== */
.detalhes-container {
  background-color: #fff;
  border-radius: 8px;
  padding: 40px;
  margin: 40px auto;
  max-width: 900px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.detalhes-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: start;
}

.detalhes-capa img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.detalhes-info {
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.detalhes-info h1 {
  font-size: 32px;
  color: #1e3a5f;
  margin-bottom: 15px;
  word-break: break-word;
}

.detalhes-autor {
  font-size: 18px;
  color: #666;
  margin-bottom: 20px;
  word-break: break-word;
}

.detalhes-descricao {
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 30px;
  white-space: pre-line;
  word-break: break-word;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 5px;
}

.detalhes-preco {
  font-size: 36px;
  font-weight: bold;
  color: #c41e3a;
  margin-bottom: 20px;
}

.btn-comprar {
  display: inline-block;
  padding: 15px 40px;
  background-color: #28a745;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 18px;
  font-weight: bold;
  transition: background-color 0.3s;
}

.btn-comprar:hover {
  background-color: #218838;
}

/* ===== RODAPÉ ===== */
.rodape {
  background-color: #1e3a5f;
  color: #fff;
  padding: 40px 0 20px;
  margin-top: 60px;
}

.rodape-content {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 30px;
  margin-bottom: 30px;
}

.rodape-coluna h3 {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.rodape-coluna ul {
  list-style: none;
}

.rodape-coluna li {
  margin-bottom: 8px;
  font-size: 14px;
}

.rodape-coluna a {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s;
}

.rodape-coluna a:hover {
  color: #c41e3a;
}

.redes-sociais {
  display: flex;
  gap: 15px;
}

.redes-sociais a {
  width: 40px;
  height: 40px;
  background-color: #fff;
  color: #1e3a5f;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 20px;
  transition: background-color 0.3s, color 0.3s;
}

.redes-sociais a:hover {
  background-color: #c41e3a;
  color: #fff;
}

.selo-seguranca img {
  max-width: 120px;
}

.rodape-pagamentos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.rodape-pagamentos img {
  height: 30px;
  width: auto;
}

.rodape-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  font-size: 14px;
}

/* ===========================
   RESPONSIVO
=========================== */
@media (max-width: 1024px) {
  .ebooks-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .rodape-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .topo-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .ebooks-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detalhes-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .rodape-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .ebooks-grid {
    grid-template-columns: 1fr;
  }

  .rodape-content {
    grid-template-columns: 1fr;
  }

  .detalhes-container {
    padding: 20px;
  }

  .detalhes-info h1 {
    font-size: 24px;
  }

  .detalhes-preco {
    font-size: 28px;
  }
}
