/* KAMOTA BOOKS — Components (theme in theme.css, base in global.css) */

/* ============================================================
   Utilities
   ============================================================ */

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.surface {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4, h5, h6,
.hero-title,
.section-title,
.auth-title,
.detail-title {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink-900);
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-1);
}

.eyebrow.on-navy {
  color: var(--gold-400);
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: var(--space-1);
}

.page-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: var(--space-1);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-gold {
  background: var(--accent);
  color: var(--navy-900);
  border-color: var(--accent);
}

.btn-gold:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(244, 180, 0, 0.35);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
}

.btn-outline-navy {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-navy:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-outline-gold {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline-gold:hover {
  background: var(--accent);
  color: var(--navy-900);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}

.btn-ghost:hover {
  color: var(--primary);
  background: transparent;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-danger:hover {
  background: var(--danger);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8125rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-paypal {
  background: #0070ba;
  color: var(--white);
  border-color: #0070ba;
}

.btn-paypal:hover {
  background: #005ea6;
  border-color: #005ea6;
}

.btn-flutterwave {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-flutterwave:hover {
  background: var(--secondary);
  border-color: var(--secondary);
}

.pay-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 700;
  font-size: 0.75rem;
}

.pay-icon.fw {
  font-size: 0.5rem;
}

/* ============================================================
   Header / Navigation
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(20, 45, 77, 0.98) 0%, rgba(31, 58, 95, 0.95) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(244, 180, 0, 0.18);
  box-shadow: var(--shadow-nav);
}

.nav-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--nav-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.logo:hover {
  color: var(--accent);
}

.logo-img-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: clamp(56px, 9vw, 68px);
  height: clamp(56px, 9vw, 68px);
  padding: 6px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff 0%, #f0f4f8 100%);
  border: 2px solid rgba(244, 180, 0, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  overflow: hidden;
}

.logo-img-wrap--brand {
  width: clamp(150px, 21vw, 220px);
  height: clamp(44px, 6.5vw, 58px);
  padding: 6px 10px;
  margin-right: 4px;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-img--brand {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.logo-img-wrap-sm {
  width: 48px;
  height: 48px;
  padding: 4px;
  border-radius: 10px;
  justify-content: center;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
}

.logo-text small {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

.nav-link {
  position: relative;
  padding: var(--space-1) var(--space-2);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--accent);
  font-weight: 600;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: var(--space-2);
  right: var(--space-2);
  bottom: 2px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-link-admin {
  color: var(--gold-600);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-self: end;
}

.auth-area {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-user-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-right: var(--space-1);
}

.nav-toggle {
  display: none;
  font-size: 1.5rem;
  line-height: 1;
  padding: var(--space-1);
  color: var(--primary);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.nav-toggle:hover {
  background: var(--paper-100);
}

/* Auth dropdown */
.auth-dropdown {
  position: relative;
}

.auth-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--paper-100);
  border: 1px solid rgba(11, 31, 58, 0.1);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-dropdown-toggle:hover,
.auth-dropdown.open .auth-dropdown-toggle {
  background: var(--white);
  border-color: var(--accent);
}

.auth-dropdown-toggle::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.2s ease;
}

.auth-dropdown.open .auth-dropdown-toggle::after {
  transform: rotate(180deg);
}

.auth-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--white);
  border: 1px solid rgba(11, 31, 58, 0.1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  padding: var(--space-1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 200;
}

.auth-dropdown.open .auth-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.auth-dropdown-menu a,
.auth-dropdown-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-dropdown-menu a:hover,
.auth-dropdown-menu button:hover {
  background: var(--paper-100);
  color: var(--primary);
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-600) 100%);
  color: var(--white);
  padding: var(--space-6) 0;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-5);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--white);
  margin-bottom: var(--space-2);
}

.hero-title em {
  font-style: normal;
  color: var(--gold-400);
}

