/* styles.css - Complete */
:root {
  --primary-gold: #FFD700; /* deep gold */
  --primary-black: #000000;
  --primary-white: #FFFFFF;
  --light-gray: #F5F5F5;
  --dark-text: #222222; /* Darker text for readability */
  --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(--primary-gold);
  color: var(--primary-black);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 2rem; /* Slightly more padding */
  border-radius: 8px; /* Sharper corners */
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent; /* for border transition */
  text-transform: uppercase; /* For a more formal look */
  letter-spacing: 1px;
}

.btn-primary {
  background: var(--primary-gold);
  color: var(--primary-black);
  border-color: var(--primary-gold);
}

.btn-primary:hover {
  background: transparent;
  color: var(--primary-gold);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-gold); /* Use gold for outline */
  color: var(--dark-text);
}

.btn-outline:hover {
  background: var(--primary-gold);
  color: var(--primary-black);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}

.full-width {
  width: 100%;
}

.section {
  padding: 5rem 0;
}

/* Ensure all section headings are centered */
.section h2 {
  text-align: center;
}

.section-title {
  text-align: center;
  font-size: 3rem; /* Slightly smaller for balance */
  margin-bottom: 3rem;
  color: var(--dark-text); /* Use the gold color for emphasis */
  text-transform: uppercase; /* Uppercase for a stronger look */
  letter-spacing: 2px; /* A bit of letter spacing */
  position: relative;
  padding-bottom: 1rem; /* Space for the underline */
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--primary-gold);
  border-radius: 2px;
}

/* ===== PREMIUM HEADER REDESIGN ===== */

.header {
  background: #000000; /* solid black */
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  
}

/* Header – better fit for all nav items */
.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;          /* slightly reduced from 2rem */
  flex-wrap: wrap;      /* allow items to wrap on smaller desktops */
  justify-content: flex-end;
}

/* Adjust for medium screens (1024px – 1200px) */
@media (max-width: 1200px) {
  .nav {
    gap: 1rem;
  }
  .nav .btn-primary,
  .nav .btn-contact,
  .nav .btn-partner {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

/* Optional: ensure the partner button in the header is consistent */
.nav .btn-partner {
  background: transparent;
  border: 1px solid var(--primary-gold);
  color: var(--primary-gold);
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  transition: all 0.3s ease;
}
.nav .btn-partner:hover {
  background: var(--primary-gold);
  color: #000;
  border-color: var(--primary-gold);
}

/* Optional: header shrink on scroll */
.header.scrolled {
  padding: 0.5rem 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 0;
  transition: padding 0.3s ease;
}

/* Logo Area */
.logo-area {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-gold);
  margin: 0;
  line-height: 1;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Add a subtle gold underline under logo */
.logo::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--primary-gold);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.logo:hover::after {
  width: 60px;
}

.tagline {
  font-size: 0.7rem;
  color: #aaa;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0;
  font-weight: 400;
}

/* Desktop Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}



.nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}

/* Animated underline effect */
.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-gold);
  transition: width 0.3s ease;
}

.nav a:hover {
  color: var(--primary-gold);
}

.nav a:hover::after {
  width: 100%;
}

/* Buttons in nav */
.nav .btn-primary {
  background: var(--primary-gold);
  color: #000;
  border: 2px solid var(--primary-gold);
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.nav .btn-primary:hover {
  background: transparent;
  color: var(--primary-gold);
  transform: translateY(-2px);
}

.nav .btn-primary::after {
  display: none; /* remove underline for buttons */
}

.nav .btn-contact {
  background: transparent;
  border: 1px solid #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  transition: all 0.3s ease;
}

.nav .btn-contact:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}


/* Header – full width to accommodate all nav items */
.header .container {
  max-width: none;          /* remove the 1200px constraint */
  width: 100%;
  max-height: none;
  height: 100%;
  padding: 0 2rem;          /* comfortable side margins */
}

/* Keep nav items from shrinking */
.nav a,
.nav .btn {
  flex-shrink: 0;
}

/* Nav spacing – slightly increase gap for better breathing room */
.nav {
  gap: 1.8rem;
}

/* Header compact height on desktop */
.header {
  height: 80px;
  background: #000;
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;      /* vertically center content */
}

.header .container {
  max-width: none;
  width: 100%;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

/* Adjust logo and tagline for compact header */
.logo {
  font-size: 1.6rem;
  line-height: 1;
  margin: 0;
}

.logo::after {
  width: 30px;
  bottom: -2px;
}

.tagline {
  font-size: 0.65rem;
  line-height: 1.2;
}

/* Navigation items */
.nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  height: 100%;
}

.nav a,
.nav .btn {
  flex-shrink: 0;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.nav .btn {
  padding: 0.4rem 1rem;
}

/* Mobile: revert to original behaviour */
@media (max-width: 768px) {
  .header {
    height: auto;
    padding: 0.8rem 0;
  }
  .nav {
    display: none;
  }
  .logo {
    font-size: 1.4rem;
  }
  .tagline {
    font-size: 0.6rem;
  }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .nav {
    gap: 1rem;
  }
  .nav .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

/* Mobile: restore normal container behaviour */
@media (max-width: 768px) {
  .header .container {
    padding: 0 1.5rem;
  }
  .nav {
    display: none;          /* mobile menu takes over */
  }
}


/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.3s;
}

.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile Navigation Panel */
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #000;
  flex-direction: column;
  padding: 1.5rem 2rem;
  gap: 1rem;
  border-top: 1px solid rgba(255, 215, 0, 0.2);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(-10px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  pointer-events: none;
}

.mobile-nav.active {
  display: flex;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 0.3s, padding-left 0.3s;
}

.mobile-nav a:hover {
  color: var(--primary-gold);
  padding-left: 0.5rem;
}

.mobile-nav .btn-primary,
.mobile-nav .btn-contact {
  text-align: center;
  border: 2px solid var(--primary-gold);
  background: transparent;
  color: var(--primary-gold);
  padding: 0.8rem;
  border-radius: 30px;
  margin-top: 0.5rem;
}

.mobile-nav .btn-primary:hover,
.mobile-nav .btn-contact:hover {
  background: var(--primary-gold);
  color: #000;
}

/* Responsive */
@media (max-width: 768px) {
  .nav {
    display: none;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .header-inner {
    padding: 1rem 0;
  }
  .logo {
    font-size: 1.6rem;
  }
  .tagline {
    font-size: 0.6rem;
  }
  .logo::after {
    width: 30px;
  }
}

/* Optional: Add a cart icon (if you decide to include) */
.cart-icon {
  position: relative;
  color: #fff;
  font-size: 1.2rem;
  transition: color 0.3s;
}
.cart-icon:hover {
  color: var(--primary-gold);
}
.cart-count {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--primary-gold);
  color: #000;
  font-size: 0.7rem;
  font-weight: bold;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== HERO SECTION ===== */
/* Hero Enhancements */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: white;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgb(0, 0, 0) 0%, rgba(233, 211, 9, 0.774) 100%),
              url('Books Images/bckg.jpg') center/cover no-repeat;
  transform: scale(1.1);
  animation: kenBurns 20s infinite alternate ease-in-out;
  z-index: -1;
}

