
/* styles.css */
:root {
  --primary-gold: #D4AF37;
  --soft-orange: #F4A261;
  --deep-blue: #1A3C5A;
  --cream: #FDFBF7;
  --light-gray: #F8F5F0;
  --dark-text: #2D2D2D;
  --shadow: 0 8px 30px rgba(0,0,0,0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--cream);
  color: var(--dark-text);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary-gold);
  color: #1a1a1a;
}

.btn-primary:hover {
  background: #c09c2e;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-gold);
  color: var(--primary-gold);
}

.btn-outline:hover {
  background: var(--primary-gold);
  color: #1a1a1a;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}

.full-width {
  width: 100%;
}

.section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  font-size: 2.8rem;
  margin-bottom: 3rem;
  color: var(--deep-blue);
}

/* Header */
.header {
  background: white;
  box-shadow: 0 2px 15px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 0;
}

.logo {
  font-size: 2.1rem;
  color: var(--deep-blue);
  margin: 0;
}

.tagline {
  font-size: 0.95rem;
  color: #666;
  margin-top: 0.2rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.nav a {
  color: var(--deep-blue);
  text-decoration: none;
  font-weight: 500;
}

.nav a:hover {
  color: var(--cream);
}

.btn-contact {
  background: var(--soft-orange);
  color: white;
  padding: 0.8rem 1.6rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  color: white;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(26,60,90,0.85), #D4AF37),
              url('Books Images/bckg.jpg') center/cover no-repeat;
  z-index: -1;
  opacity: 2.5;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h2 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta .btn {
  margin: 0.6rem;
}

/* Cards (What We Offer, Our Schools) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.card-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  color: var(--primary-gold);
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--deep-blue);
}

/* Shop Section */
.shop-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2rem 0 3rem;
  gap: 1.5rem;
}

.category-filter {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.category-title {
  font-weight: 600;
  color: var(--deep-blue);
  font-size: 1.1rem;
}

#categoryLinks {
  display: flex;
  list-style: none;
  gap: 0.5rem;
}

.category-link {
  display: block;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  color: var(--deep-blue);
  background-color: #f0f0f0;
  transition: all 0.3s ease;
}

.category-link:hover {
  background-color: #e0e0e0;
}

.category-link.active {
  background-color: var(--deep-blue);
  color: white;
  font-weight: 600;
}

.search-bar {
  padding: 1rem 1.6rem;
  font-size: 1.1rem;
  border: 2px solid #ddd;
  border-radius: 60px;
  width: 100%;
  max-width: 580px;
  margin: 0 auto 2.5rem;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.search-bar:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 4px 16px rgba(212,175,55,0.2);
}

/* 
  Accessible focus states for keyboard users.
  This will only show the outline for keyboard navigation, not mouse clicks.
*/
:focus-visible {
  outline: 2px solid var(--primary-gold);
  outline-offset: 2px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}

.book-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  transition: all 0.32s ease;
  position: relative;
}

.book-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.14);
}

.book-img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.book-card:hover .book-img {
  transform: scale(1.07);
}

.book-content {
  padding: 1.4rem;
  text-align: center;
}

.book-title {
  font-size: 1.28rem;
  margin-bottom: 0.7rem;
  color: var(--deep-blue);
  line-height: 1.35;
}

.book-price {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary-gold);
  margin: 0.8rem 0 1.2rem;
}

.select-btn {
  padding: 0.75rem 1.6rem;
  border-radius: 50px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
}

.select-btn.select {
  background: var(--deep-blue);
  color: white;
}

.select-btn.selected {
  background: #2e7d32; /* green confirmation */
  color: white;
}

