/* Custom Theme Styles for Publishing Platform & Bookstore */

:root {
  --primary-color: #772905;
  --primary-hover: #5a1e03;
  --secondary-color: #d4af37;
  --font-serif: 'Merriweather', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Primary Theme Color Overrides (#772905) */
.top-bar {
  background-color: #772905 !important;
}

.header-subnav-mahogany {
  background-color: #772905 !important;
  min-height: 52px;
  padding: 6px 0 !important;
  display: flex;
  align-items: center;
}

.header-subnav-mahogany .subjects-btn-white {
  background-color: #ffffff !important;
  color: #772905 !important;
  font-weight: 800 !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.04em !important;
  padding: 0.38rem 1rem !important;
  margin-top: 3px !important;
  margin-bottom: 3px !important;
  border-radius: 3px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: auto !important;
  min-height: 36px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.header-subnav-mahogany .subjects-btn-white:hover,
.header-subnav-mahogany .subjects-btn-white:focus {
  background-color: #f8f9fa !important;
  color: #5a1e03 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.header-subnav-mahogany .nav-link {
  color: #ffffff !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  font-size: 0.71rem !important;
  letter-spacing: 0.03em !important;
  padding: 0.38rem 0.55rem !important;
  margin: 0 0.05rem;
  border-radius: 4px !important;
  transition: all 0.18s ease-in-out;
  white-space: nowrap;
}

@media (min-width: 1200px) {
  .header-subnav-mahogany .nav-link {
    font-size: 0.73rem !important;
    padding: 0.4rem 0.62rem !important;
  }
}

@media (min-width: 1400px) {
  .header-subnav-mahogany .nav-link {
    font-size: 0.75rem !important;
    padding: 0.42rem 0.68rem !important;
  }
}

.header-subnav-mahogany .nav-link:hover,
.header-subnav-mahogany .nav-link:focus,
.header-subnav-mahogany .nav-link.active,
.header-subnav-mahogany .dropdown:hover>.nav-link,
.header-subnav-mahogany .dropdown.show>.nav-link {
  background-color: #ffffff !important;
  color: #772905 !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
}

.header-subnav-mahogany .container-fluid {
  position: relative !important;
}

/* 1. LEFT WHITE BUTTON VERTICAL DROPDOWN */
.subjects-vertical-dropdown {
  position: relative !important;
}

.subjects-vertical-menu {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  width: 250px !important;
  min-width: 240px !important;
  max-height: 420px !important;
  overflow-y: auto !important;
  background: #ffffff !important;
  border-top: 3px solid #772905 !important;
  border-left: 1px solid #e0e0e0 !important;
  border-right: 1px solid #e0e0e0 !important;
  border-bottom: 1px solid #e0e0e0 !important;
  border-radius: 0 0 8px 8px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
  margin-top: 6px !important;
  z-index: 1090 !important;
  padding: 0 !important;
  list-style: none !important;
}

@media (min-width: 992px) {
  .dropdown.subjects-vertical-dropdown:hover>.subjects-vertical-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: fadeInVert 0.15s ease-out forwards;
  }
}

@keyframes fadeInVert {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subjects-vertical-item {
  display: block !important;
  padding: 9px 16px !important;
  color: #772905 !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  text-transform: capitalize !important;
  text-decoration: none !important;
  border-bottom: 1px solid #f2f2f2 !important;
  transition: all 0.15s ease-in-out !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.subjects-vertical-menu li:last-child .subjects-vertical-item {
  border-bottom: none !important;
}

.subjects-vertical-item:hover,
.subjects-vertical-item:focus {
  background-color: #fdf6f0 !important;
  color: #5a1e03 !important;
  padding-left: 20px !important;
}

/* Custom Slim Scrollbar for Vertical Menu */
.subjects-vertical-menu::-webkit-scrollbar {
  width: 6px;
}

.subjects-vertical-menu::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 0 0 8px 0;
}

.subjects-vertical-menu::-webkit-scrollbar-thumb {
  background: #d0c4bc;
  border-radius: 3px;
}

.subjects-vertical-menu::-webkit-scrollbar-thumb:hover {
  background: #772905;
}


/* 2. TOP NAVBAR LINK 3-COLUMN MEGA MENU DROPDOWN */
.subjects-nav-dropdown {
  position: static !important;
}

.subjects-megamenu-dropdown {
  position: absolute !important;
  top: 100% !important;
  left: 280px !important;
  right: 15px !important;
  width: auto !important;
  max-width: none !important;
  background: #ffffff !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 0 0 8px 8px !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18) !important;
  margin-top: 0 !important;
  z-index: 1085 !important;
  padding: 1.5rem 2rem !important;
}

.subjects-nav-dropdown .subjects-megamenu-dropdown::before {
  content: '' !important;
  position: absolute !important;
  top: -8px !important;
  left: 45px !important;
  width: 0 !important;
  height: 0 !important;
  border-left: 8px solid transparent !important;
  border-right: 8px solid transparent !important;
  border-bottom: 8px solid #ffffff !important;
  z-index: 1090 !important;
}

@media (max-width: 1199.98px) {
  .subjects-megamenu-dropdown {
    left: 240px !important;
    right: 10px !important;
    padding: 1.25rem 1.25rem !important;
  }
}

/* Explicit Rectangular Sharp Corners for View All Books buttons */
a[href="/books"].btn,
.btn-outline-primary {
  border-radius: 0px !important;
}

@media (min-width: 992px) {
  .dropdown.subjects-nav-dropdown:hover>.subjects-megamenu-dropdown {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: fadeInMega 0.18s ease-out forwards;
  }
}

@keyframes fadeInMega {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subjects-megamenu-item {
  color: #772905 !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-transform: capitalize !important;
  text-decoration: none !important;
  padding: 3px 6px !important;
  display: block !important;
  border-radius: 4px !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.35 !important;
}

.subjects-megamenu-item:hover {
  background-color: #fdf6f0 !important;
  color: #5a1e03 !important;
  transform: translateX(3px);
}

.btn-primary {
  background-color: #772905 !important;
  border-color: #772905 !important;
  color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #5a1e03 !important;
  border-color: #5a1e03 !important;
  color: #ffffff !important;
}

/* Swapped Button Colors: Add to Cart (#5a1e03 Mahogany) & Buy Now (Warm Amber/Yellow) */
.btn-add-cart {
  background-color: #5a1e03 !important;
  border-color: #5a1e03 !important;
  color: #ffffff !important;
}

.btn-add-cart:hover,
.btn-add-cart:focus {
  background-color: #3f1401 !important;
  border-color: #3f1401 !important;
  color: #ffffff !important;
}

.btn-buy-now {
  background-color: #e58e12 !important;
  border-color: #e58e12 !important;
  color: #000000 !important;
  font-weight: 600 !important;
}

.btn-buy-now:hover,
.btn-buy-now:focus {
  background-color: #cf7c0a !important;
  border-color: #cf7c0a !important;
  color: #000000 !important;
}

.btn-outline-primary {
  color: #772905 !important;
  border-color: #772905 !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: #772905 !important;
  border-color: #772905 !important;
  color: #ffffff !important;
}

.text-primary {
  color: #772905 !important;
}

.bg-primary {
  background-color: #772905 !important;
  color: #ffffff !important;
}

.bg-primary-subtle {
  background-color: rgba(119, 41, 5, 0.12) !important;
}

.border-primary {
  border-color: #772905 !important;
}

.border-primary-subtle {
  border-color: rgba(119, 41, 5, 0.25) !important;
}

body {
  font-family: var(--font-sans);
  color: #2b2d42;
  background-color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

.font-serif {
  font-family: var(--font-serif);
}

.fs-7 {
  font-size: 0.75rem;
}

.fs-8 {
  font-size: 0.65rem;
}

.tracking-wider {
  letter-spacing: 0.08em;
}

.max-w-700 {
  max-width: 700px;
}

/* Header & Brand */
.brand-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.brand-icon:not([class*="bg-"]) {
  background-color: var(--primary-color);
  color: #ffffff;
}

.main-header {
  background-color: #ffffff;
  border-bottom: 1px solid #eef2f6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-logo-ibw {
  height: 56px;
  max-height: 62px;
  width: auto;
  object-fit: contain;
  transition: transform 0.25s ease, filter 0.25s ease;
}

@media (max-width: 991.98px) {
  .header-logo-ibw {
    height: 52px !important;
    max-height: 58px !important;
  }
}

@media (max-width: 575.98px) {
  .header-logo-ibw {
    height: 48px !important;
    max-height: 54px !important;
  }
}

@media (min-width: 992px) {
  .header-logo-ibw {
    height: 58px;
    max-height: 64px;
  }
}

.header-logo-ibw:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 2px 6px rgba(26, 68, 108, 0.15));
}

.header-logo-standard-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: #ffffff;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.header-logo-standard-link:hover {
  transform: translateY(-1px);
  border-color: #0b347b !important;
  box-shadow: 0 4px 12px rgba(11, 52, 123, 0.12) !important;
}

.header-logo-standard-emblem {
  transition: transform 0.2s ease;
}

.header-logo-standard-link:hover .header-logo-standard-emblem {
  transform: scale(1.05);
}

.header-search-pill {
  border: 1.5px solid #dbe3eb;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search-pill:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 68, 108, 0.12);
}

.shadow-xs {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
}

/* Highlighted Add to Cart Button */
.btn-add-cart {
  background-color: #5a1e03 !important;
  border: 1px solid #5a1e03 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

.btn-add-cart:hover,
.btn-add-cart:focus,
.btn-add-cart:active {
  background-color: #3f1401 !important;
  border-color: #3f1401 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.btn-add-cart i {
  color: #ffffff !important;
}

.text-primary {
  color: var(--primary-color) !important;
}

.bg-primary-subtle {
  background-color: #e8f0f8 !important;
}

.hover-link:hover {
  color: #ffffff !important;
  text-decoration: underline !important;
}

/* ================= Bottom to Top (Scroll to Top) Button ================= */
#btnScrollToTop {
  position: fixed;
  bottom: 85px;
  right: 25px;
  width: 44px;
  height: 44px;
  z-index: 1040;
  background: linear-gradient(135deg, #772905 0%, #5a1e03 100%);
  color: #ffffff !important;
  border: 2px solid #d4af37 !important;
  border-radius: 50% !important;
  box-shadow: 0 6px 20px rgba(119, 41, 5, 0.35);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#btnScrollToTop:hover {
  background: linear-gradient(135deg, #5a1e03 0%, #3b1201 100%);
  color: #ffd700 !important;
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 10px 24px rgba(119, 41, 5, 0.45) !important;
}

#btnScrollToTop i {
  line-height: 1;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #4d1a03 0%, #772905 60%, #5a1e03 100%);
}

.main-hero-img {
  max-height: 380px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.main-hero-img:hover {
  transform: translateY(-4px);
}

/* Nav Pills / Tabs Mahogany Overrides */
.nav-pills .nav-link.active,
.nav-pills .show>.nav-link {
  background-color: #772905 !important;
  color: #ffffff !important;
}

.nav-pills .nav-link {
  color: #772905;
}

.nav-pills .nav-link:hover {
  color: #5a1e03;
}

/* Category Cards */
.category-card {
  transition: all 0.25s ease;
  border: 1px solid #edf2f7;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
  border-color: #cbd5e1;
}

.category-icon-box {
  width: 48px;
  height: 48px;
}

/* Book Cards */
.home-book-card {
  width: 88%;
  margin-inline: auto;
}

.home-book-card .book-cover-wrapper {
  height: 280px;
}

.book-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid #f1f5f9;
}

.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.09) !important;
}

.book-cover-wrapper {
  height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #f8fafc;
}

.book-cover-img {
  max-height: 200px;
  max-width: 140px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5rem;
}

.add-to-cart-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Publishing Services */
.service-card {
  transition: all 0.25s ease;
  border: 1px solid #e2e8f0;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06) !important;
}

.service-icon-box {
  width: 58px;
  height: 58px;
  background-color: var(--primary-color) !important;
}

/* Full Width Hero Banner */
.hero-banner-section {
  width: 100%;
  background: #ffffff;
  padding: 0 !important;
  margin: 0 !important;
}

.full-width-banner-img {
  width: 100%;
  height: clamp(200px, 28vw, 380px);
  max-height: 380px;
  object-fit: cover;
  object-position: center center;
  display: block;
}

@media (min-width: 1200px) {
  .full-width-banner-img {
    height: 380px;
    max-height: 380px;
  }
}

@media (max-width: 991.98px) {
  .full-width-banner-img {
    height: clamp(180px, 32vw, 300px);
    max-height: 300px;
  }
}

/* Welcome Banner Responsive Typography */
.welcome-title-line {
  font-size: clamp(0.95rem, 1.6vw, 1.35rem);
}

.welcome-subtitle-line {
  font-size: clamp(0.88rem, 1.4vw, 1.25rem);
}

@media (max-width: 767.98px) {
  .welcome-banner-section {
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
  }

  .welcome-banner-emblem {
    height: 24px !important;
    max-height: 26px !important;
  }

  .welcome-title-line {
    font-size: clamp(0.76rem, 3.5vw, 0.95rem) !important;
    letter-spacing: 0.02em !important;
    white-space: nowrap !important;
  }

  .welcome-subtitle-line {
    font-size: 0.78rem !important;
    letter-spacing: 0.04em !important;
  }
}

/* Navigation & Subjects Mega Menu */
.header-subnav-mahogany .navbar-nav .nav-link {
  font-size: 0.72rem !important;
  transition: color 0.15s ease-in-out;
}

.navbar-nav .nav-link:hover {
  color: var(--primary-color) !important;
}

/* Desktop Navigation & Subjects Mega Menu (>= 992px) */
/* ================= Vertical Subjects Dropdown Menu ================= */
.header-subnav-mahogany .subjects-vertical-dropdown {
  position: relative !important;
  display: inline-block !important;
}

.header-subnav-mahogany .subjects-vertical-dropdown .subjects-btn-white {
  background-color: #ffffff !important;
  color: #2b1103 !important;
  font-weight: 700 !important;
  font-size: 0.84rem !important;
  letter-spacing: 0.05em !important;
  padding: 0.45rem 1rem !important;
  border-radius: 2px 2px 0 0 !important;
  border: 1px solid #d9d9d9 !important;
  border-bottom: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  min-height: 38px !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

.header-subnav-mahogany .subjects-dropdown-menu {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  width: 210px !important;
  min-width: 210px !important;
  max-width: 230px !important;
  max-height: 360px !important;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  background-color: #ffffff !important;
  border: 1px solid #d9d9d9 !important;
  border-top: none !important;
  border-radius: 0 0 2px 2px !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12) !important;
  z-index: 1060 !important;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
}

/* Open on hover on desktop */
@media (min-width: 992px) {

  .header-subnav-mahogany .subjects-vertical-dropdown:hover>.subjects-dropdown-menu,
  .header-subnav-mahogany .subjects-nav-dropdown:hover>.subjects-dropdown-menu {
    display: block !important;
  }
}

/* Vertical Dropdown Items */
.subjects-dropdown-item {
  display: block !important;
  padding: 7px 14px !important;
  color: #772905 !important;
  font-size: 0.84rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  border-bottom: 1px solid #f8f8f8 !important;
  background-color: #ffffff !important;
  transition: background-color 0.1s ease, color 0.1s ease !important;
}

.subjects-dropdown-item:hover,
.subjects-dropdown-item:focus,
.subjects-dropdown-item.active {
  background-color: #772905 !important;
  color: #ffffff !important;
}

/* Custom Smooth Scrollbar for Subjects List */
.subjects-dropdown-menu::-webkit-scrollbar {
  width: 7px;
}

.subjects-dropdown-menu::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.subjects-dropdown-menu::-webkit-scrollbar-thumb {
  background: #9e9e9e;
  border-radius: 2px;
}

.subjects-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: #757575;
}