@keyframes kenBurns {
  0% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

/* Accent Line */
.hero-accent-line {
  width: 0;
  height: 4px;
  background: var(--primary-gold);
  margin: 0 auto 2rem;
  border-radius: 2px;
  animation: expandLine 1.5s 0.5s forwards ease-out;
}

@keyframes expandLine {
  to { width: 80px; }
}

/* Title Words */
.hero-title {
  font-size: 3.5rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 1rem;
}

.title-word {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUpWord 0.6s forwards;
  animation-delay: calc(0.1s * var(--word-index));
}

@keyframes fadeUpWord {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Set word index via inline style or use JS; simpler: assign classes manually */
/* For simplicity, we can use JS to add data attributes, but for demo we'll set different delays */
.hero-title .title-word:nth-child(1) { --word-index: 1; }
.hero-title .title-word:nth-child(2) { --word-index: 2; }
.hero-title .title-word:nth-child(3) { --word-index: 3; }
/* ... up to 7 words, then use same calc */

/* Subtitle */
.hero-subtitle {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 2rem auto;
  opacity: 0;
  animation: fadeUp 0.8s 0.8s forwards;
}

/* Buttons */
.btn-hero {
  opacity: 0;
  animation: fadeUp 0.8s 1.1s forwards;
  margin: 0.5rem;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  color: white;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-subtitle {
    font-size: 1rem;
    margin: 1.5rem auto;
  }
  .btn-hero {
    display: block;
    width: 100%;
    margin: 0.75rem 0;
  }
  .scroll-indicator {
    display: none; /* hide if space is tight */
  }
}

/* Offer Section */
.offer-section {
  background: white;
  padding: 6rem 0;
}

/* Section Title (unchanged, gold underline) */
.offer-section .section-title {
  margin-bottom: 4rem;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.offer-section .section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--primary-gold);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.offer-section .section-title:hover::after {
  width: 100px;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* Card Base */
.offer-card {
  background: #000000; /* solid black background */
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s;
  position: relative;
  overflow: hidden;
  border: 1px solid #333; /* subtle border */
}

.offer-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: var(--primary-gold);
}

/* Background image that will show through text – applied to a pseudo‑element */
.offer-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('https://i0.wp.com/thebftonline.com/wp-content/uploads/2020/12/books.jpeg?fit=1024%2C640&ssl=1'); /* book pages texture – replace with your own */
  background-size: cover;
  background-position: center;
  opacity: 0.15; /* subtle so text stands out but still visible */
  z-index: 0;
  transition: opacity 0.3s, transform 0.5s;
}

.offer-card:hover::before {
  opacity: 0.25;
  transform: scale(1.05); /* gentle zoom on hover */
}

/* All text and icon elements sit above the pseudo‑element */
.card-icon,
.card-title,
.card-subtitle,
.card-description,
.btn-card {
  position: relative;
  z-index: 2;
}

/* Transparent text with background clip */
.card-title,
.card-subtitle,
.card-description {
  color: white;
  background-image: inherit; /* will inherit from parent? No – we set explicitly */
  background-image: url('https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1350&q=80'); /* same as card background */
  background-size: cover;
  background-position: center;
  -webkit-background-clip: text;
  background-clip: text;
  font-weight: 700; /* keep bold */
}

/* Card Icon (Font Awesome) – same treatment */
.card-icon i {
  font-size: 3rem;
  color: goldenrod;
  background-image: url('https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1350&q=80');
  background-size: cover;
  background-position: center;
  -webkit-background-clip: text;
  background-clip: text;
  transition: transform 0.3s;
}

.offer-card:hover .card-icon i {
  transform: scale(1.1);
}

/* Individual text styles */
.card-title {
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.card-subtitle {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.card-description {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  font-weight: 400;
}

/* Button – solid, not transparent, to provide contrast */
.btn-card {
  background: transparent;
  border: 2px solid var(--primary-gold);
  color: #ffffff; /* white text on black card */
  padding: 0.6rem 1.8rem;
  border-radius: 40px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 2;
  position: relative;
}

.btn-card:hover {
  background: var(--primary-gold);
  color: #000000;
  border-color: var(--primary-gold);
  transform: translateX(5px);
}

.btn-card i {
  transition: transform 0.3s;
}

.btn-card:hover i {
  transform: translateX(3px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .offer-card {
    padding: 1.5rem 1.2rem;
  }

  .card-title {
    font-size: 1.4rem;
  }

  .card-icon i {
    font-size: 2.5rem;
  }

  .card-subtitle {
    font-size: 0.9rem;
  }

  .card-description {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  .btn-card {
    width: 100%;
    justify-content: center;
  }
}

/* Very small devices */
@media (max-width: 480px) {
  .offer-card {
    padding: 1.2rem 1rem;
  }
  .card-title {
    font-size: 1.2rem;
  }
  .card-icon i {
    font-size: 2rem;
  }
}


/* 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(--primary-black);
  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(--primary-black);
  background-color: var(--primary-white);
  border: 1px solid var(--primary-black);
  transition: all 0.3s ease;
}

.category-link:hover {
  background-color: var(--primary-gold);
  color: var(--primary-black);
}

.category-link.active {
  background-color: var(--primary-gold);
  color: var(--primary-black);
  font-weight: 600;
}

/* Mobile category select (hidden on desktop) */
#mobileCategorySelect {
  display: none;
}

.search-bar {
  padding: 1rem 1.6rem;
  font-size: 1.1rem;
  border: 2px solid var(--primary-black);
  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;
  background-color: var(--primary-white);
  color: var(--dark-text);
}

.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 */
:focus-visible {
  outline: 2px solid var(--primary-gold);
  outline-offset: 2px;
}

.shop-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

.books-main {
  min-height: 600px;
}

.cart-sidebar {
  position: sticky;
  top: 2rem;
}

.cart-sidebar .cart-summary {
  position: static;
  margin: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}



/* ===== SINGLE BOOKS COLLECTIONS SECTION ===== */
.shop-section {
  background: var(--primary-gold);
  padding: 6rem 0;
}

.shop-section .section-title {
  color: #000;
}

.shop-section .section-title::after {
  background: var(--primary-gold);
}

.shop-section .centered-title {
font-size: 40px;
}

/* Search Bar */
.search-bar {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 60px;
  padding: 1rem 1.6rem 1rem 3rem; /* extra left padding for icon */
  font-size: 1rem;
  width: 100%;
  max-width: 580px;
  margin: 0 auto 2.5rem;
  display: block;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  transition: all 0.3s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1.2rem center;
  background-size: 1.2rem;
}

.search-bar:focus {
  border-color: var(--primary-gold);
  outline: none;
  box-shadow: 0 8px 25px rgba(255,215,0,0.15);
}

/* Category Filter */
.category-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.category-title {
  font-weight: 600;
  color: #000;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#categoryLinks {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.category-link {
  display: block;
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  color: #333;
  background: white;
  border: 2px solid #e0e0e0;
  transition: all 0.3s ease;
}

.category-link:hover {
  border-color: var(--primary-gold);
  color: #000;
}

.category-link.active {
  background: var(--primary-gold);
  border-color: var(--primary-gold);
  color: #000;
  font-weight: 600;
}

/* Hide mobile select on desktop */
#mobileCategorySelect {
  display: none;
}

/* Book Grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Book Card */
.book-card {
  background: rgb(0, 0, 0);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.05);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid #eee;
  color: white;
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border-color: var(--primary-gold);
}

.book-index {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,0.6);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 2;
  backdrop-filter: blur(2px);
}

.book-img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.book-card:hover .book-img {
  transform: scale(1.05);
}

.book-content {
  padding: 1.5rem 1.2rem 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: #000000;
  line-height: 1.4;
}

.book-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-gold);
  margin-bottom: 1rem;
}