.hero-sub {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
  max-width: 520px;
  margin-bottom: var(--space-3);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.hero-stack {
  position: relative;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stack-book {
  position: absolute;
  width: 180px;
  height: 260px;
  border-radius: 3px 8px 8px 3px;
  box-shadow:
    0 14px 32px rgba(11, 31, 58, 0.42),
    0 6px 14px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  cursor: default;
}

.stack-book-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 16px;
  z-index: 2;
  border-radius: 3px 0 0 3px;
  box-shadow: inset -2px 0 6px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.stack-book-spine-text {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%) rotate(-90deg);
  white-space: nowrap;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.42rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 180, 0, 0.55);
  text-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.stack-book-cover {
  position: absolute;
  inset: 0;
  border-radius: 3px 8px 8px 3px;
  z-index: 1;
  overflow: hidden;
}

.stack-book-art {
  position: absolute;
  left: 16px;
  top: 0;
  width: calc(100% - 16px);
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 0 7px 7px 0;
  pointer-events: none;
  user-select: none;
}

.stack-book--brown .stack-book-spine-text {
  color: rgba(232, 220, 200, 0.62);
}

.stack-book--grey .stack-book-spine-text {
  color: rgba(244, 180, 0, 0.52);
}

.stack-book-pages {
  position: absolute;
  right: -4px;
  top: 6px;
  bottom: 6px;
  width: 10px;
  z-index: 0;
  border-radius: 0 2px 2px 0;
  background:
    repeating-linear-gradient(
      180deg,
      #f5f0e8 0px,
      #f5f0e8 2px,
      #e8e0d4 2px,
      #e8e0d4 3px
    );
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.15);
}

.stack-book-shine {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 3px 8px 8px 3px;
  background:
    linear-gradient(
      118deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.05) 28%,
      transparent 52%,
      rgba(0, 0, 0, 0.06) 100%
    ),
    radial-gradient(ellipse 80% 40% at 75% 15%, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.stack-book--navy .stack-book-spine::after,
.stack-book--brown .stack-book-spine::after,
.stack-book--grey .stack-book-spine::after {
  content: "";
  position: absolute;
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(244, 180, 0, 0.35), transparent);
  opacity: 0.6;
}

.stack-book--navy .stack-book-spine {
  background:
    linear-gradient(90deg, #0d2240 0%, #1a3a5f 45%, #142d4d 100%),
    repeating-linear-gradient(180deg, transparent 0px, transparent 2px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.03) 3px);
}