/* Mobile Navigation, Subjects Bar & Slide-Out Drawer (< 992px) */
.text-mahogany {
  color: #772905 !important;
}

.mobile-subjects-bar-wrapper {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-subjects-dropdown-btn {
  border: 1.5px solid #d4af37 !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  color: #772905 !important;
  background: #ffffff !important;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.mobile-subjects-dropdown-btn:hover,
.mobile-subjects-dropdown-btn:focus {
  border-color: #772905 !important;
  background-color: #fcf8f5 !important;
  box-shadow: 0 3px 10px rgba(119, 41, 5, 0.12);
}

.mobile-subjects-dropdown-menu {
  background-color: #772905 !important;
  border-radius: 0 0 8px 8px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
  padding: 0 !important;
  margin-top: 4px !important;
  border: none !important;
  max-height: 380px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  touch-action: pan-y !important;
}

.mobile-subjects-dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.mobile-subjects-dropdown-menu::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.mobile-subjects-dropdown-menu::-webkit-scrollbar-thumb {
  background: #d4af37;
  border-radius: 4px;
}

.mobile-subject-li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.mobile-subject-li:last-child {
  border-bottom: none;
}

.mobile-subject-item-link {
  display: block;
  padding: 0.7rem 1.15rem;
  color: #ffffff !important;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  background-color: #772905;
  transition: all 0.15s ease-in-out;
}

.mobile-subject-item-link:hover,
.mobile-subject-item-link:focus,
.mobile-subject-item-link:active,
.mobile-subject-item-link.active {
  background-color: #ffffff !important;
  color: #772905 !important;
  font-weight: 600;
  padding-left: 1.35rem;
}

.mobile-drawer-open-btn {
  color: #333333;
  transition: color 0.15s ease-in-out;
}

.mobile-drawer-open-btn:hover,
.mobile-drawer-open-btn:focus {
  color: #772905 !important;
}

.mobile-site-drawer {
  background-color: #ffffff;
  z-index: 1100;
}

.mobile-drawer-close-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: linear-gradient(135deg, #a93a00 0%, #772905 100%) !important;
  border-radius: 6px !important;
  border: none !important;
  font-size: 1rem;
}

.btn-drawer-search {
  background: linear-gradient(135deg, #a93a00 0%, #772905 100%) !important;
  border: none !important;
}

.mobile-drawer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-drawer-item {
  border-bottom: 1px solid #ececec;
}

.mobile-drawer-link {
  display: block;
  padding: 0.85rem 1.25rem;
  color: #2b2b2b;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

.mobile-drawer-link:hover,
.mobile-drawer-link:focus {
  background-color: #fbf5f1;
  color: #772905;
  padding-left: 1.45rem;
}

.hover-text-primary:hover {
  color: #772905 !important;
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .dropdown-mega {
    position: relative !important;
  }

  .dropdown-menu-mega {
    position: static !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    margin: 0.5rem 0 !important;
    padding: 0.85rem !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    background-color: #ffffff !important;
  }

  .dropdown-menu-mega h6 {
    color: #1e293b !important;
  }

  .dropdown-menu-mega .mega-menu-scrollable-grid {
    max-height: 320px !important;
    overflow-y: auto !important;
  }
}

/* Mobile Screens (< 576px) */
@media (max-width: 575.98px) {
  .top-bar {
    font-size: 0.74rem !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }

  .top-bar .container-fluid {
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
    gap: 4px !important;
  }

  .header-logo-ibw {
    height: 48px !important;
    max-height: 54px !important;
  }

  .main-header .container-fluid {
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
  }

  .header-search-pill .btn {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .mobile-user-label {
    display: none !important;
  }
}

/* Mobile Catalog Offcanvas Drawer (< 992px) */
@media (max-width: 991.98px) {
  #catalogFilterDrawer.offcanvas-lg {
    max-width: 330px;
    width: 88vw;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  }

  #catalogFilterDrawer.offcanvas-lg .offcanvas-body {
    overflow-y: auto;
    max-height: calc(100vh - 65px);
    padding: 0;
  }

  #catalogFilterDrawer.offcanvas-lg .card {
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 1.25rem !important;
    position: static !important;
    top: auto !important;
  }

  .mobile-catalog-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.55rem 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }
}

.mega-subject-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.83rem;
  color: #334155;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s ease-in-out;
  white-space: normal;
  line-height: 1.3;
}