/* Select Button */
.select-btn {
  padding: 0.8rem 1rem;
  border-radius: 50px;
  border: 2px solid var(--primary-gold);
  background: transparent;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: auto;
}

.select-btn i {
  font-size: 1rem;
}

.select-btn.select:hover {
  background: var(--primary-gold);
  color: #000;
}

.select-btn.selected {
  background: #2e7d32;
  border-color: #2e7d32;
  color: white;
}

.select-btn.selected i {
  color: white;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.pagination button {
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  border: 2px solid #e0e0e0;
  background: white;
  color: #333;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination button:not(:disabled):hover {
  border-color: var(--primary-gold);
  background: var(--primary-gold);
  color: #000;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#pageNumbers {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.page-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #e0e0e0;
  background: white;
  color: #333;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.page-number:hover {
  border-color: var(--primary-gold);
}

.page-number.active {
  background: var(--primary-gold);
  border-color: var(--primary-gold);
  color: #000;
  font-weight: 600;
}

/* Desktop Cart Sidebar (already styled, but ensure consistency) */
.cart-sidebar {
  position: sticky;
  top: 100px; /* adjust based on header height */
}

.cart-summary {
  background: white;
  border-radius: 20px;
  padding: 1.8rem;
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
  border: 1px solid #eee;
}

.cart-summary h3 {
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
  color: #000;
}

#cart-items {
  list-style: none;
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

#cart-items li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
  color: #333;
}

.total {
  font-size: 1.2rem;
  margin: 1rem 0;
  text-align: right;
  color: #000;
}

#cart-total {
  color: var(--primary-gold);
  font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .shop-section {
    padding: 4rem 0;
  }

  /* Show mobile category dropdown, hide desktop links */
  #categoryLinks {
    display: none;
  }

  #mobileCategorySelect {
    display: block;
    width: 100%;
    max-width: 300px;
    padding: 0.8rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    background: white;
    font-size: 1rem;
    color: #333;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
  }

  .category-filter {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .category-title {
    text-align: center;
  }

  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .book-content {
    padding: 1rem 0.8rem 0.8rem;
  }

  .book-title {
    font-size: 0.95rem;
  }

  .book-price {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
  }

  .select-btn {
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
  }

  .pagination {
    gap: 0.5rem;
  }

  .pagination button {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .page-number {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }

  /* Cart sidebar becomes bottom drawer */
  .cart-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    z-index: 999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .cart-sidebar.active {
    transform: translateY(0);
  }

  .cart-summary {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
  }

  /* Adjust mobile banner spacing */
  .mobile-cart-banner:not(.hidden) + .shop-section .cart-sidebar {
    bottom: 70px; /* if banner is visible, shift up */
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: 1fr; /* single column on very small phones */
  }
}


/* ===== OUR SCHOOLS SECTION – BLACK & GOLD ===== */
.schools-section {
  background: #000000; /* pure black */
  padding: 6rem 0;
}

.schools-section .section-title {
  color: #ffffff; /* white title on black */
}

.schools-section .section-title::after {
  background: var(--primary-gold);
}

/* Schools Grid */
.schools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin: 3rem 0 4rem; /* extra bottom margin for button */
}

/* School Card – Gold background */
.school-card {
  background: var(--primary-gold); /* #FFD700 */
  border-radius: 20px;
  padding: 2.5rem 1.8rem;
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2); /* gold tint shadow */
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2); /* subtle white border */
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
  animation: schoolCardFadeUp 0.8s forwards;
}

.school-card:nth-child(1) { animation-delay: 0.1s; }
.school-card:nth-child(2) { animation-delay: 0.2s; }
.school-card:nth-child(3) { animation-delay: 0.3s; }
.school-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes schoolCardFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.school-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(255, 215, 0, 0.4);
  border-color: #ffffff;
}

/* Card Icon – Black on gold */
.school-card .card-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: #000000;
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.school-card:hover .card-icon {
  color: #ffffff; /* white on hover for contrast */
  transform: scale(1.1);
}

/* Card Text – Black on gold */
.school-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #000000;
  line-height: 1.3;
}

.school-card p {
  font-size: 1rem;
  color: #333333; /* dark gray for readability, but still dark */
  line-height: 1.6;
  margin-bottom: 0;
}

/* Partner Button Wrapper */
.partner-wrapper {
  text-align: center;
  margin-top: 2rem;
}

.btn-partner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  background: var(--primary-gold);
  color: #000000;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 1.2rem 3rem;
  border-radius: 60px;
  text-decoration: none;
  border: 2px solid var(--primary-gold);
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.btn-partner i {
  font-size: 1.3rem;
  transition: transform 0.3s;
}

.btn-partner:hover {
  background: transparent;
  color: var(--primary-gold);
  border-color: var(--primary-gold);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(255, 215, 0, 0.4);
}

.btn-partner:hover i {
  transform: rotate(10deg);
}

/* Mobile Responsive */
@media (max-width: 992px) {
  .schools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .schools-section {
    padding: 4rem 0;
  }

  .school-card {
    padding: 2rem 1.5rem;
  }

  .school-card h3 {
    font-size: 1.2rem;
  }

  .school-card p {
    font-size: 0.95rem;
  }

  .school-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }

  .btn-partner {
    font-size: 1rem;
    padding: 1rem 2rem;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .schools-grid {
    grid-template-columns: 1fr;
  }

  .school-card {
    padding: 1.8rem 1.2rem;
  }

  .btn-partner {
    font-size: 0.95rem;
    padding: 0.9rem 1.5rem;
  }
}


/* Impact Block */
.impact-block {
  text-align: center;
  margin: 4rem 0 3rem;
  padding: 3rem 2rem;
  background: rgba(255, 215, 0, 0.05); /* very subtle gold tint */
  border-radius: 40px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  backdrop-filter: blur(5px);
}

.impact-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary-gold);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.impact-text {
  font-size: 1.2rem;
  color: #ffffff;
  max-width: 800px;
  margin: 0 auto 2rem;
  line-height: 1.6;
  opacity: 0.9;
}

