/* preloved.css – Premium Preloved Page */

:root {
  --primary-gold: #FFD700;
  --primary-black: #000000;
  --primary-white: #FFFFFF;
  --dark-text: #222;
  --shadow: 0 8px 30px rgba(0,0,0,0.08);
  
  /* Responsive Breakpoint (Single Source of Truth) */
  /* Mobile: < 1920px | Desktop: >= 1920px */
  --header-breakpoint: 1920px;
  --cart-breakpoint: var(--header-breakpoint); /* Cart uses same breakpoint as header for consistency */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #0a0a0a;
  color: #fff;
  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.8rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hidden {
  display: none !important;
}

.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);
  color: var(--primary-white);
}
.btn-outline:hover {
  background: var(--primary-gold);
  color: var(--primary-black);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--primary-white);
  position: relative;
  padding-bottom: 1rem;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--primary-gold);
  border-radius: 2px;
}

/* ===== HEADER REDESIGN (Plain Links + Hamburger on Tablet) ===== */
.header {
  background: #000000;
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  height: auto;
  min-height: 70px;
}

.header .container {
  max-width: none;
  width: 100%;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  max-height: 80px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: left center;
  margin: 0;
  transition: transform 0.3s ease;
}
.logo:hover {
  transform: scale(1.05);
  transition: width 0.3s ease;
}
.tagline {
  font-size: 0.65rem;
  color: #aaa;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0;
}

/* Desktop navigation */
.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.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;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav a i {
  font-size: 1.1rem;
  transition: color 0.3s ease;
}
.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%;
}

/* Remove button styling from the three special links */
.nav .btn-primary,
.nav .btn-contact,
.nav .btn-partner {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0.5rem 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}
.nav .btn-primary:hover,
.nav .btn-contact:hover,
.nav .btn-partner:hover {
  background: transparent !important;
  color: var(--primary-gold) !important;
  transform: none !important;
}
.nav .btn-primary::after,
.nav .btn-contact::after,
.nav .btn-partner::after {
  display: block;
}

/* Mobile menu toggle - hidden on desktop, visible on tablet/mobile */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}
.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}
.mobile-menu-toggle i {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}
.mobile-menu-toggle.active i {
  transform: rotate(90deg) scale(1.2);
  color: #FFD700;
}

/* Mobile navigation panel (remains button‑styled for touch) */
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  width: auto;
  min-width: 200px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.98) 0%, rgba(20, 20, 20, 0.95) 100%);
  flex-direction: column;
  padding: 1rem 1.5rem;
  gap: 0.8rem;
  border-top: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -8px 8px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(-10px) scaleY(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  pointer-events: none;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  transform-origin: top right;
}
.mobile-nav.active {
  display: flex;
  animation: slideDownMenu 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: auto;
}

@keyframes slideDownMenu {
  0% {
    transform: translateY(-10px) scaleY(0.95);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scaleY(1);
    opacity: 1;
  }
}
.mobile-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.7rem 0.5rem;
  border-bottom: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  position: relative;
  overflow: hidden;
}