.mega-subject-item i {
  font-size: 0.65rem;
  color: #94a3b8;
  transition: color 0.15s ease, transform 0.15s ease;
}

.mega-subject-item:hover {
  background-color: rgba(119, 41, 5, 0.08);
  color: #772905;
  font-weight: 500;
  padding-left: 0.8rem;
}

.mega-subject-item:hover i {
  color: #772905;
  transform: translateX(2px);
}

/* Google Translate Customization & Toolbar Suppression */
.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
iframe.goog-te-banner-frame {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
}

body {
  top: 0px !important;
  position: static !important;
}

.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
}

.goog-text-highlight {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

#google_translate_element {
  display: none !important;
}

.skiptranslate iframe {
  display: none !important;
}

/* ================= Modern Bookstore Book Cards ================= */
.book-card {
  border: 1px solid #e2e8f0;
  border-radius: 0 !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  background: #ffffff;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.09) !important;
  border-color: #cbd5e1;
}

.book-card-cover {
  height: clamp(240px, 20vw, 320px);
  aspect-ratio: 2 / 3;
  background: #f8f9fa;
  border-radius: 0 !important;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
}

.book-cover-img {
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  max-width: 100% !important;
  object-fit: cover !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-card:hover .book-cover-img {
  transform: scale(1.04);
}

.quick-view-overlay {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 5;
}

.book-card:hover .quick-view-overlay {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.book-card-title {
  font-size: 0.9rem;
  line-height: 1.35;
  height: 2.7em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 767.98px) {
  .book-card-cover {
    height: 240px;
  }

  .quick-view-overlay {
    display: none !important;
  }
}

@media (max-width: 575.98px) {
  .book-card .card-body {
    padding: 0.65rem !important;
  }

  .book-card-cover {
    height: 210px !important;
  }

  .book-card-title {
    font-size: 0.8rem !important;
    height: 2.5em !important;
    line-height: 1.25 !important;
  }

  .book-card-publisher,
  .book-card-author {
    font-size: 0.72rem !important;
  }

  .book-card .fs-5 {
    font-size: 0.95rem !important;
  }

  .book-card .btn-add-cart,
  .book-card .btn-buy-now {
    font-size: 0.74rem !important;
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
  }
}

/* ================= Horizontal Book & Subject Carousels ================= */
.book-carousel-wrapper {
  position: relative;
  padding: 0 18px;
}

.book-carousel-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 8px 6px 18px 6px;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE / Edge */
}

.book-carousel-track::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

/* Book items inside carousel */
.book-carousel-track>.col {
  flex: 0 0 260px !important;
  max-width: 270px !important;
  width: 260px !important;
  scroll-snap-align: start;
}

/* Subject items inside carousel */
.subject-carousel-item {
  flex: 0 0 240px;
  max-width: 250px;
  width: 240px;
  scroll-snap-align: start;
}

/* Floating Navigation Arrows */
.book-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #dbe3eb;
  color: #772905;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 10;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  outline: none;
  opacity: 0.92;
}