.impact-counter {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.counter-number {
  font-size: 4rem;
  font-weight: 800;
  color: var(--primary-gold);
  line-height: 1;
}

.counter-label {
  font-size: 1.3rem;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.8;
}

/* Partner Button (already exists, but ensure it's styled for dark background) */
.partner-wrapper {
  text-align: center;
  margin-top: 2rem;
}

.btn-partner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  background: var(--primary-gold);
  color: #000000;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 1.2rem 3rem;
  border-radius: 60px;
  text-decoration: none;
  border: 2px solid var(--primary-gold);
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.btn-partner i {
  font-size: 1.3rem;
  transition: transform 0.3s;
}

.btn-partner:hover {
  background: transparent;
  color: var(--primary-gold);
  border-color: var(--primary-gold);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(255, 215, 0, 0.4);
}

.btn-partner:hover i {
  transform: rotate(10deg);
}

/* Mobile Responsive for Impact Block */
@media (max-width: 768px) {
  .impact-block {
    padding: 2rem 1.5rem;
    margin: 3rem 0 2rem;
  }

  .impact-title {
    font-size: 1.8rem;
  }

  .impact-text {
    font-size: 1rem;
  }

  .counter-number {
    font-size: 3rem;
  }

  .counter-label {
    font-size: 1rem;
  }

  .btn-partner {
    font-size: 1rem;
    padding: 1rem 2rem;
    width: 100%;
    max-width: 400px;
  }
}

@media (max-width: 480px) {
  .impact-title {
    font-size: 1.5rem;
  }

  .counter-number {
    font-size: 2.5rem;
  }
}


/* Footer */
.footer {
  background: var(--primary-black);
  color: var(--primary-white);
  padding: 4rem 0 2rem;
  background-color: var(--primary-black);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer a {
  color: var(--primary-white);
  text-decoration: none;
}

.social-section h3 {
  margin-bottom: 1rem;
  color: var(--primary-white);
}

.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: var(--primary-white);
  color: var(--primary-black);
  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);
  color: var(--primary-black);
}

.copyright {
  text-align: center;
  border-top: 1px solid var(--primary-white);
  padding-top: 2rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--primary-white);
}

/* 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);
}

/* ===== PRELOVED BOOKS SECTION ===== */
.ready-bags-section {
  background: #0a0a0a; /* deep black */
  color: white;
  padding: 6rem 0;
}

.ready-bags-section .section-title {
  color: white;
}

.ready-bags-section .section-title::after {
  background: var(--primary-gold);
}

/* Cards Grid */
.ready-bags-grid {
  display: grid;
  grid-template-columns: minmax(300px, 800px); /* single centered card, but can hold multiple later */
  justify-content: center;
  gap: 2rem;
}

/* Ready Bag Card */
.ready-bag-card {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  background: #111;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.ready-bag-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px -12px rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.4);
}

/* Bag Image */
.bag-image {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 320px;
}

.bag-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.ready-bag-card:hover .bag-image img {
  transform: scale(1.05);
}

.bag-badge {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: var(--primary-gold);
  color: black;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-radius: 30px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Bag Details */
.bag-details {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.bag-title {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin: 0;
  line-height: 1.2;
}

.bag-description {
  font-size: 1rem;
  color: #aaa;
  line-height: 1.6;
  margin: 0;
}

.bag-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.5rem 0;
}

.bag-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-gold);
}

.bag-count {
  font-size: 1rem;
  color: #ccc;
  background: rgba(255,215,0,0.1);
  padding: 0.4rem 1rem;
  border-radius: 40px;
  border: 1px solid rgba(255,215,0,0.3);
}

/* Actions */
.bag-actions {
  display: flex;
  gap: 1rem;
  margin: 0.5rem 0;
}

.bag-actions .btn {
  flex: 1;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
}

.bag-actions .btn-primary {
  background: var(--primary-gold);
  color: black;
  border: 2px solid var(--primary-gold);
}

.bag-actions .btn-primary:hover {
  background: transparent;
  color: var(--primary-gold);
}

.bag-actions .btn-outline {
  background: transparent;
  border: 2px solid var(--primary-gold);
  color: white;
}

.bag-actions .btn-outline:hover {
  background: var(--primary-gold);
  color: black;
}

/* Selection Preview */
.bag-selection-preview {
  margin-top: 1rem;
  border-top: 1px solid rgba(255,215,0,0.2);
  padding-top: 1rem;
}

.preview-toggle {
  background: none;
  border: none;
  color: var(--primary-gold);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  width: 100%;
  text-align: left;
  transition: color 0.3s;
}

.preview-toggle:hover {
  color: white;
}

.preview-toggle i {
  transition: transform 0.3s;
}

.preview-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.preview-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.preview-toggle[aria-expanded="true"] + .preview-list {
  max-height: 300px; /* enough for many items */
  overflow-y: auto;
}

.preview-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,215,0,0.15);
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-size: 0.85rem;
  color: #ddd;
}

.preview-empty {
  font-style: italic;
  color: #666;
  padding: 0.5rem 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .ready-bag-card {
    grid-template-columns: 1fr;
    border-radius: 24px;
  }

  .bag-image {
    min-height: 220px;
  }

  .bag-details {
    padding: 1.8rem 1.5rem;
  }

  .bag-title {
    font-size: 1.6rem;
  }

  .bag-price {
    font-size: 1.8rem;
  }

  .bag-count {
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
  }

  .bag-actions {
    flex-direction: column;
    gap: 0.8rem;
  }

  .bag-actions .btn {
    width: 100%;
  }
}

/* Very small phones */
@media (max-width: 480px) {
  .bag-details {
    padding: 1.5rem 1.2rem;
  }
  .bag-title {
    font-size: 1.4rem;
  }
  .bag-price {
    font-size: 1.6rem;
  }
}

.select-bag-btn.selected {
  background: #2e7d32; /* same green as book select */
  color: white;
  border-color: #2e7d32;
}
.select-bag-btn.selected i {
  color: white;
}



/* 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 {
  color: var(--dark-text);
  padding: 0; /* Removing default padding to allow header full width */
  border-radius: 16px;
  width: 90%;
  max-width: 900px; /* Wider for premium look */
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.modal-overlay:not(.hidden) .modal-content {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: rgba(0,0,0,0.05);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--primary-black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close-btn:hover {
  background: var(--primary-black);
  color: var(--primary-gold);
  transform: rotate(90deg);
}

.modal-body {
  padding: 0 2.5rem 2rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 0;
  flex: 1;
}

/* Custom Header for the Modal */
.modal-content #modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  padding: 2rem 1.5rem 1rem;
  margin: 0;
  text-align: center;
  color: white;
  border-bottom: none;
  position: relative;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Search Bar Container */
.modal-search-container {
  padding: 0 2.5rem 1.5rem;
  position: sticky;
  top: 0;
  background: white;
  z-index: 5;
}

#current-bag-list,
#available-books-list {
  list-style: none;
  padding: 1rem;
  max-height: 400px;
  min-height: 300px;
  overflow-y: auto;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #eee;
  position: relative;
}

/* Column Headers via CSS */
#current-bag-list::before {
  content: "Your Bag Collection";
  display: block;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-gold);
  color: var(--primary-black);
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 2;
}

#available-books-list::before {
  content: "Browse Library";
  display: block;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #ddd;
  color: #666;
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 2;
}

/* Scrollbar styling for lists */
#current-bag-list::-webkit-scrollbar,
#available-books-list::-webkit-scrollbar {
  width: 6px;
}
#current-bag-list::-webkit-scrollbar-thumb,
#available-books-list::-webkit-scrollbar-thumb {
  background-color: #e7d800;
  border-radius: 10px;
}

/* ===== IMPROVED MODAL BOOK ITEMS ===== */

.modal-book-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s;
  border: 1px solid #f0f0f0;
}

.modal-book-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  border-color: rgba(255,215,0,0.3);
}

