.ebook-shelf-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  padding: clamp(18px,3vw,30px);
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(#fffdfa,#f6ebd8);
  border: 1px solid var(--ebook-gold, #dec694);
  border-radius: 22px;
  box-shadow: 0 4px 0 #d3b680, 0 12px 24px #69471917;
}
a.ebook-shelf-card:hover { border-color: #00829c; color: #096579; text-decoration: none; }
a.ebook-shelf-card:hover h2, a.ebook-shelf-card:focus-visible h2 { text-decoration: underline; }
.ebook-shelf-frame {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  width: min(100%, 294px);
  aspect-ratio: 5 / 6;
  margin: 0 auto 20px;
  padding: 16px;
  border: 1px solid #c49a54;
  border-radius: 15px;
  background:
    radial-gradient(ellipse at 50% 42%, #fff7d4 0%, #f8e6b5 42%, transparent 79%),
    linear-gradient(145deg, #ede0c4, #f8f0df 58%, #e5d2aa);
  box-shadow: 0 0 0 3px #fffaf0, 0 0 0 4px #ddc28d,
    inset 0 0 20px #a47b3e24, 0 10px 24px #7e552b27, 0 0 25px #eac8783d;
}
.ebook-shelf-card .ebook-shelf-frame img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  filter: drop-shadow(0 8px 9px #15293c50);
}
.ebook-shelf-card h2 { font: 600 clamp(1.22rem,2.5vw,1.56rem)/1.55 "IBM Plex Sans Thai", sans-serif; }
.ebook-shelf-card p { margin: 0; }
.ebook-shelf-card p span { display: block; }
.grammar-product-card { color: #142d41; container-type: inline-size; }
.grammar-product-card h2 { margin: 0 0 8px; }
.grammar-product-card .grammar-product-price { margin-top: 12px; }
.grammar-product-price strong { font-size: 1.55rem; color: #0e5d75; white-space: nowrap; }
.grammar-product-card .grammar-product-delivery { margin: 4px 0 18px; line-height: 1.65; }
.grammar-product-card .grammar-product-link {
  margin-top: auto;
  width: min(100%, 320px);
  white-space: nowrap;
}
.ebook-shelf-card .ebook-card-cta, .course-catalogue .catalogue-card .ebook-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid #32aab4;
  border-radius: 12px;
  background: linear-gradient(180deg, #b2f3e9, #52d3d5 65%, #35bfca);
  color: #123c4b;
  box-shadow: inset 0 2px 1px #ffffffa6, 0 3px 0 #239caa;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
}
.grammar-product-card .grammar-product-link {
  padding-inline: 8px;
  font-size: 13px;
  font-size: clamp(13px, 5.55cqi, .95rem);
}
.ebook-shelf-card .ebook-card-cta:hover, .course-catalogue .catalogue-card .ebook-card-cta:hover {
  background: #a3ebe6;
  color: #123c4b;
  filter: none;
}
.ebook-card-cta:focus-visible { outline: 3px solid var(--teal-deep); outline-offset: 4px; }
@media (max-width: 360px) {
  .grammar-product-card { padding-inline: 12px; }
}
@media (max-width: 300px) {
  .grammar-product-card { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .ebook-card-cta { transition: none; }
  .ebook-shelf-card .ebook-card-cta:is(:hover, :active) { transform: none; }
}

@media (max-width: 660px) {
  .ebook-shop .ebook-shelf-grid, .course-catalogue .catalogue-ebook-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 300px) {
  .ebook-shop .ebook-shelf-grid, .course-catalogue .catalogue-ebook-grid {
    margin-inline: -10px;
  }
}
