/* Estilos específicos para a Loja */

/* Estilos para as abas da loja */
.area-tabs {
  margin: 3rem 0;
  padding: 0 2rem;
}

.area-tabs h2 {
  color: var(--primary-color);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.tab-container {
  margin-bottom: 2rem;
}

.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.tab-button {
  padding: 0.8rem 2rem;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  background-color: white;
  color: var(--primary-color);
}

.tab-button:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tab-button.active {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tab-button .count {
  font-size: 0.9rem;
  opacity: 0.8;
  font-weight: 400;
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s ease-in;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Grid dos livros */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
  padding: 0;
  width: 100%;
}

/* Reset para garantir que o grid funcione corretamente */
#lojaPreview {
  display: block;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Estilos para os cards dos livros */
.book-card {
  background-color: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.book-card .image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: #f8f9fa;
  min-height: 280px;
  position: relative;
  overflow: hidden;
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.book-card img {
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.5s ease;
  max-height: 320px;
  max-width: 100%;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.book-card:hover img {
  transform: scale(1.05);
}

.book-card h3 {
  margin: 1rem;
  font-size: 1.2rem;
  color: var(--primary-color);
  font-weight: 700;
}

.book-card p {
  margin: 0.5rem 1rem;
  color: #666;
}

.book-card .price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 1rem;
}

.book-buttons {
  padding: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
}

.book-buttons .button {
  flex: 1;
  padding: 0.8rem;
  text-align: center;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.book-buttons .details-btn {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.book-buttons .details-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

.book-buttons .buy-btn,
.book-buttons .dwn-btn {
  background-color: var(--primary-color);
  color: white;
  border: 2px solid var(--primary-color);
}

.book-buttons .buy-btn:hover,
.book-buttons .dwn-btn:hover {
  background-color: #2c2c2c;
  border-color: var(--hover-color);
}

/* Badge para e-books */
.ebook-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #ff6b6b;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
  }
  50% {
    box-shadow: 0 2px 15px rgba(255, 107, 107, 0.5);
  }
  100% {
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
  }
}

/* Botão de finalizar compra */
.checkout-button {
  text-align: center;
  margin: 3rem 0;
}

.checkout-button .button {
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 50px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.checkout-button .button:hover {
  background-color: var(--hover-color);
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

/* Responsividade */
@media (max-width: 768px) {
  .area-tabs {
    padding: 0 1rem;
  }

  .area-tabs h2 {
    font-size: 2rem;
  }

  .tab-buttons {
    flex-direction: column;
    align-items: center;
  }

  .tab-button {
    width: 100%;
    max-width: 300px;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
  }

  .book-buttons {
    flex-direction: row;
  }
}

@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .book-buttons {
    flex-direction: column;
  }
}