/* Larger image */
.modal-book-img {
  width: 70px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f5f5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

/* Book details container */
.modal-book-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-book-title {
  font-weight: 600;
  font-size: 1rem;
  color: #1e1e1e;
  line-height: 1.4;
}

.modal-book-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-black);
  background: rgba(156, 153, 131, 0.1);
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  align-self: flex-start;
}

/* Buttons */
.modal-book-item button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.modal-book-item button:hover {
  transform: scale(1.05);
}

/* Remove button */
.modal-book-item button.remove-from-bag-btn {
  background: #fee;
  color: #e53935;
}

.modal-book-item button.remove-from-bag-btn:hover {
  background: #e53935;
  color: white;
}

/* Add button */
.modal-book-item button.add-to-bag-btn {
  background: var(--primary-black);
  color: var(--primary-gold);
}

.modal-book-item button.add-to-bag-btn:hover {
  background: var(--primary-gold);
  color: var(--primary-black);
}

/* ===== PREMIUM MOBILE MODAL LAYOUT ===== */

@media (max-width: 768px) {
  /* Make the modal body scrollable and remove grid stacking */
  .modal-body {
    display: block;
    padding: 0 1rem 1rem 1rem;
  }

  /* Current bag section – horizontal scroll */
  .current-bag {
    margin-bottom: 2rem;
  }

  #current-bag-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 1rem;
    padding: 0.5rem 0.25rem 1rem 0.25rem;
    margin: 0;
    background: transparent;
    border: none;
    max-height: none;
    scrollbar-width: thin;
  }

  #current-bag-list::before {
    content: "Your Bag (swipe to see all)";
    position: sticky;
    left: 0;
    top: 0;
    background: white;
    padding: 0 0 0.5rem 0;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    border-bottom: none;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .modal-book-item {
    flex-direction: column;
    min-width: 120px;
    width: 120px;
    background: #fff;
    border-radius: 16px;
    padding: 0.8rem;
    margin: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    text-align: center;
  }

  .modal-book-img {
    width: 100%;
    height: 160px;  /* increased height for bigger images */
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 0.8rem;
  }

  .modal-book-details {
    align-items: center;
    gap: 0.4rem;
  }

  .modal-book-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    white-space: normal;
    word-break: break-word;
  }

  .modal-book-price {
    font-size: 0.8rem;
    align-self: center;
  }

  .modal-book-item button {
    width: 36px;
    height: 36px;
    margin-top: 0.4rem;
    background: #f0f0f0;
  }

  .modal-book-item button.remove-from-bag-btn {
    background: #fee;
    color: #e53935;
  }

  /* Available books section – 2‑column grid */
  .available-books {
    margin-top: 1rem;
  }

  #available-books-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0.5rem 0;
    background: transparent;
    border: none;
    max-height: 450px;
    overflow-y: auto;
  }

  #available-books-list::before {
    content: "Add More Books";
    display: block;
    grid-column: 1 / -1;
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: none;
    background: transparent;
    padding: 0 0 0.5rem 0;
    margin-bottom: 0.5rem;
    text-align: left;
  }

  #available-books-list .modal-book-item {
    flex-direction: column;
    padding: 0.8rem;
    margin: 0;
    width: 100%;
    min-width: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
  }

  #available-books-list .modal-book-item:hover {
    transform: translateY(-2px);
  }

  #available-books-list .modal-book-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 0.8rem;
  }

  #available-books-list .modal-book-details {
    align-items: center;
    text-align: center;
    width: 100%;
  }

  #available-books-list .modal-book-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    white-space: normal;
  }

  #available-books-list .modal-book-price {
    font-size: 0.8rem;
    margin: 0.2rem 0;
  }

  #available-books-list button.add-to-bag-btn {
    width: 40px;
    height: 40px;
    background: var(--primary-black);
    color: var(--primary-gold);
    margin-top: 0.5rem;
    border-radius: 30px;
    font-size: 1rem;
  }

  /* Progress bar styling for mobile */
  .progress-bar-container {
    margin: 0.5rem 0;
  }

  .progress-bar-text {
    font-size: 0.75rem;
  }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem 1.5rem;
  }

  #update-bag-btn {
    width: 100%;
    padding: 0.9rem;
  }

  /* Modal search input */
  #modal-search {
    margin-bottom: 0.75rem;
  }
}

/* Even smaller screens (≤ 480px) */
@media (max-width: 480px) {
  #available-books-list {
    gap: 0.75rem;
  }

  .modal-book-img,
  #available-books-list .modal-book-img {
    height: 140px;
  }

  .modal-book-title {
    font-size: 0.8rem;
  }
}

/* Custom scrollbar for current bag list */
#current-bag-list::-webkit-scrollbar {
  height: 4px;
}

#current-bag-list::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

#current-bag-list::-webkit-scrollbar-thumb {
  background: var(--primary-gold);
  border-radius: 4px;
}

/* Modal search container – wraps the input */
.modal-search-container {
  margin-bottom: 1.5rem;
  position: relative;
}

/* Enhanced search input */
#modal-search {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;       /* extra left padding for icon */
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  border: 5px solid #e0e0e0;
  border-radius: 60px;
  background-color: gold;
  /*background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");*/
  background-repeat: no-repeat; 
  background-position: left 1rem center;
  background-size: 1.2rem; 
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

#modal-search:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 4px 12px rgba(255,215,0,0.2);
  background-color: #fefef7;
}

/* Optional: style the clear button that browsers add */
#modal-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
  cursor: pointer;
}

/* Optional: add a subtle label (or use placeholder) */
#modal-search::placeholder {
  color: #000000;
  font-weight: 400;
  font-size: 0.95rem;
  opacity: 0.8;
}
.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2.5rem;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  border-radius: 0 0 16px 16px;
}

.modal-total-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.modal-total-label {
  font-size: 0.85rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#modal-total {
  font-weight: bold;
  font-size: 1.5rem;
  color: var(--primary-black);
}

@media (max-width: 400px) {
  /* ... existing mobile rules ... */

  /* Force thumbnail size for modal images */
  .modal-book-item .modal-book-img {
    width: 40px !important;
    height: 60px !important;
    object-fit: cover;
    max-width: none; /* override any max-width:100% */
  }

  /* Ensure button column has a fixed width */
  .modal-book-item {
    grid-template-columns: 40px 1fr 32px !important;
    gap: 0.5rem;
  }

  /* Make sure the button itself is visible and properly sized */
  .modal-book-item button {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
  }
}
.progress-bar-container {
  flex-grow: 1;
  margin: 0 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
}

.progress-bar-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  text-align: center;
  transition: color 0.3s ease;
}

.progress-bar-text.complete {
    color: var(--primary-black);
}

.progress-bar {
  width: 100%;
  height: 10px;
  background-color: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background-color: #adb5bd;
  border-radius: 10px;
  transition: width 0.4s ease, background-color 0.4s ease;
}

.progress-bar-fill.complete {
  background-color: var(--primary-gold);
}

#update-bag-btn {
  background: var(--primary-black);
  color: var(--primary-gold);
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#update-bag-btn:hover {
  background: var(--primary-gold);
  color: var(--primary-black);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