.book-carousel-arrow:hover {
  background: #772905;
  color: #ffffff;
  border-color: #772905;
  box-shadow: 0 6px 20px rgba(119, 41, 5, 0.32);
  transform: translateY(-50%) scale(1.08);
  opacity: 1;
}

.book-carousel-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.book-carousel-arrow.book-carousel-prev {
  left: -4px;
}

.book-carousel-arrow.book-carousel-next {
  right: -4px;
}

.carousel-nav-btn {
  transition: all 0.2s ease;
  border-color: #dbe3eb;
  color: #475569;
}

.carousel-nav-btn:hover {
  background: #772905;
  border-color: #772905;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Category, Author, Publisher, Journal, Editorial Carousel Items */
.category-carousel-item {
  flex: 0 0 280px;
  max-width: 290px;
  width: 280px;
  scroll-snap-align: start;
}

.author-carousel-item {
  flex: 0 0 320px;
  max-width: 330px;
  width: 320px;
  scroll-snap-align: start;
}

.publisher-carousel-item {
  flex: 0 0 215px;
  max-width: 225px;
  width: 215px;
  scroll-snap-align: start;
}

/* Publisher Imprint Cards */
.publisher-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-color: #e9eff5 !important;
}

.publisher-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(119, 41, 5, 0.12);
  border-color: #772905 !important;
}

