.ebook-section {
  padding: 60px 0;
}
.ebook-content h2 {
  color: var(--primary);
  text-align: center;
  margin-bottom: 8px;
}
.ebook-sub {
  text-align: center;
  color: var(--text);
  margin-bottom: 40px;
}
.ebook-empty {
  text-align: center;
  grid-column: 1 / -1;
  color: var(--text);
}

.ebook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.ebook-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}
.ebook-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
.ebook-cover {
  background: var(--tertiary);
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ebook-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ebook-info {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.ebook-info h3 {
  font-size: 16px;
  color: var(--dark);
  margin-bottom: 2 ;
}
.ebook-info h5 {
  font-size: 13px;
  color: var(--dark);
  margin-bottom: 0 0 4px ;
}
.ebook-author {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 10px;
}
.ebook-info p {
  color: var(--text);
  font-size: 14px;
  flex: 1;
}
.ebook-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}
.ebook-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.ebook-buy-btn {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  padding: 10px 22px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}
.ebook-buy-btn:hover {
  background: transparent;
  color: var(--primary);
}

/* popup */
.ebook-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 15px;
}
.ebook-overlay.open {
  display: flex;
}
.ebook-modal {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  padding: 28px 24px;
}
.ebook-modal h3 {
  color: var(--primary);
  font-size: 20px;
  margin: 0 0 4px;
  padding-right: 30px;
}
.ebook-modal-price {
  color: var(--text);
  margin-bottom: 16px;
}
.ebook-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--dark);
}
.ebook-modal input {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
}
.ebook-modal input:focus {
  outline: none;
  border-color: var(--primary);
}
.ebook-modal form button {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.ebook-modal form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* success page */
.ebook-success-box {
  max-width: 600px;
  margin: 50px auto;
  padding: 28px;
  border: 1px solid #ddd;
  border-radius: 12px;
  text-align: center;
}
.ebook-success-box h1 {
  color: var(--primary);
  font-size: 28px;
  margin-top: 0;
}
.ebook-note {
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 600px) {
  .ebook-cover {
    height: 400px;
  }
}
