:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --accent:#1b6ca8;
  --muted:#6b7280;
}
*{box-sizing:border-box}
body{font-family: 'Kalpurush', 'Noto Sans Bengali', system-ui, Arial, sans-serif; margin:0;background:var(--bg);color:#111}
.container{max-width:1100px;margin:0 auto;padding:24px}
.site-header{background:linear-gradient(90deg,#fff 0%, #f8fbff 100%);box-shadow:0 2px 6px rgba(16,24,40,0.06)}
.header-inner{display:flex;align-items:center;justify-content:space-between;position:relative}
.brand{display:flex;align-items:center;gap:16px}
.brand img{width:72px;height:72px;object-fit:contain}
.titles h1{margin:0;font-size:20px}
.titles .sub{margin:0;color:var(--muted);font-size:13px}
.btn{background:var(--accent);color:white;padding:10px 14px;border-radius:8px;text-decoration:none}
.card{background:var(--card);padding:18px;border-radius:12px;margin:18px 0;box-shadow:0 6px 18px rgba(16,24,40,0.04)}
.bio p{line-height:1.8}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin-top:12px}
.book-card{background:linear-gradient(180deg,#fff,#fbfdff);padding:12px;border-radius:10px;display:flex;flex-direction:column;gap:8px;transition:transform .18s,box-shadow .18s;cursor:pointer;box-shadow:0 6px 18px rgba(16,24,40,0.06)}
.book-card:hover{transform:translateY(-6px);box-shadow:0 14px 36px rgba(11,65,120,0.09)}
.book-thumb{width:100%;border-radius:8px;overflow:hidden;background:#eee;display:block;position:relative}
/* fixed aspect ratio box (cover) */
.book-thumb::before{content:'';display:block;padding-top:140%;/* aspect ratio: 10:14 */}
.book-thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}

/* Discount badge on book covers */
/* small fixed-size single-line badge for covers */
.discount-badge{
  position:absolute;
  left:8px;               /* small gap from left edge */
  top:50%;                /* vertically center relative to cover */
  transform:translateY(-50%);
  background:linear-gradient(180deg,#ff6b6b,#ff3b3b);
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:26px;            /* slightly smaller fixed height */
  min-width:64px;         /* slightly smaller width */
  padding:0 6px;          /* further reduced horizontal padding */
  border-radius:7px;      /* subtle rounding */
  box-shadow:0 6px 12px rgba(255,59,59,0.08);
  font-weight:800;
  font-size:12px;
  line-height:1;
  white-space:nowrap;     /* force single-line */
  overflow:hidden;
  text-overflow:ellipsis;
  text-align:center;
}

/* modal variant: inline pill */
.discount-badge.modal-inline{position:static;width:auto;height:auto;border-radius:12px;padding:6px 10px;font-size:13px;font-weight:800;box-shadow:none;display:inline-block}

/* two-line circular badge variant (Bengali number on top, OFF below) */
.discount-badge.two-line{
  /* pill-shaped badge: wider than tall, keeps rounded corner at top-left */
  width:18%;               /* scales with cover width */
  min-width:48px;          /* do not get too small */
  max-width:120px;         /* cap the maximum width */
  height:auto;
  min-height:28px;         /* ensure enough vertical space */
  padding:4px 8px;         /* horizontal padding for pill look */
  border-radius:10px;      /* subtle rounding, pill-like */
  display:flex;
  flex-direction:column;    /* allow two stacked lines inside pill */
  align-items:center;
  justify-content:center;
  left:4px;                /* small gap from left edge */
  top:4px;                 /* small gap from top edge */
  transform:none;
}
.discount-badge.two-line .bn-line{font-family:'Kalpurush','Noto Sans Bengali',sans-serif;font-size:clamp(10px,1.1vw,13px);line-height:1;margin:0}
.discount-badge.two-line .en-line{font-size:clamp(8px,0.9vw,10px);line-height:1;margin:0;opacity:0.95}

/* single-line badge: Bengali number + 'ডিসকাউন্ট' in one line */
.discount-badge.single-line{
  display:inline-flex;
  width:auto;               /* auto-size to text */
  min-width:0;
  padding:3px 6px;         /* small padding */
  height:auto;
  border-radius:8px;
  align-items:center;
  justify-content:center;
  left:2px;                /* very small gap from left */
  top:2px;                 /* very small gap from top */
  transform:none;
  z-index:6;               /* ensure above image */
  font-weight:800;
  font-size:clamp(10px,1vw,13px);
  white-space:nowrap;      /* keep it one line */
  /* ensure text is fully visible, don't clip */
  overflow:visible;
  text-overflow:unset;
  /* subtle text-shadow and border to ensure legibility */
  text-shadow:0 1px 0 rgba(0,0,0,0.12);
  box-shadow:0 6px 18px rgba(255,59,59,0.08);
  border:1px solid rgba(0,0,0,0.06);
}



/* Slightly reduce visual weight on very small screens */
@media (max-width:420px){
  .discount-badge{left:6px;top:50%;transform:translateY(-50%);min-width:60px;height:24px;font-size:11px;padding:0 6px}
  .discount-badge.two-line{width:14%;min-width:26px;max-width:40px;left:3px;top:3px}
}
.book-meta{display:flex;flex-direction:column;gap:4px}
.price{font-weight:700;color:var(--accent)}
.small{color:var(--muted);font-size:13px}

/* clickable-looking CTA under title (replaces publisher name in cards) */
.book-cta-button{background:transparent;border:1px solid rgba(27,108,168,0.12);color:var(--accent);padding:8px 10px;border-radius:8px;font-weight:700;cursor:pointer}
.book-cta-button:hover{background:rgba(27,108,168,0.04)}
.book-cta-button:focus{outline:3px solid rgba(27,108,168,0.12)}

/* Ensure CTA text stays on a single line with ellipsis if space is limited */
.book-cta-button{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
/* Price styles: show original (crossed) and discounted */
.price-old{color:var(--muted);text-decoration:line-through;font-weight:600;margin-right:8px}
.price-new{color:var(--accent);font-weight:800}

/* Delivery note style shown in book modal */
.delivery-note{background:#f0fbf6;border-left:4px solid #25D366;padding:10px;border-radius:6px;margin-top:12px}

/* Kalpurush font: using the TTF you placed at assets/fonts/Kalpurush-Regular.ttf */
@font-face {
  font-family: 'Kalpurush';
  src: url('../fonts/Kalpurush-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Example helper class to apply Kalpurush only to headings if you don't want to replace body font */
.kalpurush { font-family: 'Kalpurush', 'Noto Sans Bengali', sans-serif }

/* WhatsApp button styling */
.cta .wa-btn, .wa-btn{background:#25D366;color:#fff;padding:8px 12px;border-radius:8px;display:inline-flex;align-items:center;gap:8px;text-decoration:none;font-weight:700;border:0;line-height:1}
.cta .wa-btn svg, .wa-btn svg{width:18px;height:18px;flex:0 0 18px;fill:#fff}
.cta .wa-btn:focus, .wa-btn:focus{outline:3px solid rgba(37,211,102,0.18)}
.cta .wa-btn, .wa-btn{background-color:#25D366 !important;color:#ffffff !important}
.cta .wa-btn, .wa-btn{display:inline-flex !important;padding:8px 12px !important;border-radius:8px !important;align-items:center !important}

/* modal */
.modal{position:fixed;inset:0;background:rgba(2,6,23,0.6);display:none;align-items:center;justify-content:center;padding:18px;z-index:9999}
.modal[aria-hidden="false"]{display:flex}
.modal-content{background:var(--card);max-width:900px;width:100%;border-radius:12px;padding:18px;position:relative;display:flex;flex-direction:column}
.modal-body{overflow:auto;max-height:75vh;padding-right:6px}
.modal-close{position:absolute;right:12px;top:12px;border:0;background:transparent;font-size:20px;cursor:pointer}
.pdf-frame{width:100%;height:420px;border:1px solid #e6eef7}
/* ensure iframe sits above modal backdrop and other page elements */
.modal .pdf-frame{position:relative;z-index:10000}

/* While modal is open, ensure discount badges on underlying page don't visually overlap the modal.
  Allow badges that are intentionally inside the modal (.modal-inline) to remain visible. */
.modal[aria-hidden="false"] ~ .container .discount-badge,
.modal[aria-hidden="false"] .discount-badge{visibility:hidden;opacity:0}
.modal[aria-hidden="false"] .discount-badge.modal-inline{visibility:visible;opacity:1}

/* ensure iframe scales on small screens */
@media (max-width:520px){
  .pdf-frame{height:360px}
}

@media (max-width:520px){
  .brand img{width:52px;height:52px}
  .book-thumb{height:180px}
}

/* Mobile sidebar */
.mobile-toggle{display:none;background:transparent;border:0;font-size:22px;padding:8px;cursor:pointer}
.mobile-nav{position:fixed;inset:0;left:100%;width:280px;max-width:90%;background:var(--card);box-shadow:-12px 0 40px rgba(2,6,23,0.12);transition:left .24s;z-index:1200;padding:18px}
.mobile-nav[aria-hidden="false"]{left:auto;right:0}
.mobile-nav ul{list-style:none;padding:0;margin:60px 0 0}
.mobile-nav li{margin:12px 0}
.mobile-nav a{color:#111;text-decoration:none;font-weight:600}
.mobile-nav-close{position:absolute;right:8px;top:8px;border:0;background:transparent;font-size:20px;cursor:pointer}

@media (max-width:820px){
  .mobile-toggle{display:block}
  .cta{display:none}
  .container{padding:14px}
  .grid{grid-template-columns:repeat(2,1fr);gap:12px}
  .titles h1{font-size:18px}
}

/* Fix card image scaling on very small screens */
@media (max-width:420px){
  .grid{grid-template-columns:repeat(2,1fr)}
}

@media (min-width:900px){
  .grid{grid-template-columns:repeat(3,1fr)}
}

@media (min-width:1200px){
  .grid{grid-template-columns:repeat(4,1fr)}
}

/* Reviews gallery: responsive, no-crop, preserves original aspect ratios */
.reviews-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
  gap:12px;
  margin-top:12px;
}
.review-item{
  background:linear-gradient(180deg,#fff,#fbfdff);
  border:1px solid #eef3fa;
  border-radius:10px;
  padding:8px;
  box-shadow:0 6px 18px rgba(16,24,40,0.04);
}
/* Wrapper to create a safe box without forcing aspect ratio */
.review-media{
  width:100%;
  /* let height be auto from content image/video; we still round corners and hide overflow for aesthetics */
  border-radius:8px;
  overflow:hidden;
}
.review-media img,
.review-media video{
  display:block;
  width:100%;
  height:auto; /* keep natural aspect ratio, no crop, no stretch */
}
/* Make videos controllable but tidy */
.review-media video{max-height:70vh}

/* Small screens: slightly tighter grid */
@media (max-width:600px){
  .reviews-grid{grid-template-columns:repeat(2,1fr);gap:10px}
}

/* Lightbox overlay */
.lightbox{position:fixed;inset:0;background:rgba(2,6,23,0.9);display:none;z-index:10000;overscroll-behavior:contain}
.lightbox[aria-hidden="false"]{display:block}
.lightbox-close{position:absolute;top:12px;right:12px;background:transparent;border:0;color:#fff;font-size:22px;cursor:pointer}
.lightbox-stage{position:absolute;inset:0;top:44px;bottom:56px;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none}
.lightbox-stage img{max-width:none;max-height:none;transform-origin:center center;will-change:transform;user-select:none;-webkit-user-drag:none;}
.lightbox-controls{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);display:inline-flex;gap:8px;background:rgba(255,255,255,0.08);backdrop-filter:blur(6px);padding:6px 8px;border-radius:10px}
.lightbox-btn{background:#ffffff;border:0;border-radius:8px;padding:6px 10px;font-size:16px;cursor:pointer}
.lightbox-btn:focus{outline:3px solid rgba(255,255,255,0.3)}

/* Book details spec table inside modal */
.book-spec-wrap{margin-top:14px}
.book-spec{width:100%;border-collapse:collapse;font-size:15px;background:#fff}
.book-spec th, .book-spec td{padding:10px 16px;border:1px solid #e6eef7;vertical-align:top}
.book-spec th{width:28%;background:#f7fbff;color:#103947;font-weight:700}
.book-spec td{background:#ffffff}
.book-spec tr:nth-child(2n+3) td,
.book-spec tr:nth-child(2n+3) th{background:linear-gradient(#ffffff,#fbfdff)}

/* Mobile responsive table: stack rows as cards except the header row */
@media (max-width:640px){
  .book-spec th, .book-spec td{display:block;width:100%}
  .book-spec th{border-bottom:none}
  .book-spec tr{margin-bottom:10px;display:block;border:1px solid #e6eef7;border-radius:6px;overflow:hidden}
  .book-spec tr:first-child{display:table-row;border:0;border-radius:0}
  .book-spec tr:first-child th, .book-spec tr:first-child td{display:table-cell}
}


/* Hero banner (full-width, responsive, no-crop) */
.hero-banner{
  margin:0;
  background:transparent; /* no side bleed; stays visually inside main area */
}
.hero-banner picture{display:block}
.hero-banner img{
  display:block;
  width:100%;
  height:auto;    /* keep original aspect ratio on all devices */
}

/* Fine-tune spacing around the banner (reduce top a bit, bottom more) */
.hero-banner .container{padding-top:10px;padding-bottom:4px}
/* Reduce the gap before the main content container */
.hero-banner + .container{padding-top:8px}

@media (max-width:820px){
  .hero-banner .container{padding-top:8px;padding-bottom:2px}
  .hero-banner + .container{padding-top:6px}
}

/* Reduce first card's top margin when it follows the banner to tighten the gap */
.hero-banner + .container > .card:first-child{margin-top:10px}
@media (max-width:820px){
  .hero-banner + .container > .card:first-child{margin-top:8px}
}

/* Keep book details spec table structure on mobile; don't stack rows */
@media (max-width:640px){
  .book-spec-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .book-spec{min-width:520px}
  .book-spec th, .book-spec td{display:table-cell;width:auto;padding:8px 12px}
  .book-spec tr{display:table-row;margin:0;border-radius:0;border:0}
  .book-spec th{border-bottom:1px solid #e6eef7}
}
@media (max-width:480px){
  .book-spec{font-size:14px;min-width:460px}
  .book-spec th, .book-spec td{padding:8px 10px}
}