.publisher-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.84rem;
  line-height: 1.35;
  height: 2.7em;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.publisher-logo-box {
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.publisher-card:hover .publisher-logo-box {
  transform: scale(1.06);
  border-color: #772905 !important;
}

.journal-carousel-item {
  flex: 0 0 340px;
  max-width: 350px;
  width: 340px;
  scroll-snap-align: start;
}

.editorial-carousel-item {
  flex: 0 0 340px;
  max-width: 350px;
  width: 340px;
  scroll-snap-align: start;
}

@media (max-width: 991.98px) {
  .book-carousel-wrapper {
    padding: 0;
  }

  .book-carousel-arrow {
    display: none !important;
  }

  .book-carousel-track>.col {
    flex: 0 0 220px !important;
    max-width: 230px !important;
    width: 220px !important;
  }

  .subject-carousel-item {
    flex: 0 0 200px;
    max-width: 210px;
    width: 200px;
  }

  .category-carousel-item {
    flex: 0 0 250px;
    width: 250px;
  }

  .author-carousel-item {
    flex: 0 0 280px;
    width: 280px;
  }

  .publisher-carousel-item {
    flex: 0 0 185px;
    width: 185px;
  }

  .journal-carousel-item,
  .editorial-carousel-item {
    flex: 0 0 300px;
    width: 300px;
  }
}

@media (max-width: 767.98px) {
  .book-carousel-track {
    gap: 0.5rem !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
  }

  .book-carousel-track>.col {
    flex: 0 0 calc(50% - 0.25rem) !important;
    max-width: calc(50% - 0.25rem) !important;
    width: calc(50% - 0.25rem) !important;
    min-width: 135px !important;
  }

  .subject-carousel-item {
    flex: 0 0 calc(50% - 0.25rem) !important;
    max-width: calc(50% - 0.25rem) !important;
    width: calc(50% - 0.25rem) !important;
  }

  .category-carousel-item {
    flex: 0 0 calc(80vw - 0.5rem) !important;
    max-width: calc(80vw - 0.5rem) !important;
    width: calc(80vw - 0.5rem) !important;
  }

  .author-carousel-item {
    flex: 0 0 calc(80vw - 0.5rem) !important;
    max-width: calc(80vw - 0.5rem) !important;
    width: calc(80vw - 0.5rem) !important;
  }

  .publisher-carousel-item {
    flex: 0 0 calc(50% - 0.25rem) !important;
    max-width: calc(50% - 0.25rem) !important;
    width: calc(50% - 0.25rem) !important;
  }

  .journal-carousel-item,
  .editorial-carousel-item {
    flex: 0 0 calc(82vw - 0.5rem) !important;
    max-width: calc(82vw - 0.5rem) !important;
    width: calc(82vw - 0.5rem) !important;
  }

  .book-carousel-arrow {
    display: none !important;
  }
}

/* ================= Pagination Component ================= */
.pagination {
  gap: 4px;
  flex-wrap: wrap !important;
  justify-content: center !important;
  max-width: 100%;
}

.pagination .page-item .page-link {
  color: #334155;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0 !important;
  padding: 0.38rem 0.72rem;
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 34px;
  text-align: center;
  transition: all 0.18s ease-in-out;
}

.pagination .page-item .page-link:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 8px rgba(119, 41, 5, 0.35);
  font-weight: 700;
}

.pagination .page-item.disabled .page-link {
  color: #94a3b8;
  background-color: #f8fafc;
  border-color: #e2e8f0;
  opacity: 0.85;
}

@media (max-width: 767.98px) {

  /* Pagination container: center and allow full width */
  #catalogPagination {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.75rem !important;
  }

  #catalogPagination .small.text-secondary {
    text-align: center !important;
  }
}

@media (max-width: 575.98px) {
  .pagination {
    gap: 2px;
    flex-wrap: wrap !important;
  }

  .pagination .page-item .page-link {
    padding: 0.22rem 0.4rem;
    font-size: 0.75rem;
    min-width: 26px;
  }
}

/* On very small screens (< 400px): hide numbered middle pages,
   only keep Prev / active / Next to avoid overflow */
@media (max-width: 399.98px) {

  /* Hide ellipsis and non-active numbered page items */
  .pagination .page-item:not(.active):not(:first-child):not(:last-child) {
    display: none !important;
  }

  /* Always show Prev (first) and Next (last) */
  .pagination .page-item:first-child,
  .pagination .page-item:last-child {
    display: inline-flex !important;
  }

  /* Show active page */
  .pagination .page-item.active {
    display: inline-flex !important;
  }

  .pagination .page-item .page-link {
    padding: 0.3rem 0.55rem;
    font-size: 0.8rem;
    min-width: 30px;
    border-radius: 0 !important;
  }
}


/* ===============================================================
   COMPREHENSIVE RESPONSIVE OVERRIDES
   Mobile-first improvements for all breakpoints
   =============================================================== */

/* ---- Top Utility Bar ---- */
@media (max-width: 767.98px) {
  .top-bar .container-fluid {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }

  /* Hide long phone number in top bar on small screens */
  .top-bar a[href^="tel"] {
    display: none !important;
  }
}