/* ===== PREMIUM ORDER MODAL ===== */
#order-modal .modal-content {
  background: #0a0a0a; /* dark background for modal container */
  border: 1px solid var(--primary-gold);
  max-width: 1000px;
  width: 95%;
  border-radius: 24px;
  overflow: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

#order-modal .modal-close-btn {
  animation: modalScaleIn 0.3s ease;
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.premium-modal {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  min-height: 500px;
  max-height: 80vh;
  overflow: hidden;
}

/* Make modal scrollable on desktop */
@media (min-width: 769px) {
  #order-modal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
  }
}




/* Left Column – Order Summary (light background for contrast) */
.premium-summary {
  background: #ffffff;
  padding: 2rem 1.8rem;
  display: flex;
  flex-direction: column;
  border-right: 2px solid var(--primary-gold);
}

.premium-summary,
.premium-form {
  overflow-y: auto;
  max-height: 80vh; /* or a specific height */
}

/* Make order modal scrollable on desktop */
@media (min-width: 769px) {
  #order-modal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
  }
}
.premium-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary-gold);
}

.premium-summary-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: #000;
  margin: 0;
}

.premium-badge {
  background: var(--primary-gold);
  color: #000;
  padding: 0.3rem 1rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
}

.premium-items {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-bottom: 1.5rem;
}

.order-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.order-item:last-child {
  border-bottom: none;
}

.order-item-img {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.order-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.order-item-title {
  font-weight: 700;
  color: #000;
  margin-bottom: 0.2rem;
}

.order-item-sub {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.order-item-price {
  font-weight: 600;
  color: var(--primary-gold);
  background: rgba(255,215,0,0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  display: inline-block;
  align-self: flex-start;
  font-size: 0.9rem;
}

.premium-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 2px dashed var(--primary-gold);
  font-weight: 700;
  font-size: 1.2rem;
  color: #000;
}

.premium-total-amount {
  color: #000;
  font-size: 1.4rem;
}

/* Right Column – Checkout Form (dark background) */
.premium-form {
  padding: 2rem 2rem;
  background: #0a0a0a;
  color: white;
  overflow-y: auto;
}

.premium-form-header {
  margin-bottom: 2rem;
}

.premium-form-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--primary-gold);
  margin: 0 0 0.25rem 0;
}

.premium-form-header p {
  color: #aaa;
  font-size: 0.95rem;
  margin: 0;
}

.premium-form-fields {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #ddd;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper i {
  position: absolute;
  left: 14px;
  color: var(--primary-gold);
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}

.input-wrapper input,
.input-wrapper textarea,
.input-wrapper select {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.8rem;
  border: 1px solid #333;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: #1a1a1a;
  color: rgb(10, 0, 0);
}

.input-wrapper textarea {
  resize: vertical;
  min-height: 80px;
}

.input-wrapper input:focus,
.input-wrapper textarea:focus,
.input-wrapper select:focus {
  outline: none;
  border-color: var(--primary-gold);
  background: #222;
  box-shadow: 0 0 0 3px rgba(255,215,0,0.2);
}


.input-wrapper select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23FFD700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2rem;
}


.premium-notice {
  background: #1a1a1a;
  border-left: 4px solid var(--primary-gold);
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: #ffd700;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #333;
}


.premium-radio-group {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  background: #f9f9f9;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
}

.premium-radio-group > label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: #1e1e1e;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.radio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-gold);
  margin: 0;
}

.radio-option label {
  font-weight: normal;
  margin: 0;
  color: #333;
}

.btn-cancel {
  padding: 0.8rem 2rem;
  background: transparent;
  border: 2px solid #666;
  border-radius: 50px;
  font-weight: 600;
  color: #ccc;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-cancel:hover {
  background: #333;
  border-color: #888;
  color: white;
}

.btn-submit {
  padding: 0.8rem 2.5rem;
  background: var(--primary-gold);
  color: #000;
  border: 2px solid var(--primary-gold);
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 8px 20px rgba(255,215,0,0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-submit:hover {
  background: transparent;
  color: var(--primary-gold);
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(255,215,0,0.4);
}

@media (max-width: 768px) {
  /* Modal Overlay – allow full page scroll if needed */
  .modal-overlay {
    align-items: flex-start; /* align to top so modal starts near top */
    padding: 0; /* remove padding to use full width */
    overflow-y: auto;
  }

  /* Modal Content – take full width, auto height */
  .modal-content {
    width: 100%;
    max-width: none;
    max-height: none; /* remove max-height restriction */
    height: auto;
    border-radius: 0; /* optional: full screen feel */
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  /* Premium modal stacked layout */
  .premium-modal {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
  }

  /* Left and right columns – no height limits */
  .premium-summary,
  .premium-form {
    max-height: none;
    overflow-y: visible;
    padding: 1.5rem;
  }

  /* Order summary – limit height but make scrollable if many items */
  .premium-summary {
    max-height: 35vh; /* give some space but allow scroll */
    overflow-y: auto;
    border-bottom: 1px solid rgba(255,215,0,0.2);
  }

  /* Form section – ensure it takes remaining space */
  .premium-form {
    flex: 1;
    padding-bottom: 2rem;
  }

  /* Form actions – stick to bottom on very long forms */
  .form-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 1rem 0;
    margin-top: 1.5rem;
    border-top: 1px solid #eee;
    z-index: 10;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.8rem;
  }

  /* Buttons full width */
  .form-actions .btn-cancel,
  .form-actions .btn-submit {
    width: 100%;
    margin: 0;
  }

  /* Adjust close button for mobile */
  .modal-close-btn {
    top: 0.8rem;
    right: 0.8rem;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.5);
    color: white;
    z-index: 20;
  }

  /* Ensure input fields are touch-friendly */
  .input-wrapper input,
  .input-wrapper textarea,
  .input-wrapper select {
    padding: 1rem 1rem 1rem 3rem; /* more touch space */
    font-size: 16px; /* prevent zoom on iOS */
  }

  /* Increase icon size slightly */
  .input-wrapper i {
    font-size: 1.2rem;
    left: 14px;
  }

  /* Order item adjustments */
  .order-item {
    gap: 0.8rem;
  }

  .order-item-img {
    width: 50px;
    height: 70px;
  }
}

@media (max-width: 480px) {
  .premium-summary {
    max-height: 30vh;
    padding: 1rem;
  }

  .premium-form {
    padding: 1rem;
  }

  .order-item-title {
    font-size: 0.9rem;
  }

  .order-item-price {
    font-size: 0.85rem;
  }
}
/* ... (Buttons and Mobile Styles follow) ... */


/* Mobile Sticky Cart Banner */
.mobile-cart-banner {
  display: none;
  position: sticky;
  top: 88px; /* Height of header */
  z-index: 998;
  background: var(--primary-black);
  color: var(--primary-white);
  border-top: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.mobile-cart-banner.hidden {
  display: none;
}

.banner-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
}

.banner-summary {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.banner-total-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.banner-label {
  font-size: 0.85rem;
  color: #aaa;
}

.banner-amount {
  font-weight: 700;
  color: var(--primary-gold);
  font-size: 1.1rem;
}

.banner-toggle {
  background: none;
  border: none;
  color: var(--primary-white);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.banner-details {
  max-height: 0;
  overflow: hidden;
  background: #111;
  transition: max-height 0.3s ease-out;
  border-bottom: 2px solid var(--primary-gold);
}

.banner-details.open {
  max-height: 250px;
  overflow-y: auto;
}

#mobile-cart-list {
  list-style: none;
  padding: 1rem 1.5rem;
}

#mobile-cart-list li {
  font-size: 0.9rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #222;
  color: #ddd;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header-inner {
      padding: 1.2rem 1.2rem; /* Increased horizontal padding to prevent edge touching */
    }

    .mobile-cart-banner:not(.hidden) {
      display: block;
      margin: 15px 15px 10px 15px; /* Increased top margin and side margins for card look */
      border-radius: 12px; /* Smoother, more beautiful corners */
      border: 1px solid rgba(255, 215, 0, 0.4);
      top: 95px; /* Adjusted to account for the new margin below header */
    }

    #categoryLinks {
      display: none; /* Hide horizontal list on mobile */
    }

    #mobileCategorySelect {
      display: block; /* Show dropdown on mobile */
      width: 100%;
      padding: 0.8rem 1.2rem;
      border: 2px solid var(--primary-black);
      border-radius: 50px;
      background-color: var(--primary-white);
      color: var(--primary-black);
      font-size: 1rem;
      font-weight: 600;
      appearance: none;
      background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
      background-repeat: no-repeat;
      background-position: right 1.2rem center;
      background-size: 1em;
      cursor: pointer;
    }

    .category-filter {
      width: 100%;
      flex-direction: column;
      align-items: center;
      gap: 0.8rem;
    }

    #mobile-banner-checkout {
      padding: 0.5rem 1rem; /* Reduced width/padding */
      font-size: 0.85rem;
      width: auto;
      min-width: 100px;
    }

    .mobile-cart-btn {
      display: none !important; /* Replaced by banner */
    }

    .mobile-cart-btn.visible {
      opacity: 1;
      pointer-events: auto;
    }

    #mobile-cart-count {
      position: absolute;
      top: -5px;
      right: -5px;
      background: #e74c3c;
      color: white;
      font-size: 0.8rem;
      padding: 2px 6px;
      border-radius: 10px;
      font-weight: bold;
      border: 2px solid white;
    }
}