.stack-book--brown .stack-book-spine {
  background:
    linear-gradient(90deg, #3d2512 0%, #5c3a1e 45%, #4a2f18 100%),
    repeating-linear-gradient(180deg, transparent 0px, transparent 2px, rgba(255, 255, 255, 0.04) 2px, rgba(255, 255, 255, 0.04) 3px);
}

.stack-book--grey .stack-book-spine {
  background:
    linear-gradient(90deg, #4a5360 0%, #6b7585 45%, #5c6573 100%),
    repeating-linear-gradient(180deg, transparent 0px, transparent 2px, rgba(255, 255, 255, 0.04) 2px, rgba(255, 255, 255, 0.04) 3px);
}

.stack-book:nth-child(1) {
  transform: rotate(-8deg) translateX(-40px);
  z-index: 1;
}

.stack-book:nth-child(2) {
  transform: rotate(2deg);
  z-index: 2;
}

.stack-book:nth-child(3) {
  transform: rotate(10deg) translateX(40px);
  z-index: 3;
}

.stack-book:nth-child(1):hover {
  transform: rotate(-8deg) translateX(-40px) translateY(-8px);
  box-shadow:
    0 20px 40px rgba(244, 180, 0, 0.22),
    0 10px 28px rgba(11, 31, 58, 0.35),
    0 6px 14px rgba(0, 0, 0, 0.25);
}

.stack-book:nth-child(2):hover {
  transform: rotate(2deg) translateY(-8px);
  box-shadow:
    0 20px 40px rgba(244, 180, 0, 0.22),
    0 10px 28px rgba(11, 31, 58, 0.35),
    0 6px 14px rgba(0, 0, 0, 0.25);
}

.stack-book:nth-child(3):hover {
  transform: rotate(10deg) translateX(40px) translateY(-8px);
  box-shadow:
    0 20px 40px rgba(244, 180, 0, 0.22),
    0 10px 28px rgba(11, 31, 58, 0.35),
    0 6px 14px rgba(0, 0, 0, 0.25);
}

/* ============================================================
   Sections
   ============================================================ */

.view {
  flex: 1;
}

.section {
  padding: var(--space-5) 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.empty-state {
  text-align: center;
  padding: var(--space-5) var(--space-3);
  color: var(--text-muted);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: var(--space-1);
}

/* ============================================================
   Filter Bar
   ============================================================ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-2);
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(11, 31, 58, 0.06);
}

.filter-bar input[type="search"],
.filter-bar select,
.field input,
.field select,
.field textarea,
.newsletter-form input {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.9375rem;
  background: var(--paper-50);
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-bar input[type="search"] {
  flex: 1;
  min-width: 200px;
}

.filter-bar select {
  min-width: 160px;
  flex-shrink: 0;
}

.filter-bar input:focus,
.filter-bar select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.newsletter-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244, 180, 0, 0.2);
}

/* ============================================================
   Book Grid & Cards
   ============================================================ */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

.popular-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.book-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.book-card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 180, 0, 0.22);
  box-shadow: 0 8px 28px rgba(244, 180, 0, 0.12), 0 6px 20px rgba(11, 31, 58, 0.28);
}

.popular-card {
  position: relative;
}

.rank-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 5;
  background: var(--primary);
  color: var(--gold-400);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(11, 31, 58, 0.3);
}

.badge-trending {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy-900);
  background: var(--gold-400);
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.book-cover-wrap {
  position: relative;
  overflow: hidden;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 31, 58, 0.92) 0%, rgba(11, 31, 58, 0.75) 100%);
  color: var(--white);
  font-size: 0.8125rem;
  line-height: 1.5;
  padding: var(--space-2);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.book-card:hover .preview-overlay {
  opacity: 1;
}

.book-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-2);
  background-size: cover;
  background-position: center;
  color: var(--white);
}

.book-cover.has-image {
  padding: 0;
}

.book-cover--placeholder {
  background: var(--book-placeholder);
  border: 1px solid var(--book-placeholder-border);
  color: var(--navy-900);
  transition: box-shadow 0.3s ease;
}

.book-cover--placeholder .cover-title {
  color: var(--navy-900);
}

.book-cover--placeholder .cover-author {
  color: var(--navy-800);
}

.book-cover--placeholder .rule {
  background: rgba(11, 31, 58, 0.15);
}

.book-card:hover .book-cover--placeholder {
  box-shadow: inset 0 0 0 1px rgba(244, 180, 0, 0.2);
}

.book-cover.library-cover {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.book-cover .rule {
  width: 32px;
  height: 3px;
  background: var(--gold-500);
  border-radius: 2px;
  margin-bottom: var(--space-1);
}

.cover-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.3;
  margin-bottom: 4px;
}

.cover-author {
  font-size: 0.75rem;
  opacity: 0.85;
}

.ribbon-wrap {
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  overflow: hidden;
  pointer-events: none;
}

.ribbon {
  position: absolute;
  top: 10px;
  right: -28px;
  width: 100px;
  padding: 4px 0;
  background: var(--gold-500);
  color: var(--navy-900);
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  transform: rotate(45deg);
}

.ribbon.is-owned {
  background: var(--success);
  color: var(--white);
}

.ribbon.is-owned::after {
  content: "Owned";
}

.ribbon:not(.is-owned)::after {
  content: "New";
}

.book-meta {
  padding: var(--space-2);
}

.book-meta .title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-meta .author {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.book-meta .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
}

.book-meta .price {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--accent);
}

.purchase-count {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 6px;
}

/* ============================================================
   Stars
   ============================================================ */

.stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.stars svg {
  width: 14px;
  height: 14px;
}