@media (max-width: 399.98px) {
  .top-bar {
    font-size: 0.7rem !important;
  }

  .top-bar .container-fluid {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}

/* ---- Main Header / Search Bar ---- */
@media (max-width: 991.98px) {
  .main-header .container-fluid>.d-flex {
    flex-wrap: wrap;
  }

  /* Search bar takes full width on mobile */
  .main-header .flex-grow-1.position-relative {
    order: 3 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0.35rem 0 !important;
  }
}

@media (max-width: 575.98px) {
  .main-header .container-fluid {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  #globalSearchInput {
    font-size: 0.82rem !important;
  }

  #globalSearchInput::placeholder {
    font-size: 0.78rem;
  }
}

/* ---- Section Headers (title + nav buttons + "View All" link) ---- */
/* On small screens: stack title on top, buttons below */
@media (max-width: 575.98px) {
  section .d-flex.justify-content-between.align-items-end.mb-4 {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.6rem !important;
  }

  section .d-flex.justify-content-between.align-items-end.mb-4>div:last-child {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }

  /* Make "View All" links shorter */
  section .d-flex.justify-content-between.align-items-end.mb-4 a.btn {
    font-size: 0.75rem !important;
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
  }
}

/* ---- Hero Banner: uniform consistent height across all banners on mobile ---- */
@media (max-width: 767.98px) {
  .full-width-banner-img {
    height: 180px !important;
    min-height: 180px !important;
    max-height: 180px !important;
    width: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    background-color: #ffffff;
  }
}

/* ---- Publishing Services Section (Section 11) ---- */
@media (max-width: 575.98px) {
  #publishing-services .row.g-3.mb-4 .col-sm-4 {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  #publishing-services h2.display-6 {
    font-size: 1.4rem !important;
  }

  #publishing-services p.lead {
    font-size: 0.9rem !important;
  }

  #publishing-services .d-flex.flex-wrap.gap-2 a {
    width: 100% !important;
    text-align: center;
  }
}

@media (max-width: 767.98px) {
  #publishing-services .row.g-3.mb-4 .col-sm-4 {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}

/* ---- Newsletter CTA Section ---- */
@media (max-width: 575.98px) {
  .newsletter-cta-card {
    padding: 1.75rem 1rem !important;
  }

  .newsletter-cta-card h3 {
    font-size: 1.15rem !important;
  }

  /* Stack newsletter input & button vertically */
  #homeNewsletterForm .input-group {
    flex-direction: column !important;
    border-radius: 12px !important;
    padding: 0.5rem !important;
    gap: 0.5rem !important;
  }

  #homeNewsletterForm .input-group .input-group-text {
    display: none !important;
  }

  #homeNewsletterForm .input-group input[type="email"] {
    border-radius: 8px !important;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid #dbe3eb !important;
    width: 100% !important;
  }

  #homeNewsletterForm .input-group button[type="submit"] {
    border-radius: 8px !important;
    width: 100% !important;
  }
}

/* ---- Footer ---- */
@media (max-width: 767.98px) {
  footer .d-flex.gap-2 {
    flex-wrap: wrap !important;
  }

  /* Long email address: allow break */
  footer a[href^="mailto"] {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
  }

  /* Footer bottom bar: stack on small screens */
  footer .d-flex.flex-column.flex-md-row {
    text-align: center !important;
  }

  footer .d-flex.gap-4 {
    gap: 1rem !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
}

@media (max-width: 575.98px) {
  footer .col-6 {
    font-size: 0.82rem;
  }

  footer h6 {
    font-size: 0.9rem;
  }

  /* Newsletter form in footer */
  footer #newsletterForm .input-group {
    flex-direction: column !important;
    gap: 0.4rem !important;
  }

  footer #newsletterForm .input-group input,
  footer #newsletterForm .input-group button {
    width: 100% !important;
    border-radius: 6px !important;
  }
}

/* ---- Carousel Section Widths (Extra Small) ---- */
@media (max-width: 399.98px) {
  .book-carousel-track>.col {
    flex: 0 0 155px !important;
    max-width: 165px !important;
    width: 155px !important;
  }

  .subject-carousel-item {
    flex: 0 0 155px;
    max-width: 165px;
    width: 155px;
  }

  .category-carousel-item {
    flex: 0 0 200px;
    width: 200px;
  }

  .author-carousel-item {
    flex: 0 0 230px;
    width: 230px;
  }

  .publisher-carousel-item {
    flex: 0 0 130px;
    width: 130px;
  }

  .journal-carousel-item,
  .editorial-carousel-item {
    flex: 0 0 240px;
    width: 240px;
  }

  .book-card-cover {
    height: 190px !important;
  }
}

/* ---- General Mobile Utilities ---- */
@media (max-width: 575.98px) {

  /* Prevent any section from causing horizontal scroll */
  section {
    overflow-x: hidden;
  }

  /* Tighter section padding */
  section.py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  /* Section sub-headings */
  section h3.fw-bold {
    font-size: 1.15rem !important;
  }

  section span.text-uppercase.font-monospace {
    font-size: 0.7rem !important;
  }

  /* Container padding */
  .container {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }
}

/* ---- Prevent horizontal overflow globally ---- */
html,
body {
  overflow-x: hidden !important;
  max-width: 100%;
}

/* ================================================================
   FIX 1: Book Card Carousel — cropped second card on mobile
   On narrow screens, hide button text → icon-only to save space,
   preventing card content from overflowing and causing crop effect
   ================================================================ */
@media (max-width: 767.98px) {

  /* Show icon only for Add/Buy buttons inside carousel cards */
  .book-carousel-track .btn-add-cart span,
  .book-carousel-track .btn-buy-now span {
    display: none !important;
  }

  .book-carousel-track .btn-add-cart,
  .book-carousel-track .btn-buy-now {
    flex: 1 1 auto !important;
    padding-left: 0.4rem !important;
    padding-right: 0.4rem !important;
    justify-content: center !important;
  }

  /* Tighter card body padding in carousel */
  .book-carousel-track .card-body {
    padding: 0.55rem !important;
  }

  /* Smaller price in carousel card */
  .book-carousel-track .fs-5.fw-bold {
    font-size: 0.9rem !important;
  }

  /* Reduce bottom padding on cover */
  .book-carousel-track .book-card-cover {
    height: 230px !important;
  }
}

