/* === GLOBAL STYLES === */

body {
  margin: 0;
  padding: 0;
  font-family: "Open Sans", sans-serif;
  background: #F8F9FF;
  overflow-x: hidden;
}
img {
  image-rendering: auto;
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* === HEADER & NAVIGATION === */

/* === LOGO + HEADER HIGHLIGHTS === */

.logo-highlight-purple {
  color: #1B365D;
  font-weight: 700;
}

.logo-highlight-gold {
  color: #FFD700;
  font-weight: 700;
}

.text-purple {
  color: #1B365D !important;
}

.header-link {
  color: #FFD700 !important;
  font-weight: 500;
}

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

header {
  background-color: #F5F7FA;
}
.header-link {
  color: #FFD700 !important;
  font-weight: 500;
}
.header-link:hover {
  color: #fff !important;
  text-decoration: underline;
}

/* === SECTION HEADINGS === */

.section-header {
  text-align: center;
  margin-bottom: 0.25rem !important;
  margin-top: 1.5rem;
  position: relative;
}
.section-heading {
  font-size: 1.75rem;
  font-weight: bold;
  color: #1B365D;
  text-transform: uppercase;
  text-align: center;
  padding: 0 1rem;
  margin: 0 0 0.5rem;
}
.section-divider {
  border: none;
  border-top: 1px solid #1B365D;
  width: 100%;
  margin: 0 auto 2rem;
}
.see-all-link {
  display: inline-block;
  text-align: center;
  margin-top: 0.1rem;
  margin-bottom: 0.5rem;
  color: #2b7a3d;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: underline;
}

/* === SPECIAL NEWS BAR === */

.special-news-bar {
  background-color: #1B365D;
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid #e0d7a0;
}

/* === SEARCH BAR === */

.search-bar .form-control,
.search-bar .form-select {
  border: 2px solid #1B365D;
  border-radius: 6px;
  background-color: #fff;
  color: #1B365D;
  box-shadow: none;
}
.search-bar .form-control:focus,
.search-bar .form-select:focus {
  border-color: #ccc;
  box-shadow: none;
}
.search-bar .form-control::placeholder {
  color: #1B365D;
}
.search-bar .btn {
  background-color: #FF5722;
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 0 1.25rem;
  border-radius: 6px;
  transition: background-color 0.2s ease-in-out;
}
.search-bar .btn:hover {
  background-color: #e6450f;
}
.input-group {
  border-radius: 12px !important;
  background-color: #f8f9fa;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.input-group .form-control,
.input-group .btn,
.cart-box .cart-button {
  height: 38px;
  line-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}
select.form-select {
  width: 220px !important;
  max-width: 220px !important;
  padding-right: 30px;
  font-weight: 600;
  font-size: 1rem;
  height: 38px;
  color: #1B365D;
  background-position: right 10px center;
}

/* === TOP NAVIGATION BAR === */

.top-navbar {
  margin-top: 0.5rem;
  background-color: transparent;
  padding: 0.5rem 0;
}

.top-nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem; /* reduced gap for tighter spacing */
  font-size: 0.95rem;
}

.top-nav-menu li {
  position: relative;
  display: flex;
  align-items: center;
}

.top-nav-menu a {
  font-weight: 600;
  color: #1B365D;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0 0.2rem 4px;
  transition: color 0.3s ease;
  position: relative;
  white-space: nowrap;
}

.top-nav-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background-color: #FFD700;
  transition: width 0.3s ease;
}

.top-nav-menu a:hover::after {
  width: 100%;
}

.top-nav-menu a:hover {
  color: #CFA544;
}

.nav-sep {
  font-weight: 400;
  font-size: 1rem;
  color: #999;
  margin: 0 0.25rem;
  user-select: none;
}

/* === MOBILE NAVIGATION === */

