/* Custom Theme Styles for Publishing Platform & Bookstore */

:root {
  --primary-color: #1a446c;
  --primary-hover: #133352;
  --secondary-color: #d4af37;
  --font-serif: 'Merriweather', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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: 60px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.header-logo-ibw:hover {
  transform: scale(1.02);
}

.header-logo-standard {
  height: 52px;
  max-height: 56px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.header-logo-standard:hover {
  transform: scale(1.02);
}

.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;
}

.text-primary {
  color: var(--primary-color) !important;
}

.bg-primary-subtle {
  background-color: #e8f0f8 !important;
}

.hover-link:hover {
  color: #ffffff !important;
  text-decoration: underline !important;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #102a43 0%, #1a446c 60%, #243b55 100%);
}

.main-hero-img {
  max-height: 380px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.main-hero-img:hover {
  transform: translateY(-4px);
}

/* 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 */
.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: auto;
  aspect-ratio: 1024 / 384;
  object-fit: cover;
  object-position: center top;
  display: block;
}

@media (min-width: 1600px) {
  .full-width-banner-img {
    max-height: 520px;
  }
}

/* Navigation & Subjects Mega Menu */
.navbar-nav .nav-link {
  font-size: 0.88rem;
  padding-left: 0.55rem !important;
  padding-right: 0.55rem !important;
  transition: color 0.15s ease-in-out;
}

.navbar-nav .nav-link:hover {
  color: var(--primary-color) !important;
}

/* Desktop Navigation & Subjects Mega Menu (>= 992px) */
@media (min-width: 992px) {
  .dropdown-mega {
    position: static !important;
  }

  .dropdown-menu-mega {
    position: absolute !important;
    width: 95%;
    max-width: 1280px;
    margin: 0 auto;
    left: 2.5% !important;
    right: 2.5% !important;
    top: 100% !important;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    z-index: 1050;
  }

  .dropdown-mega:hover > .dropdown-menu-mega {
    display: block;
    animation: fadeInMega 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
}

@keyframes fadeInMega {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Navigation & Accordion Mega Menu (< 992px) */
@media (max-width: 991.98px) {
  .navbar-toggler {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0.35rem 0.65rem !important;
    background-color: #f8fafc;
  }

  #categoryNav {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  #categoryNav .navbar-nav .nav-item {
    border-bottom: 1px solid #f1f5f9;
  }

  #categoryNav .navbar-nav .nav-item:last-child {
    border-bottom: none;
  }

  #categoryNav .navbar-nav .nav-link {
    padding: 0.65rem 0.5rem !important;
    font-size: 0.92rem !important;
    display: flex;
    align-items: center;
    border-radius: 6px;
  }

  #categoryNav .navbar-nav .nav-link:hover,
  #categoryNav .navbar-nav .nav-link:active {
    background-color: #f8fafc;
  }

  .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.75rem !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    background-color: #f8fafc !important;
  }

  .dropdown-menu-mega .mega-menu-scrollable-grid {
    max-height: 280px !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: 42px !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: #f1f5f9;
  color: #1e3a8a;
  font-weight: 500;
  padding-left: 0.8rem;
}

.mega-subject-item:hover i {
  color: #1e3a8a;
  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: 14px !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: 240px;
  background: #f8fafc;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-cover-img {
  max-height: 210px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.13);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.book-card:hover .book-cover-img {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.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.92rem;
  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: 190px;
  }
  .book-cover-img {
    max-height: 165px;
  }
  .quick-view-overlay {
    display: none !important;
  }
}

@media (max-width: 575.98px) {
  .book-card .card-body {
    padding: 0.65rem !important;
  }
  .book-card-cover {
    height: 160px !important;
  }
  .book-cover-img {
    max-height: 140px !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: #1a446c;
  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: #1a446c;
  color: #ffffff;
  border-color: #1a446c;
  box-shadow: 0 6px 20px rgba(26, 68, 108, 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: #1a446c;
  border-color: #1a446c;
  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(26, 68, 108, 0.12);
  border-color: #1a446c !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: #1a446c !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.85rem;
  }
  .book-carousel-track > .col {
    flex: 0 0 190px !important;
    max-width: 200px !important;
    width: 190px !important;
  }
  .subject-carousel-item {
    flex: 0 0 180px;
    max-width: 190px;
    width: 180px;
  }
  .category-carousel-item {
    flex: 0 0 230px;
    width: 230px;
  }
  .author-carousel-item {
    flex: 0 0 260px;
    width: 260px;
  }
  .publisher-carousel-item {
    flex: 0 0 155px;
    width: 155px;
  }
  .journal-carousel-item,
  .editorial-carousel-item {
    flex: 0 0 270px;
    width: 270px;
  }
  .book-carousel-arrow {
    display: none !important;
  }
}

/* ================= Pagination Component ================= */
.pagination {
  gap: 4px;
}
.pagination .page-item .page-link {
  color: #334155;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px !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: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.25);
  font-weight: 700;
}
.pagination .page-item.disabled .page-link {
  color: #94a3b8;
  background-color: #f8fafc;
  border-color: #e2e8f0;
  opacity: 0.85;
}