.mobile-nav.active a {
  animation: slideInItem 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.mobile-nav a:nth-child(1) { animation-delay: 0.05s; }
.mobile-nav a:nth-child(2) { animation-delay: 0.1s; }
.mobile-nav a:nth-child(3) { animation-delay: 0.15s; }
.mobile-nav a:nth-child(4) { animation-delay: 0.2s; }
.mobile-nav a:nth-child(5) { animation-delay: 0.25s; }
.mobile-nav a:nth-child(6) { animation-delay: 0.3s; }

@keyframes slideInItem {
  0% {
    opacity: 0;
    transform: translateX(20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}
.mobile-nav a i {
  font-size: 1.1rem;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-nav a:hover {
  color: #fff;
  padding-left: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  transform: translateX(8px);
}
.mobile-nav a:hover i {
  color: #FFD700;
  transform: scale(1.3) rotate(-10deg);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}
/* Keep buttons in mobile menu as actual buttons (better touch targets) */
.mobile-nav .btn-primary,
.mobile-nav .btn-contact,
.mobile-nav .btn-partner {
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-top: 0.3rem;
  font-size: 0.9rem;
  font-weight: 500;
  width: 100%;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.mobile-nav .btn-primary::before,
.mobile-nav .btn-contact::before,
.mobile-nav .btn-partner::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.mobile-nav .btn-primary:hover,
.mobile-nav .btn-contact:hover,
.mobile-nav .btn-partner:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFD700;
  border-color: rgba(255, 215, 0, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.2);
}

.mobile-nav .btn-primary:hover::before,
.mobile-nav .btn-contact:hover::before,
.mobile-nav .btn-partner:hover::before {
  width: 200px;
  height: 200px;
}
/* Tablet & mobile: hide desktop nav, show hamburger */
@media (max-width: 1919px) {
  .nav {
    display: none !important;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .header {
    height: auto;
    padding: 0.7rem 0;
  }
  .header-inner {
    padding: 0.7rem 1rem;
  }
  .logo {
    max-height: 70px;
  }
  .tagline {
    font-size: 0.6rem;
  }
  .mobile-menu-toggle {
    font-size: 1.3rem;
    padding: 0.4rem;
  }
}

/* Desktop (width >= 1920px): show desktop nav, hide mobile button */
@media (min-width: 1920px) {
  .mobile-menu-toggle {
    display: none !important;
  }
  .mobile-nav {
    display: none !important;
  }
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
  .header {
    min-height: 60px;
  }
  .header-inner {
    padding: 0.6rem 1rem;
  }
  .logo {
    max-height: 65px;
  }
  .mobile-nav {
    padding: 0.8rem 1rem;
    gap: 0.6rem;
    min-width: 180px;
  }
  .mobile-nav a {
    padding: 0.6rem 0.4rem;
    font-size: 0.9rem;
  }
  .mobile-nav .btn-primary,
  .mobile-nav .btn-contact,
  .mobile-nav .btn-partner {
    padding: 0.7rem 0.8rem;
    font-size: 0.85rem;
    margin-top: 0.2rem;
    width: auto;
    justify-content: flex-start;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .header {
    min-height: 56px;
  }
  .header-inner {
    padding: 0.5rem 0.75rem;
  }
  .logo {
    max-height: 55px;
  }
  .tagline {
    font-size: 0.5rem;
    display: none;
  }
  .mobile-menu-toggle {
    font-size: 1.2rem;
    padding: 0.3rem;
  }
  .mobile-nav {
    padding: 0.7rem 0.9rem;
    gap: 0.5rem;
    min-width: 160px;
  }
  .mobile-nav a {
    padding: 0.5rem 0.3rem;
    font-size: 0.85rem;
  }
  .mobile-nav .btn-primary,
  .mobile-nav .btn-contact,
  .mobile-nav .btn-partner {
    padding: 0.6rem 0.7rem;
    font-size: 0.8rem;
    margin-top: 0.15rem;
    width: auto;
    justify-content: flex-start;
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(0,0,0,0.9), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1350&q=80') center/cover no-repeat;
}
.hero-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}
.hero-accent-line {
  width: 0;
  height: 4px;
  background: var(--primary-gold);
  margin: 0 auto 2rem;
  animation: expandLine 1.5s 0.5s forwards ease-out;
}
@keyframes expandLine {
  to { width: 80px; }
}
.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, 1));
}
.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; }
@keyframes fadeUpWord {
  to { opacity: 1; transform: translateY(0); }
}
.hero-subtitle {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 2rem auto;
  opacity: 0;
  animation: fadeUp 0.8s 0.8s forwards;
}
.btn-hero {
  opacity: 0;
  animation: fadeUp 0.8s 1.1s forwards;
  margin: 0.5rem;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
  .hero-title { font-size: 2.2rem; }
  .hero-subtitle { font-size: 1rem; }
}

/* Books Grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}
.book-card {
  background: #111;
  border-radius: 24px;
  overflow: hidden;
  transition: transform 0.4s, box-shadow 0.4s;
  border: 1px solid rgba(255,215,0,0.2);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.book-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary-gold);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 0 2px rgba(255,215,0,0.2);
}
.book-img {
  width: 100%;
  aspect-ratio: 2/3;
  aspect-ratio: 2 / 3;
  background-color: #1a1a1a;
  object-fit: cover;
  transition: transform 0.6s;
  display: block;
}
.book-card:hover .book-img {
  transform: scale(1.05);
}
.book-content {
  padding: 1.5rem;
  background: #111;
}

.book-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}


.book-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-gold);
  margin: 0.5rem 0 1rem;
}
.select-btn {
  background: transparent;
  border: 2px solid var(--primary-gold);
  color: var(--primary-gold);
  padding: 0.6rem 1rem;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.9rem;
  width: 100%;
  transition: all 0.3s;
  cursor: pointer;
}
.select-btn i {
  margin-right: 0.5rem;
}
.select-btn:hover {
  background: var(--primary-gold);
  color: #000;
}
.select-btn.selected {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}

/* Search Bar */
.search-bar {
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 60px;
  padding: 1rem 1.5rem 1rem 3rem;
  color: #fff;
  font-size: 1rem;
  width: 100%;
  max-width: 500px;
  margin: 0 auto 2rem;
  transition: all 0.3s;
  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='%23FFD700' 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 0 0 3px rgba(255,215,0,0.2);
  background-color: #222;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
}
.pagination button {
  background: #1a1a1a;
  border: 2px solid #333;
  color: #fff;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}
.pagination button:not(:disabled):hover {
  border-color: var(--primary-gold);
  background: var(--primary-gold);
  color: #000;
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#pageNumbers {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.page-number {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #1a1a1a;
  border: 2px solid #333;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}
.page-number:hover {
  border-color: var(--primary-gold);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}
.page-number.active {
  background: var(--primary-gold);
  border-color: var(--primary-gold);
  color: #000;
}
.page-number:active {
  transform: scale(0.95);
}

/* Shop Layout */
.shop-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.books-main {
  flex: 1;
  min-width: 0;
}

/* Cart Sidebar */
.cart-sidebar {
  position: sticky;
  top: 100px;
  width: 300px;
  flex-shrink: 0;
}
.cart-summary {
  background: #111;
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.cart-summary.hidden {
  display: none !important;
}
.cart-summary h3 {
  color: var(--primary-gold);
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.cart-header h3 {
  margin: 0;
}
.clear-cart-btn {
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.4rem;
  border-radius: 6px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.clear-cart-btn:hover {
  background: rgba(255, 107, 107, 0.1);
  color: #ff5252;
}
#cart-items {
  max-height: 300px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}
#cart-items li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid #333;
  color: #ddd;
  font-size: 0.9rem;
  gap: 0.5rem;
}
#cart-items li span {
  flex: 1;
  overflow-wrap: break-word;
}
.remove-btn {
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  transition: all 0.3s;
  flex-shrink: 0;
}
.remove-btn:hover {
  background: rgba(255, 107, 107, 0.1);
  color: #ff5252;
}
.total {
  text-align: right;
  color: #fff;
  font-size: 1.1rem;
  margin: 1rem 0;
}
#cart-total {
  color: var(--primary-gold);
  font-weight: 700;
  font-size: 1.3rem;
}

/* Mobile Cart Banner */
.mobile-cart-banner {
  display: none;
  background: #000;
  border-top: 2px solid var(--primary-gold);
  border-radius: 20px 20px 0 0;
  margin: 0 1rem;
  position: sticky;
  bottom: 0;
  z-index: 999;
}
.mobile-cart-banner.hidden {
  display: none;
}
.mobile-cart-banner:not(.hidden) {
  display: block;
}
.banner-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
}
.banner-amount {
  color: var(--primary-gold);
  font-weight: bold;
}
.banner-toggle {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 0.85rem;
}
.banner-details {
  max-height: 0;
  overflow: hidden;
  background: #111;
  transition: max-height 0.3s ease-out;
}
.banner-details.open {
  max-height: 250px;
  overflow-y: auto;
}
#mobile-cart-list {
  list-style: none;
  padding: 1rem;
}
#mobile-cart-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #222;
  color: #ccc;
  gap: 0.5rem;
}
#mobile-cart-list li span {
  flex: 1;
  overflow-wrap: break-word;
}
.mobile-remove-btn {
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.3rem;
  border-radius: 4px;
  transition: all 0.3s;
  flex-shrink: 0;
}
.mobile-remove-btn:hover {
  background: rgba(255, 107, 107, 0.1);
  color: #ff5252;
}

