*{margin:0;padding:0;box-sizing:border-box}
body{font-family:Arial,Helvetica,sans-serif;background:#f6f7fb;color:#222}
a{text-decoration:none;color:inherit}
.navbar{background:#0f172a;color:#fff;padding:15px 0}
.nav-container{width:90%;max-width:1200px;margin:auto;display:flex;justify-content:space-between;align-items:center}
.container{width:90%;max-width:1200px;margin:40px auto}
.book-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:25px}
.book-card{background:#fff;padding:15px;border-radius:12px;box-shadow:0 10px 25px rgba(0,0,0,.08);text-align:center}
.book-card img{max-width:100%;border-radius:8px}
.price{margin-top:8px}
.old{text-decoration:line-through;color:#777}
.new{color:#e11d48;font-weight:bold;font-size:20px}
.book-detail .detail-top{display:flex;gap:30px}
.buy-btn{display:inline-block;background:#16a34a;color:#fff;padding:12px 25px;border-radius:30px;margin-top:15px}
.site-footer{background:#0f172a;color:#fff;text-align:center;padding:20px;margin-top:60px}
@media(max-width:768px){
  .book-grid{grid-template-columns:1fr}
  .book-detail .detail-top{flex-direction:column}
}

/* ---------- GLOBAL IMAGE SAFETY ---------- */
img{
  max-width:100%;
  height:auto;
  display:block;
}

/* ---------- SINGLE BOOK PAGE IMAGE ---------- */
.book-detail .detail-top img{
  width:100%;
  max-width:320px;   /* desktop limit */
  height:auto;
  object-fit:contain;
}

/* Mobile – single book image full width */
@media(max-width:768px){
  .book-detail .detail-top img{
    max-width:100%;
    margin:0 auto;
  }
}

/* ---------- BOOK CARD IMAGES (ALL GRIDS) ---------- */
.book-card img{
  width:100%;
  height:220px;          /* desktop uniform height */
  object-fit:contain;    /* no crop, no stretch */
  background:#f8f8f8;
  border-radius:8px;
}

/* ---------- RELATED BOOKS (MOBILE) ---------- */
@media(max-width:768px){
  .book-card img{
    height:auto;         /* let image decide height */
    max-height:260px;
  }
}