.stars.lg svg {
  width: 20px;
  height: 20px;
}

.star-filled {
  fill: var(--gold-500);
}

.star-empty {
  fill: var(--paper-100);
  stroke: var(--ink-300);
  stroke-width: 0.5;
}

/* ============================================================
   Book Detail
   ============================================================ */

.detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-4);
  align-items: start;
  margin-bottom: var(--space-4);
}

.detail-cover .book-cover {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  min-height: 400px;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--secondary);
  background: var(--paper-100);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: var(--space-2);
}

.detail-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: var(--space-1);
}

.detail-author {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.detail-price-row {
  margin: var(--space-3) 0;
}

.detail-price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.detail-desc {
  color: var(--text-muted);
  line-height: 1.75;
  margin-top: var(--space-3);
  max-width: 640px;
}

.pay-buttons-wrap {
  margin-top: var(--space-2);
}

.pay-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 360px;
}

.pay-hint {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.owned-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--success);
  background: rgba(5, 150, 105, 0.1);
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: var(--space-2);
}

/* ============================================================
   Reviews
   ============================================================ */

.reviews-section {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(11, 31, 58, 0.08);
}

.reviews-heading {
  margin-bottom: var(--space-3);
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.review-card {
  padding: var(--space-3);
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-1);
}

.review-body {
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: var(--space-1);
}

.review-date {
  font-size: 0.6875rem;
}

.empty-reviews,
.loading-text {
  color: var(--text-muted);
  font-size: 0.9375rem;
  padding: var(--space-3);
  text-align: center;
}

.review-admin-card {
  padding: var(--space-3);
  margin-bottom: var(--space-2);
}

.review-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(11, 31, 58, 0.06);
}

/* ============================================================
   Library
   ============================================================ */

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

.library-item {
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.library-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.library-price-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  margin: var(--space-1) 0;
}

.library-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--primary);
}

.library-price-label {
  font-size: 0.75rem;
  color: var(--text-light);
}

.expiry-note {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.expiry-note.expired {
  color: var(--danger);
  font-weight: 600;
}

.library-action {
  margin-top: var(--space-1);
}

/* ============================================================
   Auth Pages & Forms
   ============================================================ */

.auth-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 60vh;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: var(--space-4);
  margin-top: var(--space-3);
}

.auth-logo-wrap {
  margin: 0 auto var(--space-2);
  width: 72px;
  height: 72px;
}

.auth-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.auth-title {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: var(--space-1);
}

.auth-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: var(--space-3);
}

.field {
  margin-bottom: var(--space-2);
}

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.field-error {
  display: block;
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 6px;
  min-height: 1.2em;
}

.field-invalid input,
.field-invalid select,
.field-invalid textarea,
.field-invalid .password-input-wrap input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.password-input-wrap {
  position: relative;
  display: block;
}

.password-input-wrap input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle:hover {
  color: var(--primary);
  background: rgba(11, 31, 58, 0.06);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.password-toggle-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.auth-switch {
  text-align: center;
  margin-top: var(--space-3);
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.auth-switch a {
  font-weight: 600;
  color: var(--primary);
}

.auth-demo-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: var(--space-2);
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.form-grid .full {
  grid-column: 1 / -1;
}

/* ============================================================
   Admin
   ============================================================ */

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-3);
  align-items: start;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(11, 31, 58, 0.06);
  position: sticky;
  top: 88px;
}

.admin-nav button {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, color 0.2s ease;
}

.admin-nav button:hover {
  background: var(--paper-100);
  color: var(--primary);
}

.admin-nav button.active {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.admin-panel {
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.admin-panel h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  margin-bottom: var(--space-2);
  color: var(--primary);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.stat-card {
  padding: var(--space-3);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.stat-card .num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-card .lbl {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(11, 31, 58, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--paper-100);
}

th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(11, 31, 58, 0.1);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(11, 31, 58, 0.06);
  color: var(--text);
  vertical-align: middle;
}

tbody tr:hover {
  background: rgba(248, 250, 252, 0.8);
}

tbody tr:last-child td {
  border-bottom: none;
}

.admin-actions {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

/* ============================================================
   Category Grid & Pagination
   ============================================================ */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: var(--space-2) var(--space-3);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid rgba(11, 31, 58, 0.08);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent);
}

.category-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary);
}