/* Footer */
.footer {
  background: #000;
  color: #fff;
  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: #fff;
  text-decoration: none;
}
.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: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: all 0.3s;
}
.social-icons a:hover {
  background: var(--primary-gold);
  transform: translateY(-4px);
}
.copyright {
  text-align: center;
  border-top: 1px solid #fff;
  padding-top: 2rem;
  font-size: 0.9rem;
}

/* Modals (Payment, Review) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  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: #fff;
  border-radius: 32px;
  max-width: 1000px;
  width: 90%;
  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: rgba(0,0,0,0.1);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 10;
}
.modal-close-btn:hover {
  background: #000;
  color: var(--primary-gold);
  transform: rotate(90deg);
}

/* Premium Modal Layout */
.premium-modal {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  min-height: 500px;
}
.premium-summary {
  background: #fff;
  padding: 2rem;
  border-right: 2px solid var(--primary-gold);
  overflow-y: auto;
}
.premium-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--primary-gold);
  padding-bottom: 1rem;
}
.premium-summary-header h3 {
  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;
  margin-bottom: 1.5rem;
}
.order-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}
.order-item-img {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}
.order-item-info {
  flex: 1;
}
.order-item-title {
  font-weight: 700;
  color: #000;
}
.order-item-price {
  font-weight: 600;
  color: var(--primary-gold);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}
