/* =========================================================================
   Uganda Bookshop — components & responsive layout
   ========================================================================= */

/* ---- book grid ---- */
@keyframes spin { to { transform: rotate(360deg); } }
.bgrid {
  display: grid;
  grid-template-columns: repeat(var(--bcols, 4), minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 34px) clamp(16px, 2vw, 28px);
}

/* cover-forward card */
.bcard-cover__cta {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3;
  opacity: 0; transform: translateY(8px); transition: opacity .22s var(--ease), transform .22s var(--ease);
  display: flex;
}
.bcard-cover__cta .btn { width: 100%; box-shadow: var(--shadow-md); }
.bcard-cover:hover .bcard-cover__art { transform: translateY(-6px); }
.bcard-cover:hover .bcard-cover__cta { opacity: 1; transform: none; }
.bcard-cover:hover .cover { box-shadow: var(--shadow-lg); }

/* boxed card */
.bcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line); }

/* minimal */
.bcard-min:hover > div:first-child { transform: translateY(-5px); }
.bcard-min:hover .cover { box-shadow: var(--shadow-lg); }

/* ---- category bar ---- */
.cat-bar::-webkit-scrollbar { display: none; }
.cat-bar { -ms-overflow-style: none; }
@media (max-width: 760px) {
  .cat-bar { overflow-x: auto !important; }
}
/* hide the top utility strip on small screens (links live in the mobile menu) */
@media (max-width: 760px) {
  .util-bar { display: none !important; }
}

/* ---- responsive ---- */
@media (max-width: 1080px) {
  .bgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hdr-nav { display: none !important; }
  .hdr-burger { display: grid !important; place-items: center; }
  .hdr-search { display: none !important; }
  .hdr-icons { display: none !important; }
}
@media (max-width: 720px) {
  .bgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
  .nl-form { flex-direction: column; }
  .footer-cols { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 460px) {
  .bgrid { gap: 18px 12px; }
}

/* Logo text hidden on very small screens to prevent icon clipping */
@media (max-width: 520px) {
  .hdr-logo-text { display: none !important; }
}

/* Cart drawer full-width on mobile */
@media (max-width: 480px) {
  .cart-drawer-inner { width: 100vw !important; }
}

/* Checkout: order summary above delivery form on mobile */
@media (max-width: 940px) {
  .checkout-summary { order: -1; }
  .checkout-main { order: 1; }
}

/* hide horizontal scrollbars on chip rows */
.noscroll { -ms-overflow-style: none; scrollbar-width: none; }
.noscroll::-webkit-scrollbar { display: none; }

/* generic two-col responsive collapses */
@media (max-width: 940px) {
  .col2, .col2-wide, .checkout-grid, .detail-grid, .nl-grid { grid-template-columns: 1fr !important; }
  .sticky { position: static !important; }
}
.nl-grid { display: grid; }
@media (max-width: 720px) {
  .footer-cols { grid-template-columns: 1fr 1fr !important; }
}

/* home sections */
@media (max-width: 940px) {
  .hero-split { grid-template-columns: 1fr !important; }
  .heritage { grid-template-columns: 1fr !important; }
  .two-feat { grid-template-columns: 1fr !important; }
  .testi-grid { grid-template-columns: 1fr !important; }
  /* clip the decorative background bleed on the hero books panel */
  .hero-books-panel { overflow: hidden; border-radius: var(--r-xl); }
}
@media (max-width: 860px) {
  .trust-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 560px) {
  .footer-cols { grid-template-columns: 1fr !important; }
}

/* browse */
@media (max-width: 880px) {
  .browse-grid { grid-template-columns: 1fr !important; }
  .browse-aside { display: none !important; }
  .browse-filter-btn { display: inline-flex !important; }
}
@media (max-width: 760px) {
  .track-cols { grid-template-columns: 1fr !important; }
  .account-grid { grid-template-columns: 1fr !important; }
  .contact-grid { grid-template-columns: 1fr !important; }
}

/* about page */
@media (max-width: 880px) {
  .about-story { grid-template-columns: 1fr !important; }
  .about-story__aside { position: static !important; }
}

/* mobile menu drawer (slides in from the right) */
@keyframes drawer-in-right { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: no-preference) {
  .drawer-right { animation: drawer-in-right .3s var(--ease-out) both; }
}
@media (max-width: 1080px) {
  .browse-grid .bgrid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}
@media (max-width: 560px) {
  .browse-grid .bgrid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}