.category-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
}

.page-info {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 120px;
  text-align: center;
}

/* ============================================================
   Newsletter
   ============================================================ */

.newsletter-section {
  padding: var(--space-5) 0 var(--space-6);
  background: linear-gradient(180deg, transparent 0%, var(--paper-100) 100%);
}

.newsletter-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
}

.newsletter-desc {
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  line-height: 1.65;
}

.newsletter-perks {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.newsletter-perks li {
  position: relative;
  padding-left: 22px;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.newsletter-perks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.newsletter-note {
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
}

/* ============================================================
   Modal
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 58, 0.55);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  border-bottom: 1px solid rgba(11, 31, 58, 0.08);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--primary);
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
  background: var(--paper-100);
  color: var(--primary);
}

.modal-body {
  padding: var(--space-3);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3);
  border-top: 1px solid rgba(11, 31, 58, 0.08);
}

/* ============================================================
   Toast
   ============================================================ */

.toast {
  position: fixed;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--primary);
  color: var(--white);
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  box-shadow: var(--shadow-lift);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  max-width: min(90vw, 420px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--danger);
}

/* ============================================================
   Loading Overlay
   ============================================================ */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(4px);
  z-index: 950;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.loading-overlay p {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--primary);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--paper-100);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

.site-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.85);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-3);
}

.footer-logo {
  color: var(--white);
}

.footer-logo:hover {
  color: var(--gold-400);
}

.footer-logo .logo-text {
  color: var(--white);
}

.logo-img-footer {
  width: 100%;
  height: 100%;
}

.footer-contact {
  font-size: 0.9375rem;
  line-height: 1.8;
  text-align: right;
}