.select-btn:hover {
  transform: translateY(-2px);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.pagination button {
  padding: 0.8rem 1.6rem;
  border-radius: 50px;
  border: none;
  background: #e0e0e0;
  color: #444;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.25s ease;
  min-width: 110px;
}

.pagination button:disabled {
  background: #f0f0f0;
  color: #aaa;
  cursor: not-allowed;
  opacity: 0.65;
}

.pagination button:not(:disabled):hover {
  background: var(--primary-gold);
  color: #1a1a1a;
  transform: translateY(-1px);
}

.page-number {
  padding: 0.6rem 1.1rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 36px;
  text-align: center;
}

.page-number.active {
  background: var(--deep-blue);
  color: white;
}

.page-number:hover:not(.active) {
  background: #f0e8d0;
}

/* Cart Summary */
.cart-summary {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: white;
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  min-width: 320px;
  max-width: 400px;
  z-index: 900;
}

.cart-summary.hidden {
  display: none;
}

.cart-summary h3 {
  margin-bottom: 1rem;
  color: var(--deep-blue);
}

#cart-items {
  list-style: none;
  margin-bottom: 1.2rem;
}

#cart-items li {
  margin-bottom: 0.5rem;
  font-size: 0.98rem;
}

.total {
  font-size: 1.3rem;
  margin: 1.2rem 0;
  text-align: right;
}

.cart-summary .btn {
  padding-top: 1rem;
  padding-bottom: 1rem;
  margin-top: 0.5rem;
  font-size: 1.05rem;
}

/* Impact Section */
.impact-section {
  background: var(--deep-blue);
  color: white;
  text-align: center;
}

.donate-section {
  text-align: center;
}

.impact-counter {
  margin-top: 2.5rem;
  font-size: 4rem;
  font-weight: 700;
  color: var(--primary-gold);
}

/* Footer */
.footer {
  background: #111;
  color: #ccc;
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer a {
  color: var(--primary-gold);
  text-decoration: none;
}

.social-section h3 {
  margin-bottom: 1rem;
}

.social-icons {
  display: flex;
  gap: 1.4rem;
  margin-top: 1.2rem;
  justify-content: center;
}

.social-icons a {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #333;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: all 0.3s ease;
}

.social-icons a:hover {
  transform: translateY(-4px);
  background: var(--primary-gold);
}

.copyright {
  text-align: center;
  border-top: 1px solid #333;
  padding-top: 2rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* Scroll Animations */
.fade-in, .slide-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.9s ease-out;
}

.fade-in.visible, .slide-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Ready Bag Catalogue Section */
.ready-bags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.ready-bag-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.ready-bag-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.ready-bag-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.ready-bag-content {
  padding: 1.5rem;
}

.ready-bag-title {
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
  color: var(--deep-blue);
}

.ready-bag-description {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: #555;
}

.dropdown {
  position: relative;
  margin-bottom: 1rem;
}

.dropdown-toggle {
  width: 100%;
  padding: 0.8rem 1.2rem;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
  color: var(--deep-blue);
}

.dropdown-menu {
  display: none;
  list-style: none;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu li {
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
}

.ready-bag-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-gold);
  margin-bottom: 1.5rem;
}

.ready-bag-buttons {
  display: flex;
  gap: 1rem;
}


/* Mobile Responsiveness */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 1rem;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .hero h2 {
    font-size: 2.8rem;
  }

  .books-grid,
  .ready-bags-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .book-img,
  .ready-bag-img {
    height: 280px; /* slightly smaller on mobile to save space */
  }

  .cart-summary {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    min-width: auto;
  }

  .pagination button {
    padding: 0.7rem 1.2rem;
    min-width: 90px;
  }
}

.center {
  text-align: center;
}

.mt-2 {
  margin-top: 2rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

.book-index {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--primary-gold);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  z-index: 1;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay:not(.hidden) .modal-content {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #888;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

#current-bag-list,
#available-books-list {
  list-style: none;
  padding: 0;
  max-height: 400px;
  overflow-y: auto;
}

#current-bag-list li,
#available-books-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem;
  border-bottom: 1px solid #eee;
}

#current-bag-list button,
#available-books-list button {
  padding: 0.3rem 0.7rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#modal-search {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 1rem;
}

.modal-footer {
  text-align: right;
  margin-top: 2rem;
}

#modal-total {
  font-weight: bold;
}