@media (max-width: 575.98px) {

  /* Prevent flex children text spill in all carousels */
  .book-carousel-track *,
  .author-carousel-item *,
  .publisher-carousel-item *,
  .subject-carousel-item *,
  .category-carousel-item * {
    min-width: 0;
  }

  /* Hide unnecessary circle arrow buttons in section headers on mobile */
  section .carousel-nav-btn {
    display: none !important;
  }

  /* Section Header layout on mobile */
  section .d-flex.justify-content-between.align-items-end.mb-4 {
    flex-direction: row !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    margin-bottom: 0.85rem !important;
  }

  section .d-flex.justify-content-between.align-items-end.mb-4>div:first-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding-right: 0.5rem !important;
  }

  section .d-flex.justify-content-between.align-items-end.mb-4>div:last-child {
    width: auto !important;
    flex-shrink: 0 !important;
  }

  section .d-flex.justify-content-between.align-items-end.mb-4 a.btn {
    font-size: 0.72rem !important;
    padding: 0.22rem 0.6rem !important;
    white-space: nowrap !important;
  }

  section h3.fw-bold {
    font-size: 1.15rem !important;
    margin-bottom: 0.15rem !important;
  }

  section p.text-secondary.small {
    font-size: 0.75rem !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 1 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  /* Book Carousel Track: 160px card width */
  .book-carousel-track {
    gap: 0.75rem !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .book-carousel-track>.col {
    flex: 0 0 160px !important;
    max-width: 160px !important;
    width: 160px !important;
  }

  .book-carousel-track .book-card-cover {
    height: 200px !important;
  }

  .book-card .card-body {
    padding: 0.5rem !important;
  }

  .book-card-title {
    font-size: 0.8rem !important;
    height: 2.5em !important;
    line-height: 1.25 !important;
  }

  .book-card .fs-5 {
    font-size: 0.85rem !important;
  }

  /* Subject items: 170px */
  .subject-carousel-item {
    flex: 0 0 170px !important;
    max-width: 170px !important;
    width: 170px !important;
  }

  /* Category items: 220px */
  .category-carousel-item {
    flex: 0 0 220px !important;
    max-width: 220px !important;
    width: 220px !important;
  }

  /* Featured Author items: 230px wide horizontal card */
  .author-carousel-item {
    flex: 0 0 230px !important;
    max-width: 230px !important;
    width: 230px !important;
  }

  .author-carousel-item .card {
    padding: 0.75rem !important;
  }

  .author-carousel-item .d-flex.align-items-center.gap-3 {
    flex-direction: row !important;
    align-items: center !important;
    text-align: left !important;
    gap: 0.65rem !important;
  }

  .author-carousel-item .rounded-circle {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
  }

  .author-carousel-item h6 {
    font-size: 0.85rem !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .author-carousel-item .text-secondary.small {
    font-size: 0.72rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .author-carousel-item .text-primary.small {
    font-size: 0.7rem !important;
    white-space: nowrap !important;
  }

  /* Publisher items: 160px */
  .publisher-carousel-item {
    flex: 0 0 160px !important;
    max-width: 160px !important;
    width: 160px !important;
  }

  /* Journal & Editorial items: 270px width (82vw max) on mobile so long journal titles fit cleanly */
  .journal-carousel-item,
  .editorial-carousel-item {
    flex: 0 0 270px !important;
    max-width: 82vw !important;
    width: 270px !important;
  }

  .journal-carousel-item .card {
    padding: 0.85rem !important;
  }

  .journal-carousel-item h6 {
    font-size: 0.88rem !important;
    line-height: 1.32 !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: manual !important;
  }

  .journal-carousel-item .border-top {
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
  }

  .editorial-carousel-item .card-body {
    padding: 0.85rem !important;
  }
}

/* ================================================================
   FIX 2: Book Detail Page — full responsive overhaul
   ================================================================ */

/* Stack the two-column layout on all screens below lg */
@media (max-width: 991.98px) {

  /* Remove huge gap between image and text columns */
  .book-detail-card .row.g-5,
  div.card.rounded-4.p-4.p-lg-5 .row.g-5 {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
  }
}

@media (max-width: 767.98px) {

  /* Book detail main container: tighter padding */
  .container.py-4>.card.rounded-4 {
    padding: 1.25rem !important;
  }

  /* Book title size */
  div.col-lg-7 h1.fw-bold {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
  }

  div.col-lg-7 h5.fw-normal {
    font-size: 1rem !important;
  }

  /* Pricing display-6 is too big on mobile */
  div.col-lg-7 .display-6 {
    font-size: 1.6rem !important;
  }

  div.col-lg-7 .fs-5.text-muted {
    font-size: 1rem !important;
  }

  /* Save badge: wrap gracefully */
  div.col-lg-7 .p-3.bg-light .d-flex.align-items-baseline {
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }

  /* Stock badge + dispatch: stack */
  div.col-lg-7 .mt-3.pt-3.border-top.d-flex {
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }

  /* Ratings row: wrap on small */
  div.col-lg-7 .d-flex.align-items-center.gap-2.mb-4 {
    flex-wrap: wrap !important;
    gap: 0.35rem !important;
  }

  /* Verified badge: full width */
  div.col-lg-7 .badge.bg-light.text-success {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 767.98px) {

  /* Horizontal scrollable tab pills on mobile */
  #bookDetailsTab {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 0.5rem !important;
    gap: 0.35rem !important;
  }

  #bookDetailsTab::-webkit-scrollbar {
    display: none !important;
  }

  #bookDetailsTab .nav-item {
    flex: 0 0 auto !important;
  }

  #bookDetailsTab .nav-link {
    white-space: nowrap !important;
    font-size: 0.78rem !important;
    padding: 0.38rem 0.85rem !important;
    border-radius: 50rem !important;
  }
}