.premium-total {
  display: flex;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 2px dashed var(--primary-gold);
  font-weight: 700;
  font-size: 1.2rem;
  color: #000;
}
.premium-form {
  background: #0a0a0a;
  padding: 2rem;
  color: #fff;
  overflow-y: auto;
}
.premium-form-header h2 {
  font-size: 2rem;
  color: var(--primary-gold);
  margin-bottom: 0.25rem;
}
.premium-form-header p {
  color: #aaa;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 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;
}
.input-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-gold);
}
.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;
  background: #1a1a1a;
  color: #fff;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
}
.input-wrapper input:focus,
.input-wrapper textarea:focus,
.input-wrapper select:focus {
  border-color: var(--primary-gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,215,0,0.2);
}
.premium-radio-group {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
}
.premium-radio-group label {
  color: #fff;
}
.radio-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.radio-option input {
  accent-color: var(--primary-gold);
}
.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;
  margin: 1rem 0;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}
.btn-cancel {
  background: transparent;
  border: 2px solid #666;
  color: #ccc;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-cancel:hover {
  background: #333;
  border-color: #888;
  color: #fff;
}
.btn-submit {
  background: var(--primary-gold);
  color: #000;
  border: 2px solid var(--primary-gold);
  padding: 0.8rem 2.5rem;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-submit:hover {
  background: transparent;
  color: var(--primary-gold);
  transform: translateY(-2px);
}

/* Payment & Review Modals */
.payment-modal, .review-modal {
  background: linear-gradient(145deg, #fff, #fafafa);
  border-radius: 32px;
  padding: 2.5rem;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}
.payment-modal::before, .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));
}
.payment-header, .review-header {
  text-align: center;
  margin-bottom: 2rem;
}
.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);
}
.icon-wrapper i {
  font-size: 2.5rem;
  background: var(--primary-gold);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}