.footer-bottom {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

/* ============================================================
   Responsive — mobile nav at 960px
   ============================================================ */

@media (max-width: 960px) {
  .nav-bar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .logo-img-wrap--brand {
    width: clamp(148px, 42vw, 220px);
    height: clamp(42px, 11vw, 54px);
    padding: 5px 10px;
  }

  .logo {
    grid-column: 1;
  }

  .nav-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: column;
    align-items: stretch;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    padding: 0;
    gap: 0;
  }

  .nav-links.open {
    max-height: 320px;
    opacity: 1;
    padding: var(--space-2) 0;
  }

  .nav-link {
    padding: 12px var(--space-2);
    border-radius: var(--radius-sm);
  }

  .nav-link.active::after {
    left: 0;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
  }

  .nav-link:hover {
    background: var(--paper-100);
  }

  .auth-area {
    display: flex;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-sub {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stack {
    height: 240px;
    order: -1;
  }

  .stack-book {
    width: 140px;
    height: 200px;
  }

  .stack-book-spine-text {
    font-size: 0.36rem;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-cover {
    max-width: 280px;
    margin: 0 auto;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
  }

  .admin-nav button {
    flex: 1 1 auto;
    text-align: center;
  }

  .newsletter-inner {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-contact {
    text-align: center;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 var(--space-2);
  }

  .book-grid,
  .popular-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .library-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar select {
    width: 100%;
  }

  .stat-row {
    grid-template-columns: 1fr;
  }

  .nav-user-label {
    display: none;
  }
}

/* ============================================================
   Search strip (below navbar)
   ============================================================ */

.search-strip {
  position: sticky;
  top: var(--nav-height);
  z-index: 90;
  background: rgba(26, 53, 88, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 0;
}

.search-strip-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
}

.search-strip-field {
  position: relative;
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 520px;
}

.search-strip-field input[type="search"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: none;
  padding: 8px 40px 8px 16px;
  font-size: 0.875rem;
  border-radius: 999px;
  border: 1px solid rgba(244, 180, 0, 0.25);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.search-strip-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--gold-400);
  cursor: pointer;
  opacity: 0.88;
  transition: color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.search-strip-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}

.search-strip-icon:hover,
.search-strip-icon:focus-visible {
  color: var(--gold-300);
  opacity: 1;
  background: rgba(244, 180, 0, 0.12);
  outline: none;
}

.search-strip-field:focus-within .search-strip-icon {
  color: var(--gold-300);
  opacity: 1;
}

.search-strip-field input[type="search"]::placeholder {
  color: var(--gold-400);
  opacity: 1;
}

.search-strip-field input[type="search"]::-webkit-input-placeholder {
  color: var(--gold-400);
  opacity: 1;
}

.search-strip-field input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  color: var(--text);
}

.search-result-notice {
  margin-bottom: var(--space-2);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: rgba(244, 180, 0, 0.08);
  border: 1px solid rgba(244, 180, 0, 0.22);
  color: var(--gold-400);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
}

.search-strip select {
  padding: 8px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 180, 0, 0.25);
  background: var(--surface);
  color: var(--gold-400);
  max-width: 160px;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.search-strip select:hover {
  border-color: rgba(244, 180, 0, 0.45);
}

.search-strip select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  color: var(--gold-300);
}

.search-strip select option {
  color: var(--text);
  background: var(--surface-elevated);
  font-weight: 500;
}

@media (max-width: 640px) {
  .search-strip-inner {
    max-width: 100%;
  }
  .search-strip-field input[type="search"] {
    max-width: none;
  }
  .search-strip select {
    max-width: 120px;
  }
}

/* Auth dropdown — dark theme */
.auth-dropdown-toggle {
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-dropdown-toggle:hover,
.auth-dropdown.open .auth-dropdown-toggle {
  background: var(--surface-elevated);
  border-color: var(--accent);
  color: var(--accent);
}

.auth-dropdown-menu {
  background: var(--surface-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-dropdown-menu a {
  color: var(--text);
}

.auth-dropdown-menu a:hover {
  background: rgba(244, 180, 0, 0.1);
  color: var(--accent);
}

.nav-toggle {
  color: var(--text);
}

.nav-toggle:hover {
  background: var(--surface);
}

.nav-user-label {
  color: var(--text-muted);
}

/* Auth links — Register | Login */
.auth-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  padding: 6px 4px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.auth-link:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.auth-sep {
  color: var(--text-light);
  font-weight: 300;
  user-select: none;
}

/* Floating WhatsApp button */
.whatsapp-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(145deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: whatsappPulse 2.5s ease-in-out infinite;
}

.whatsapp-fab:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 10px 32px rgba(37, 211, 102, 0.55), 0 4px 12px rgba(0, 0, 0, 0.25);
  color: #fff;
}

.whatsapp-icon {
  width: 30px;
  height: 30px;
}

.whatsapp-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  white-space: nowrap;
  background: var(--surface-elevated);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}

.whatsapp-fab:hover .whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

@keyframes whatsappPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45), 0 0 0 10px rgba(37, 211, 102, 0); }
}

@media (max-width: 640px) {
  .whatsapp-fab {
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
  }
  .whatsapp-tooltip {
    display: none;
  }
  .auth-links {
    gap: 6px;
  }
  .auth-link {
    font-size: 0.8125rem;
  }
}

/* ============================================================
   Catalog book cards (Browse / Home grid)
   ============================================================ */

.catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.catalog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.catalog-card .catalog-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-2);
  gap: 6px;
}

.book-category-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--gold-100);
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 2px;
}

.catalog-meta .title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-price {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

.card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.catalog-meta .author {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin: 0;
}

.card-rating {
  margin: 2px 0 4px;
}

.catalog-meta .card-buy-btn {
  margin-top: auto;
}

.preview-overlay .preview-text {
  margin: 0;
}

/* ============================================================
   Payment page
   ============================================================ */

.payment-section {
  max-width: 720px;
}

.payment-layout {
  padding: var(--space-4);
  margin-top: var(--space-2);
}

.payment-book-preview {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: var(--space-3);
}

.payment-cover.book-cover {
  border-radius: var(--radius-sm);
}

.payment-book-info h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  color: var(--text);
  margin: 8px 0 4px;
}

