/* ==========================================================================
   DrNay Books — Card Grid & Modal Styles (CSS-only modal/tabs, no JS required)
   KPay-only variant
   ========================================================================== */

/* ---- Grid wrapper ---- */
.drnay-book-wrapper-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px;
  padding: 8px 0 32px;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

.drnay-no-books-found {
  grid-column: 1 / -1;
  text-align: center;
  color: #718096;
  padding: 40px 0;
  font-style: italic;
}

/* ---- Category Tabs (CSS-only filter via hidden radios) ---- */
.drnay-cat-radio {
  display: none;
}

.drnay-book-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

.drnay-book-category-tabs label {
  padding: 8px 18px;
  border-radius: 999px;
  background: #edf2f7;
  color: #4a5568;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.drnay-book-category-tabs label:hover {
  background: #e2e8f0;
}

/* ---- Card ---- */
.drnay-book-card-item {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.drnay-book-card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -10px rgba(0, 0, 0, 0.15);
}

/* ---- Cover image area ---- */
.drnay-book-image-canvas {
  background: #f7fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  aspect-ratio: 3 / 4;
}

.drnay-book-actual-cover {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 20px -6px rgba(0, 0, 0, 0.2);
}

/* ---- Title + excerpt ---- */
.drnay-book-content-block {
  padding: 18px 18px 4px;
  flex: 1;
}

.drnay-book-header-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 8px;
  color: #2d3748;
}

.drnay-book-summary-text {
  font-size: 0.88rem;
  color: #718096;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Footer: price + actions ---- */
.drnay-book-footer-action-area {
  padding: 14px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drnay-book-price-tag-value {
  font-weight: 700;
  font-size: 0.95rem;
  color: #2d3748;
  margin-bottom: 4px;
}

.drnay-book-transaction-button {
  display: block;
  text-align: center;
  width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.drnay-book-transaction-button:hover {
  transform: translateY(-1px);
}

/* Button colors */
.drnay-book-footer-action-area .qr-btn {
  background-color: #2f855a;
  color: #F8F8FC;
}
.drnay-book-footer-action-area .qr-btn:hover {
  background-color: #22543d;
}
.drnay-book-footer-action-area .free-btn {
  background-color: #4a5568;
}
.drnay-book-footer-action-area .free-btn:hover {
  background-color: #2d3748;
}

/* Used by the Thank You page download button */
.visa-btn {
  background-color: #2b6cb0;
  color: #F8F8FC;
}
.visa-btn:hover {
  background-color: #2c5282;
}

.drnay-disabled,
.drnay-disabled:hover {
  background-color: #e2e8f0 !important;
  color: #a0aec0;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   Modal Popup — CSS-only, opened via :target (anchor links, no JS)
   ========================================================================== */
.drnay-qr-modal-overlay {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

/* The trick: when the URL hash matches this modal's id, show it */
.drnay-qr-modal-overlay:target {
  display: block;
}

.drnay-qr-modal-body {
  background-color: #ffffff;
  margin: 10% auto;
  padding: 24px;
  border-radius: 14px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  position: relative;
  text-align: center;
  font-family: -apple-system, sans-serif;
}

.drnay-modal-close {
  position: absolute;
  right: 18px;
  top: 12px;
  color: #a0aec0;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}
.drnay-modal-close:hover {
  color: #4a5568;
}

.drnay-modal-qr-img {
  width: 220px;
  height: 220px;
  margin: 15px auto;
  display: block;
  object-fit: contain;
  border: 4px solid #edf2f7;
  border-radius: 8px;
}

.drnay-qr-modal-body h3 {
  margin-top: 0;
  color: #2d3748;
}
.drnay-qr-modal-body p.modal-price {
  font-size: 1.15rem;
  color: #2b6cb0;
}
.drnay-qr-modal-body p.instruction {
  font-size: 0.85rem;
  color: #718096;
  line-height: 1.4;
  margin-bottom: 20px;
}

.drnay-receipt-form input[type="file"] {
  font-size: 0.85rem;
  margin-bottom: 15px;
  display: block;
  width: 100%;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .drnay-book-wrapper-container {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px;
  }

  .drnay-book-category-tabs {
    gap: 8px;
  }

  .drnay-book-category-tabs label {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
}