/* === eBook Store Page (same style as editable/custom templates) === */

body {
  background: #f8f9fa;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

h2 {
  text-align: center;
  margin: 20px 0;
  font-size: 1.8rem;
  color: #222;
}

/* --- Grid Layout --- */
.ebook-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 20px;
  justify-content: center; /* centers items on desktop */
}

/* --- eBook Card --- */
.ebook-card {
  flex: 1 1 300px;
  max-width: 320px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 16px;
  background-color: #fff;
  box-sizing: border-box;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.ebook-card img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 6px;
  object-fit: cover;
  margin-bottom: 10px;
}

.ebook-card h3 {
  font-size: 20px;
  margin: 10px 0 6px;
  color: #333;
}

.ebook-card p {
  margin: 4px 0;
  font-size: 14px;
  color: #555;
}

/* --- Buttons --- */
.buy-btn {
  background: #007bff;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 10px;
  transition: background 0.2s ease;
}

.buy-btn:hover {
  background: #0056b3;
}

/* --- Responsive Fix --- */
@media (max-width: 600px) {
  .ebook-card {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .ebook-card img {
    max-height: 100%; /* taller preview for mobile */
  }

  h2 {
    font-size: 1.5rem;
  }

  .ebook-card h3 {
    font-size: 18px;
  }

  .ebook-card p {
    font-size: 13px;
  }
}


.ebook-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  overflow: hidden;
  padding: 15px;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Keep content aligned left */
}

.ebook-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 12px;
}

.ebook-info {
  text-align: left; /* force text alignment left */
  width: 100%;
}

.ebook-info h3 {
  margin: 8px 0;
}

.buy-btn {
  background: #4CAF50;
  color: #fff;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
}

.buy-btn:hover {
  background: #45a049;
}