@media (max-width: 575.98px) {

  /* Product detail action buttons: side-by-side Add to Cart + Buy Now, compact Wishlist */
  div.col-lg-7 .d-flex.flex-wrap.gap-3.mb-4,
  div.col-lg-7 .d-flex.gap-3.mb-4,
  div.col-lg-7 .d-flex.flex-wrap {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }

  div.col-lg-7 .btn-add-cart,
  div.col-lg-7 .btn-buy-now {
    flex: 1 1 calc(50% - 0.25rem) !important;
    max-width: calc(50% - 0.25rem) !important;
    width: calc(50% - 0.25rem) !important;
    min-width: 0 !important;
    font-size: 0.78rem !important;
    padding: 0.45rem 0.2rem !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  div.col-lg-7 .btn-add-cart span,
  div.col-lg-7 .btn-buy-now span {
    font-size: 0.76rem !important;
    white-space: nowrap !important;
  }

  div.col-lg-7 .btn-add-cart i,
  div.col-lg-7 .btn-buy-now i {
    font-size: 0.85rem !important;
  }

  div.col-lg-7 .btn-wishlist {
    flex: 1 1 100% !important;
    width: 100% !important;
    font-size: 0.76rem !important;
    padding: 0.32rem 0.65rem !important;
    justify-content: center !important;
    margin-top: 0.15rem !important;
  }

  /* Breadcrumb: truncate long titles */
  .breadcrumb-item.active {
    max-width: 200px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  /* Book cover: cap height sensibly */
  div.col-lg-5 img#mainBookCover {
    max-height: 320px !important;
  }

  /* Metadata table inside detail page */
  div.col-lg-7 table {
    font-size: 0.82rem !important;
  }

  div.col-lg-7 table td,
  div.col-lg-7 table th {
    padding: 0.3rem 0.5rem !important;
  }
}

/* Contact Page Map Responsive Styling */
.contact-map-container {
  position: relative;
  width: 100%;
}

@media (max-width: 767.98px) {
  .contact-map-container {
    min-height: 250px !important;
    height: 300px !important;
    max-height: 320px !important;
  }
}

/* Footer Interactive Styles */
.footer-link {
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.footer-link:hover {
  color: #ffd700 !important;
  transform: translateX(2px);
}

.footer-social-btn:hover {
  background: #ffd700 !important;
  color: #772905 !important;
  border-color: #ffd700 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.newsletter-form .d-flex {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  background-color: #ffffff;
}

.newsletter-form .form-control {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.newsletter-form .btn {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  transition: all 0.2s ease-in-out;
}

.newsletter-form .btn:hover {
  filter: brightness(0.95);
  transform: scale(1.02);
}

/* ================= Intro Splash Screen Overlay ================= */
.site-intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: introOverlayFadeOut 0.7s cubic-bezier(0.4, 0, 0.2, 1) 2.2s forwards;
  pointer-events: none;
}

.site-intro-overlay.fade-out {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@keyframes introOverlayFadeOut {
  0% {
    opacity: 1;
    visibility: visible;
  }

  99% {
    opacity: 0;
    visibility: visible;
  }

  100% {
    opacity: 0;
    visibility: hidden;
    display: none;
  }
}

.intro-typing-badge {
  background: linear-gradient(135deg, #5c1f03 0%, #772905 50%, #461601 100%);
  border: 1.5px solid rgba(243, 168, 51, 0.45);
  border-radius: 14px;
  padding: 12px 28px;
  box-shadow: 0 12px 35px rgba(59, 23, 6, 0.65), inset 0 1px 1px rgba(243, 168, 51, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
}

.intro-typing-text {
  font-family: var(--font-heading, "Playfair Display", Georgia, serif);
  font-size: clamp(1.15rem, 2.5vw, 1.65rem);
  font-weight: 600;
  color: #ffffff !important;
  letter-spacing: 0.04em;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2.5px solid #f3a833;
  animation: introTypewriter 1.4s steps(22, end) 0.15s 1 normal both,
    introCursorBlink 0.65s step-end infinite alternate;
}

@keyframes introTypewriter {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

/* CMS Quick Links Static Pages Layout (Image 2 Design) */
.cms-page-title-blue {
  color: #0088cc !important;
  font-size: 1.55rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
  margin-bottom: 0 !important;
  line-height: 1.3 !important;
}

.cms-page-title-underline {
  width: 100px;
  height: 2px;
  background-color: #0088cc;
  margin: 8px auto 0 auto;
}

.cms-page-content {
  color: #4a4a4a !important;
  font-size: 0.92rem !important;
  line-height: 1.65 !important;
  font-weight: 400 !important;
}

.cms-page-content h1,
.cms-page-content h2,
.cms-page-content h3,
.cms-page-content h4,
.cms-page-content h5,
.cms-page-content h6 {
  font-weight: 600 !important;
  color: #333333 !important;
  font-size: 1.18rem !important;
  margin-top: 1.4rem !important;
  margin-bottom: 0.75rem !important;
  line-height: 1.35 !important;
}

.cms-page-content p {
  margin-bottom: 1rem !important;
  color: #4a4a4a !important;
}

.cms-page-content ul,
.cms-page-content ol {
  margin-bottom: 1rem !important;
  padding-left: 1.25rem !important;
}

.cms-page-content li {
  margin-bottom: 0.35rem !important;
  color: #4a4a4a !important;
}

.cms-page-content strong,
.cms-page-content b {
  color: #333333 !important;
  font-weight: 600 !important;
}

@keyframes introCursorBlink {
  50% {
    border-color: transparent;
  }
}

/* Footer Specific Styles */
.footer-subscribe-btn:hover {
  background-color: #3b1100 !important;
  border-color: #ffd700 !important;
  color: #ffd700 !important;
}

.footer-social-square {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.footer-social-square:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}