.payment-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin: var(--space-1) 0;
}

.payment-note,
.payment-sub,
.payment-secure-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.payment-heading {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: var(--space-1);
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.payment-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-2);
  margin: var(--space-2) 0;
}

.payment-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--paper-50);
  border: 1px solid rgba(11, 31, 58, 0.1);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.payment-tile:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(244, 180, 0, 0.15);
  transform: translateY(-1px);
}

.payment-tile:disabled,
.payment-tile.is-busy {
  opacity: 0.55;
  cursor: not-allowed;
}

.payment-tile-logo {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid rgba(11, 31, 58, 0.08);
  overflow: hidden;
}

.payment-tile-logo svg {
  width: 36px;
  height: 36px;
  display: block;
}

.payment-tile-body {
  flex: 1;
  min-width: 0;
}

.payment-tile-label {
  display: block;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text);
}

.payment-tile-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.payment-tile-arrow {
  color: var(--text-light);
  font-size: 1.25rem;
  line-height: 1;
}

.payment-processing-panel,
.payment-failed-panel {
  text-align: center;
  padding: var(--space-4) var(--space-2);
}

.payment-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-2);
  border: 4px solid rgba(244, 180, 0, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.payment-processing-provider {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.payment-order-status {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.payment-failed-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-2);
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
  font-size: 1.75rem;
  line-height: 56px;
}

.payment-failed-panel .btn {
  margin-top: var(--space-2);
}

.paypal-live-container {
  margin-top: var(--space-2);
}

.paypal-live-container.hidden {
  display: none;
}

#payment-download-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.order-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
}

.badge-paid { background: rgba(52, 211, 153, 0.15); color: #059669; }
.badge-pending { background: rgba(244, 180, 0, 0.2); color: #b45309; }
.badge-failed { background: rgba(220, 38, 38, 0.12); color: var(--danger); }

.btn-mtn {
  background: #ffcc00;
  color: #1a1a1a;
  font-weight: 700;
}

.btn-mtn:hover {
  background: #e6b800;
}

.btn-airtel {
  background: #ed1c24;
  color: #fff;
  font-weight: 700;
}

.btn-airtel:hover {
  background: #c91820;
}

.payment-success-panel {
  text-align: center;
  padding: var(--space-3) 0;
}

.payment-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-2);
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
  font-size: 2rem;
  line-height: 64px;
}

.payment-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin: var(--space-3) 0;
}

.download-security-note {
  font-size: 0.75rem;
  color: var(--text-light);
}

.payment-owned {
  text-align: center;
  padding: var(--space-3);
}

/* ============================================================
   Footer — professional layout
   ============================================================ */

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-3) var(--space-3);
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
  max-width: 260px;
}

.footer-heading {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.footer-list {
  list-style: none;
  font-size: 0.875rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
}

.footer-list a {
  color: var(--gold-300);
}

.footer-address {
  font-size: 0.875rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
}

.footer-social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  transition: transform 0.2s ease, background 0.2s ease;
}

.social-icon svg {
  width: 18px;
  height: 18px;
}

.social-icon:hover {
  transform: translateY(-2px);
  color: var(--accent);
  background: rgba(244, 180, 0, 0.15);
}

.social-whatsapp:hover { color: #25d366; }

.footer-bottom p {
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.6);
  padding: var(--space-2) 0 var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .payment-book-preview {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .payment-book-preview .book-category-tag {
    align-self: center;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}


/* ── Super-admin panel inputs (.input class) ── */
.input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9375rem;
  background: var(--paper-100);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  color: #f8fafc;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input::placeholder {
  color: rgba(248, 250, 252, 0.5);
}
.input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(244, 180, 0, 0.2);
}