/* --- PREMIUM PAYMENT MODAL (full design) --- */

.payment-modal {
  background: linear-gradient(145deg, #ffffff 0%, #fafafa 100%);
  border-radius: 32px;
  padding: 2.5rem;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 215, 0, 0.2);
  position: relative;
  overflow: hidden;
}

/* Subtle gold accent line at top */
.payment-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-gold), #fff8e0, var(--primary-gold));
  border-radius: 32px 32px 0 0;
}

.payment-header {
  text-align: center;
  margin-bottom: 2rem;
}

.payment-header .icon-wrapper {
  width: 80px;
  height: 80px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  border: 2px dashed var(--primary-gold);
}

.payment-header .icon-wrapper i {
  font-size: 2.5rem;
  color: var(--primary-black);
  background: var(--primary-gold);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.payment-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #1e1e1e;
  margin-bottom: 0.25rem;
}

.payment-header p {
  color: #666;
  font-size: 1rem;
}

/* Bank details card */
.bank-details-card {
  background: #f4f4f4;
  border-radius: 24px;
  padding: 1.8rem 2rem;
  margin-bottom: 2rem;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.02), 0 8px 18px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.05);
}

.bank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.bank-row:last-of-type {
  border-bottom: none;
}

.bank-label {
  font-weight: 600;
  color: #555;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.bank-value {
  font-weight: 700;
  color: #1e1e1e;
  font-size: 1.1rem;
  background: white;
  padding: 0.2rem 1rem;
  border-radius: 40px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.total-row {
  background: #1e1e1e;
  margin: 1.5rem -2rem -1.8rem -2rem;
  padding: 1.2rem 2rem;
  border-radius: 0 0 24px 24px;
}

.total-row .bank-label {
  color: #aaa;
}

.total-row .bank-value {
  background: var(--primary-gold);
  color: #1e1e1e;
  font-size: 1.4rem;
  padding: 0.3rem 1.5rem;
}

/* Payment note */
.payment-note {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: #fff8e7;
  border-left: 4px solid var(--primary-gold);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  color: #5e4b1e;
  font-size: 0.95rem;
}

.payment-note i {
  font-size: 1.2rem;
  color: var(--primary-gold);
}

/* Action buttons */
.payment-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-payment-confirm {
  background: #1e1e1e;
  color: var(--primary-gold);
  border: 2px solid #1e1e1e;
  padding: 1rem 2.2rem;
  border-radius: 60px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

.btn-payment-confirm:hover {
  background: transparent;
  color: #1e1e1e;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

.btn-payment-cancel {
  background: transparent;
  border: 2px solid #ccc;
  color: #777;
  padding: 1rem 2rem;
  border-radius: 60px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-payment-cancel:hover {
  border-color: var(--primary-gold);
  color: var(--primary-gold);
  background: rgba(255,215,0,0.05);
}

/* --- Payment modal active state (resets parent container) --- */
#order-modal .modal-content.payment-modal-active {
  background: transparent;
  padding: 0;
  box-shadow: none;
  border: none;                     /* removes gold border from parent */
  max-width: 700px;                 /* focused width for desktop */
  height: auto;                      /* let content determine height */
}

/* Ensure close button is visible on dark overlay */
#order-modal .modal-content.payment-modal-active .modal-close-btn {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.3);
  top: 1rem;
  right: 1rem;
}

#order-modal .modal-content.payment-modal-active .modal-close-btn:hover {
  background: var(--primary-gold);
  color: #000;
  transform: rotate(90deg);
}

/* --- Mobile adjustments (≤640px) --- */
@media (max-width: 640px) {
  .payment-modal {
    padding: 1.5rem;
    max-height: 70vh;               /* reduced height */
    overflow-y: auto;                /* scroll if needed */
  }

  .bank-details-card {
    padding: 1.2rem;
    margin-bottom: 1.2rem;
  }

  .payment-header .icon-wrapper {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
  }
  .payment-header .icon-wrapper i {
    font-size: 2rem;
    width: 48px;
    height: 48px;
  }

  .payment-header h2 {
    font-size: 1.8rem;
  }

  .total-row {
    margin-left: -1.2rem;
    margin-right: -1.2rem;
    padding: 0.8rem 1.2rem;
  }
  .total-row .bank-value {
    font-size: 1.2rem;
    padding: 0.2rem 1rem;
  }

  .payment-note {
    padding: 0.8rem 1rem;
    margin-bottom: 1.2rem;
    flex-direction: column;
    text-align: center;
  }

  .payment-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  .btn-payment-confirm,
  .btn-payment-cancel {
    width: 100%;
    justify-content: center;
    padding: 0.9rem 1rem;
  }
}

/* --- Desktop fine-tuning (≥769px) --- */
@media (min-width: 769px) {
  /* Ensure modal content never has a fixed height */
  #order-modal .modal-content {
    max-height: none;
    height: auto;
  }

  /* Optional: slightly more padding for larger screens */
  .payment-modal {
    padding: 3rem;
  }
  .bank-details-card {
    padding: 2rem 2.5rem;
  }
}


/* New Modal Styles */
.modal-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem 0;
}