.mobile-nav-toggle {
  text-align: right;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.mobile-nav-toggle img {
  width: 28px;
  height: 28px;
}

.mobile-nav-popup {
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  background-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 9999;
  display: none;
}

.mobile-nav-popup.active {
  display: block;
}

.mobile-nav-links {
  list-style: none;
  padding: 1rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.mobile-nav-links li a {
  color: #1B365D;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
}

.mobile-nav-links li a:hover {
  text-decoration: underline;
  color: #CFA544;
}

/* Hide top nav and show hamburger on small screens */
@media (max-width: 768px) {
  .top-navbar {
    display: none !important;
  }
  .mobile-nav-toggle {
    display: block;
  }
}


/* === SWIPER BANNER === */

.banner-swiper {
  position: relative;
  width: 100%;
  height: auto;
  margin-bottom: 2rem;
}

.banner-swiper .swiper-slide img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.banner-swiper .swiper-button-next,
.banner-swiper .swiper-button-prev {
  color: #FFD700;
  width: 45px;
  height: 45px;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.banner-swiper .swiper-button-next:hover,
.banner-swiper .swiper-button-prev:hover {
  background-color: rgba(0, 0, 0, 0.6);
}

.banner-swiper .swiper-button-next::after,
.banner-swiper .swiper-button-prev::after {
  font-size: 20px;
  font-weight: bold;
}

@media (max-width: 768px) {
  .banner-swiper {
    margin-bottom: 1.5rem;
  }
}

/* === CAROUSEL === */

/* Re-enable the default Splide arrows and apply custom styles */

.splide .splide__arrow {
  display: flex !important;
  background: #F4E4C9 !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  pointer-events: all !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  width: 50px !important;
  height: 50px !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
  position: absolute !important;
  margin: 0 !important;
}

.splide .splide__arrow.splide__arrow--prev {
  left: -90px !important;
}

.splide .splide__arrow.splide__arrow--next {
  right: -90px !important;
}

.splide .splide__arrow svg {
  fill: #163F64 !important;
  height: 1.5em !important;
  width: 1.5em !important;
}

.splide .splide__arrow.splide__arrow--prev:hover,
.splide .splide__arrow.splide__arrow--next:hover {
  background-color: #CFA544 !important;
  color: #FAF2E4 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Carousel container for overflow */

.swiper-container {
  overflow: hidden;
  width: 100%;
}

/* Adjust positioning for larger screens */

@media (min-width: 1200px) {
  .splide .splide__arrow.splide__arrow--prev {
    left: -55px !important;
  }

  .splide .splide__arrow.splide__arrow--next {
    right: -55px !important;
  }
}

/* === BOOK CARDS === */

.card {
  width: 100%;
  background: #fff;
  border: none;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: scale(1.015);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}
.card img {
  object-fit: contain;
  width: 100%;
  height: auto;
  max-height: 250px;
  display: block;
  margin: 0 auto;
  padding: 10px;
}
.card .card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-card:hover .card-title {
  text-decoration: underline;
}
.book-price span {
  font-size: 1.00rem !important;
  font-weight: 100 !important;
  color: #000 !important;
  display: inline-block;
  line-height: 1.2;
}

/* === CART BOX === */

.cart-box {
  display: flex;
  align-items: center;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.cart-box .cart-text {
  padding: 0.5rem 1rem;
  font-weight: 500;
  color: #000;
  white-space: nowrap;
  height: 38px;
  line-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-box .cart-button {
  background-color: #0099E5;
  color: #fff;
  font-weight: bold;
  padding: 0 1.25rem;
  border: none;
  border-left: 1px solid #ddd;
  border-radius: 6px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-box .cart-button:hover {
  background-color: #007ACC;
}

/* === Footer Styles === */

.footer-bg {
  background-color: #f5f6fa;
  color: #0d3b66;
  padding: 3rem 1rem 2rem;
  font-size: 0.95rem;
}

.footer-bg a {
  color: #0d3b66;
  text-decoration: none;
}

.footer-bg a:hover {
  text-decoration: underline;
}

.footer-bg .row {
  row-gap: 1rem;
  column-gap: 1rem;
}

.footer-bottom {
  background-color: #0d3b66;
  color: #ddd;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1rem 0;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 2rem;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding-top: 2rem;
}

.social-icons a {
  display: inline-block;
}

.social-icons img {
  width: 32px;
  height: 32px;
  transition: transform 0.2s ease;
}

.social-icons img:hover {
  transform: scale(1.1);
}

.newsletter-form .input-group {
  flex-wrap: nowrap;
}

.newsletter-form .form-control {
  font-size: 0.9rem;
  padding: 0.375rem 0.5rem;
  background: #fff;
  color: #000;
  border: 1px solid #ccc;
  border-radius: 0;
}

.newsletter-form .btn {
  font-size: 0.9rem;
  padding: 0.375rem 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 0;
}

.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #FFD700;
  color: #4A148C;
  font-weight: bold;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 50px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 999;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-to-top:hover {
  background-color: #FFC107;
}

/* === Responsive === */

@media (max-width: 767.98px) {
  .footer-newsletter {
    margin-top: 2rem;
    text-align: center;
  }

  .social-icons {
    padding-top: 1rem;
    gap: 1rem;
  }
}

/* === MOBILE OPTIMIZATION === */

@media (max-width: 767.98px) {
  .search-bar .input-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .search-bar .form-control,
  .search-bar .form-select,
  .search-bar .btn {
    width: 100% !important;
    border-radius: 6px !important;
    height: 48px;
    font-size: 1.05rem;
    padding: 0 16px;
    font-weight: 600;
  }
  .form-select {
    font-size: 1rem;
    background-position: right 1rem center;
  }

  .cart-box {
    flex-direction: column;
    align-items: stretch;
    margin: 0.75rem 0 1rem;
  }

  .cart-box .cart-text,
  .cart-box .cart-button {
    justify-content: center;
    width: 100%;
    border-left: none;
    border-radius: 6px;
    height: 48px;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0 16px;
  }

  .input-group > *,
  .search-bar,
  .cart-box {
    margin-bottom: 10px;
  }

  .book-card img,
  .carousel-item img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    max-height: 240px;
    display: block;
    margin: 0 auto;
  }

  .book-card .card {
    padding: 0.5rem;
  }

  body {
    font-size: 16px;
  }

  a, button {
    min-height: 48px;
  }

  img {
    max-width: 100%;
    height: auto;
  }
}

/* === Mobile Layout === */

@media (max-width: 767.98px) {
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    overflow-x: hidden;
  }

  .special-news-bar {
    font-size: 0.95rem;
    padding: 8px 10px;
  }

  .site-header {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .cart-box {
    width: 100%;
    text-align: center;
    margin-top: 10px;
  }

  .cart-box .cart-button {
    display: inline-block;
    width: auto;
    padding: 6px 16px;
    font-size: 0.9rem;
  }

  .search-form-wide {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form-wide .input-group {
    flex-direction: column;
    width: 100%;
  }

  .search-form-wide input,
  .search-form-wide select,
  .search-form-wide button {
    width: 100%;
    margin-bottom: 8px;
  }

  .search-form-wide .btn {
    margin-bottom: 0;
  }

  .splide__slide .card,
  .swiper-slide .card {
    margin: 0 auto;
  }

  .card-img-top {
    height: auto;
    max-height: 300px;
    object-fit: contain;
  }

  .swipe-hint {
    font-size: 0.85rem;
    color: #555;
    font-style: italic;
    text-align: center;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
  }

  .swiper,
  .splide {
    overflow-x: hidden !important;
  }

  .container,
  .row,
  .col,
  .col-md-3,
  .col-md-2,
  .col-md-5 {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Slide-In Nav Styles */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
}

.mobile-nav-popup-slide {
  position: fixed;
  top: 0;
  left: -260px;
  width: 260px;
  height: 100%;
  background-color: #fff;
  box-shadow: 2px 0 12px rgba(0,0,0,0.25);
  padding: 1rem;
  z-index: 9999;
  transition: left 0.3s ease;
  overflow-y: auto;
}

.mobile-nav-popup-slide.active {
  left: 0;
}

.mobile-nav-overlay.active {
  display: block;
}

.mobile-nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-nav-links li a {
  color: #1B365D;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
}

.mobile-nav-links li a:hover {
  color: #CFA544;
  text-decoration: underline;
}

/* === MOBILE FOOTER ACCORDION (CLEANED + FINAL) === */
@media (max-width: 767.98px) {
  .footer-bg .footer-section {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
  }

  .footer-bg .footer-section h6 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0d3b66;
    padding: 0.5rem 0;
    margin: 0;
    cursor: pointer;
    position: relative;
  }

  .footer-bg .footer-section h6::after {
    content: "▼";
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: #333;
  }

  .footer-bg .footer-section.expanded h6::after {
    transform: rotate(180deg);
  }

  .footer-bg .footer-section ul {
    display: none;
    padding: 0.25rem 0 0.5rem 0.75rem;
    margin: 0;
    list-style: none;
    border-left: 3px solid #CFA544;
  }

  .footer-bg .footer-section.expanded ul {
    display: block;
  }

  .footer-bg .footer-section li {
    margin: 0.25rem 0;
  }

  .footer-bg .footer-section li a {
    display: block;
    color: #1B365D;
    font-weight: 500;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
  }

  .footer-bg .footer-section li a:hover {
    background-color: #dce2ec;
    color: #1B365D;
  }
}

/* ===== BookVale — CART (minimal, scoped, conflict-free) ===== */

/* Use Bootstrap grid to control width (done in cart.php) — no width CSS needed. */
/* Styles below only handle aesthetics and small tweaks. */

.cart-page .cart-title {
  font-size: 2rem;
  font-weight: 700;
  color: #2c5aa0;
  text-align: center;
  margin-bottom: 1.25rem;
}

/* Progress steps */
.cart-page .cart-progress-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; padding: .75rem; margin-bottom: 1.5rem;
  background: #f8f9fa; border-radius: 10px;
}
.cart-page .step { display: flex; flex-direction: column; align-items: center; }
.cart-page .step-number {
  width: 40px; height: 40px; border-radius: 50%;
  background: #6c757d; color:#fff; display:flex; align-items:center; justify-content:center;
  font-weight: 700; margin-bottom: 6px;
}
.cart-page .step-label { font-size:.9rem; color:#6c757d; font-weight:500; }
.cart-page .step.active .step-number { background:#0d6efd; }
.cart-page .step.active .step-label { color:#0d6efd; }

/* Items card (table wrapper) */
.cart-page .cart-table-container {
  background:#fff; border-radius: 12px;
  border: 1px solid rgba(13,59,102,.08);
  box-shadow: 0 8px 24px rgba(13,59,102,.08);
  overflow:hidden;
}

/* Table */
.cart-page .cart-table thead { background: linear-gradient(135deg,#eaf3ff 0%,#f4faef 100%); }
.cart-page .cart-table thead th {
  border:0; padding: 1rem; font-weight:600; color:#2c5aa0; text-transform:uppercase; font-size:.85rem;
}
.cart-page .cart-table tbody tr { border-bottom: 1px solid #f5f6fa; }
.cart-page .cart-table tbody td { border:0; padding: 1.25rem 1rem; vertical-align: middle; }
.cart-page .cart-table tbody tr:hover td { background-color: rgba(13,59,102,.02); }

/* Book row bits */
.cart-page .book-cover-img { width:64px; height:auto; border-radius:8px; box-shadow:0 2px 8px rgba(0,0,0,.12); }
.cart-page .book-title { margin:0 0 .25rem 0; font-size:1.05rem; font-weight:600; color:#2c5aa0; }
.cart-page .price { color:#28a745; font-weight:600; }

/* Divider between list and summary */
.cart-page hr { opacity:.15; }

/* Summary card */
.cart-page .cart-summary {
  background:#fff; border-radius:12px; border:1px solid rgba(13,59,102,.08);
  box-shadow: 0 8px 24px rgba(13,59,102,.08); padding: 1.5rem;
}
.cart-page .total-price h4 { color:#2c5aa0; font-weight:700; margin:0; }
.cart-page .total-amount { color:#28a745; }

/* Small screen polish */
@media (max-width: 576px) {
  .cart-page .cart-summary { padding: 1.25rem; }
}

/* ===== BookVale CART — restore polished styling (scoped, minimal) ===== */
.cart-page { --bv-blue:#2c5aa0; --bv-green:#28a745; --bv-shadow:0 8px 24px rgba(13,59,102,.08); --bv-border:1px solid rgba(13,59,102,.08); }

/* Title */
.cart-page .cart-title{
  font-size:2rem;font-weight:800;letter-spacing:.5px;color:var(--bv-blue);text-align:center;margin-bottom:1.25rem;
}

/* Progress steps */
.cart-page .cart-progress-steps{
  display:flex;align-items:center;justify-content:center;gap:1rem;padding:.75rem;margin-bottom:1.5rem;
  background:#f8f9fa;border-radius:10px;
}
.cart-page .step{display:flex;flex-direction:column;align-items:center;min-width:86px}
.cart-page .step-number{
  width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  font-weight:700;color:#fff;background:#6c757d;margin-bottom:6px
}
.cart-page .step-label{font-size:.9rem;font-weight:600;color:#6c757d;text-align:center}
.cart-page .step.active .step-number{background:#0d6efd}
.cart-page .step.active .step-label{color:#0d6efd}
.cart-page .step-connector{height:2px;width:64px;background:#dee2e6;align-self:center}

/* Cart list container (card feel) */
.cart-page .cart-table-container{
  background:#fff;border-radius:12px;border:var(--bv-border);box-shadow:var(--bv-shadow);overflow:hidden
}
.cart-page .cart-table{margin-bottom:0}
.cart-page .cart-table thead{background:linear-gradient(135deg,#eaf3ff 0%,#f4faef 100%)}
.cart-page .cart-table thead th{
  border:0;padding:1rem;font-weight:700;color:var(--bv-blue);text-transform:uppercase;font-size:.85rem
}
.cart-page .cart-table tbody tr{border-bottom:1px solid #f1f3f5}
.cart-page .cart-table tbody td{border:0;padding:1.25rem 1rem;vertical-align:middle}
.cart-page .cart-table tbody tr:hover td{background:rgba(13,59,102,.02)}

/* Row bits */
.cart-page .book-cover-img{width:64px;height:auto;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.12)}
.cart-page .book-title{margin:0 0 .25rem 0;font-size:1.05rem;font-weight:700;color:var(--bv-blue)}
.cart-page .price{color:var(--bv-green);font-weight:700}

/* Divider */
.cart-page hr{opacity:.15}

/* Summary card */
.cart-page .cart-summary{
  background:#fff;border-radius:12px;border:var(--bv-border);box-shadow:var(--bv-shadow);padding:1.5rem
}
.cart-page .total-price h4{margin:0;font-weight:800;color:var(--bv-blue)}
.cart-page .total-amount{color:var(--bv-green)}

/* === PAYMENT METHOD OPTIONS === */
.pm-option.form-check {
  transition: box-shadow .15s ease, border-color .15s ease;
}
.pm-option.form-check:hover {
  box-shadow: 0 0 0 .15rem rgba(13,110,253,.1);
}
.pm-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.pm-copy strong {
  display: block;
}
.pm-note {
  margin-top: .15rem;
  font-size: .875rem;
  color: #6c757d;
}
.pm-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.pm-brand img {
  display: block;
  height: 36px;
  width: auto;
}
@media (max-width: 480px) {
  .pm-body {
    flex-direction: column;
    align-items: flex-start;
  }
}