.bank-details-card {
  background: #f4f4f4;
  border-radius: 24px;
  padding: 1.8rem;
  margin-bottom: 2rem;
}
.bank-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.bank-row:last-child {
  border-bottom: none;
}
.bank-label {
  font-weight: 600;
  color: #555;
}
.bank-value {
  font-weight: 700;
  color: #1e1e1e;
}
.total-row {
  background: #1e1e1e;
  margin: 1.5rem -1.8rem -1.8rem -1.8rem;
  padding: 1rem 1.8rem;
  border-radius: 0 0 24px 24px;
}
.total-row .bank-label {
  color: #aaa;
}
.total-row .bank-value {
  background: var(--primary-gold);
  padding: 0.3rem 1.5rem;
  border-radius: 40px;
  color: #1e1e1e;
}
.payment-note {
  background: #fff8e7;
  border-left: 4px solid var(--primary-gold);
  padding: 1rem;
  border-radius: 16px;
  display: flex;
  gap: 0.8rem;
  margin-bottom: 2rem;
}
.payment-actions, .review-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.btn-payment-confirm, .btn-review-submit {
  background: #1e1e1e;
  color: var(--primary-gold);
  border: 2px solid #1e1e1e;
  padding: 1rem 2.2rem;
  border-radius: 60px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-payment-confirm:hover, .btn-review-submit:hover {
  background: transparent;
  color: #1e1e1e;
  transform: translateY(-2px);
}
.btn-payment-cancel, .btn-review-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, .btn-review-cancel:hover {
  border-color: var(--primary-gold);
  color: var(--primary-gold);
}
.star-rating {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-direction: row-reverse;
}
.star-rating input {
  display: none;
}
.star-rating label {
  font-size: 3rem;
  color: #ddd;
  cursor: pointer;
  transition: all 0.2s;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: var(--primary-gold);
  transform: scale(1.1);
}
.review-form textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  resize: vertical;
  margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 992px) {
  .premium-modal {
    grid-template-columns: 1fr;
  }
  .premium-summary {
    border-right: none;
    border-bottom: 2px solid var(--primary-gold);
  }
}
@media (max-width: 1919px) {
  .shop-layout {
    flex-direction: column;
    gap: 1.5rem;
  }
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .cart-sidebar {
    display: none;
    width: 100%;
  }
  .mobile-cart-banner:not(.hidden) {
    display: block;
  }
  .modal-content {
    width: 95%;
  }
  .payment-modal, .review-modal {
    padding: 1.5rem;
  }
  .star-rating label {
    font-size: 2rem;
  }
}

/* ===== WHATSAPP SUPPORT BUTTON ===== */
.whatsapp-support-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease;
}

.whatsapp-support-btn .whatsapp-icon-wrapper {
  width: 70px;
  height: 70px;
  background-color: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  position: relative;
  animation: whatsappPulse 1.8s infinite ease-in-out;
}

.whatsapp-support-btn i {
  font-size: 38px;
  color: white;
  transition: transform 0.2s;
}

.whatsapp-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.8);
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.whatsapp-support-btn:hover .whatsapp-icon-wrapper {
  transform: scale(1.08);
  background-color: #20b859;
}

.whatsapp-icon-wrapper::before {
  content: '';
  position: absolute;
  inset: -6px;
  background: rgba(37, 211, 102, 0.2);
  border-radius: 50%;
  z-index: -1;
  animation: ringPulse 1.8s infinite ease-out;
}

@keyframes whatsappPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes ringPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

@media (max-width: 1919px) {
  .whatsapp-support-btn {
    bottom: 85px; /* Stay above the mobile cart banner if active */
    bottom: 110px; /* Increased to avoid overlap with mobile cart banner checkout button */
    right: 16px;
  }
  .whatsapp-support-btn .whatsapp-icon-wrapper {
    width: 56px;
    height: 56px;
  }
  .whatsapp-support-btn i {
    font-size: 30px;
  }
  .whatsapp-label {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}