.modal-header h2 {
  color: var(--primary-black);
  font-size: 2rem;
  margin: 0 0 0.5rem 0;
  font-weight: 700;
}

.modal-body-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  padding: 2rem 0;
}

.success-icon, .payment-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
}

.success-message, .payment-message {
  font-size: 1.2rem;
  line-height: 1.6;
  margin: 1rem 0;
  color: #333;
  max-width: 400px;
}

.contact-message {
  font-size: 1.1rem;
  color: #666;
  margin: 0.5rem 0;
  max-width: 400px;
}

.thank-you, .thank-you-payment {
  font-weight: 700;
  color: var(--primary-black);
  margin: 1rem 0;
  font-size: 1.1rem;
}

.whatsapp-link {
  margin: 2rem 0;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white !important;
  padding: 1rem 2rem;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
  transition: all 0.3s ease;
}

.whatsapp-btn:hover {
  background: linear-gradient(135deg, #128c7e 0%, #25d366 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* --- Review modal active state (resets parent container) --- */
#order-modal .modal-content.review-modal-active {
  background: transparent;
  padding: 0;
  box-shadow: none;
  border: none;
  max-width: 600px;          /* slightly narrower than payment modal */
  height: auto;
}

/* --- Premium Review Modal --- */
.review-modal {
  background: linear-gradient(145deg, #ffffff 0%, #fafafa 100%);
  border-radius: 32px;
  padding: 2.5rem;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 215, 0, 0.2);
  position: relative;
  overflow: hidden;
}

/* Gold accent line */
.review-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-gold), #fff8e0, var(--primary-gold));
  border-radius: 32px 32px 0 0;
}

.review-header {
  text-align: center;
  margin-bottom: 2rem;
}

.review-header .icon-wrapper {
  width: 80px;
  height: 80px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  border: 2px dashed var(--primary-gold);
}

.review-header .icon-wrapper i {
  font-size: 2.5rem;
  color: var(--primary-black);
  background: var(--primary-gold);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #1e1e1e;
  margin-bottom: 0.25rem;
}

.review-header p {
  color: #666;
  font-size: 1rem;
}

/* Rating stars */
.rating-group {
  margin-bottom: 2rem;
}

.rating-group label {
  display: block;
  font-weight: 600;
  color: #1e1e1e;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.star-rating {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-direction: row-reverse; /* makes selection highlight work nicely */
}

.star-rating input {
  display: none;
}

.star-rating label {
  font-size: 3rem;
  color: #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: var(--primary-gold);
  transform: scale(1.1);
  filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.4));
}

.star-rating input:checked + label {
  color: var(--primary-gold);
}

/* Form group */
.review-form .form-group {
  margin-bottom: 2rem;
}

.review-form label {
  display: block;
  font-weight: 600;
  color: #1e1e1e;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.review-form label span {
  font-weight: 400;
  color: #888;
  font-size: 0.9rem;
}

.review-form textarea {
  width: 100%;
  padding: 1rem 1.2rem;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f9f9f9;
  resize: vertical;
  min-height: 120px;
}

.review-form textarea:focus {
  outline: none;
  border-color: var(--primary-gold);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.1);
}

/* Action buttons */
.review-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.btn-review-cancel {
  background: transparent;
  border: 2px solid #ccc;
  color: #777;
  padding: 0.8rem 2rem;
  border-radius: 60px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1rem;
}

.btn-review-cancel:hover {
  border-color: var(--primary-gold);
  color: var(--primary-gold);
  background: rgba(255, 215, 0, 0.05);
}

.btn-review-submit {
  background: #1e1e1e;
  color: var(--primary-gold);
  border: 2px solid #1e1e1e;
  padding: 0.8rem 2.2rem;
  border-radius: 60px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.btn-review-submit:hover {
  background: transparent;
  color: #1e1e1e;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .review-modal {
    padding: 1.8rem;
  }

  .review-header .icon-wrapper {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
  }
  .review-header .icon-wrapper i {
    font-size: 2rem;
    width: 48px;
    height: 48px;
  }

  .review-header h2 {
    font-size: 1.8rem;
  }

  .star-rating label {
    font-size: 2.5rem;
  }

  .review-actions {
    flex-direction: column;
  }

  .btn-review-cancel,
  .btn-review-submit {
    width: 100%;
    justify-content: center;
  }
}

/* Very small devices */
@media (max-width: 480px) {
  .star-rating label {
    font-size: 2rem;
  }
}
/* Mobile Responsiveness */
@media (max-width: 768px) {
  .modal-content {
    padding: 1.5rem;
    max-width: 95%;
  }

  .modal-form-header h2 {
    font-size: 1.6rem;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .form-section {
    padding: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn-secondary,
  .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .total-section {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .modal-header h2 {
    font-size: 1.6rem;
  }

  .success-icon, .payment-icon {
    font-size: 3rem;
  }

  .success-message, .payment-message {
    font-size: 1rem;
  }

  .star-rating label {
    font-size: 2rem;
  }
  
  /* Responsive adjustments for the customization modal */
  .modal-body {
    grid-template-columns: 1fr; /* Stack columns on mobile */
    gap: 1.5rem;
  }

  .modal-content {
    width: 95%;
    padding: 1.5rem;
  }
  .modal-content #modal-title {
    font-size: 1.8rem;
  }

  #current-bag-list,
  #available-books-list {
    max-height: 300px; /* Adjust max height for mobile */
  }

  .modal-book-item {
    grid-template-columns: 40px 1fr auto;
    gap: 0.75rem;
    padding: 0.6rem;
  }

  .modal-book-img {
    width: 40px;
    height: 60px;
  }

  .modal-book-title {
    font-size: 0.9rem;
  }

  /* Shop Layout Mobile */
  .shop-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .ready-bags-grid {
    grid-template-columns: 1fr;
  }

  .book-title {
    font-size: 1rem;
  }

  .book-price {
    font-size: 1.1rem;
  }

  .cart-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    top: auto;
    padding: 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .cart-sidebar.active {
    transform: translateY(0);
  }

  .cart-sidebar .cart-summary {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    width: 100%;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
    padding: 1.2rem;
    border: none;
    border-top: 2px solid var(--primary-gold);
  }

  #cart-items {
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 0.8rem;
  }

  .cart-summary .total {
    margin: 0.5rem 0;
    font-size: 1.1rem;
  }

  .mobile-nav.active {
    display: flex;
  }

  /* Mobile Navigation */
  .nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: block;
  }
}


@media (max-width: 768px) {
  /* Hide desktop cart sidebar completely on mobile */
  .cart-sidebar {
    display: none;
  }

  /* (Keep all your existing mobile styles) */
}

.book-title{
  color: var(--primary-white);
}

@media (max-width: 768px) {
  /* Hide the desktop headings */
  .current-bag h3,
  .available-books h3 {
    display: none;
  }

  /* Hide the empty‑state message when no books are selected */
  #current-bag-list li[style*="text-align:center"] {
    display: none;
  }

  /* Remove the “Your Bag (swipe to see all)” pseudo‑element */
  #current-bag-list::before {
    display: none;
  }

  /* Optional: reduce top padding of the list to regain space */
  #current-bag-list {
    padding-top: 0;
  }

    #available-books-list::before {
    display: none;
  }
}


