/* =========================================================
   New Book Store — Premium Bookstore Stylesheet
   Custom CSS that complements Tailwind utility classes
   ========================================================= */

:root {
  --brand-50:  #faf6f1;
  --brand-100: #f0e5d8;
  --brand-200: #e0c9b0;
  --brand-300: #c9a47e;
  --brand-400: #a87a4f;
  --brand-500: #7c5a3f;
  --brand-600: #6b4f37;
  --brand-700: #57402c;
  --brand-800: #3d2c1f;
  --brand-900: #241811;
  --accent-500: #b8343f;
  --accent-600: #9b2a33;
  --accent-700: #7a2128;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--brand-50);
  color: var(--brand-900);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  letter-spacing: -0.01em;
  margin: 0;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--brand-100); }
::-webkit-scrollbar-thumb { background: var(--brand-400); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-500); }

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--brand-500), var(--accent-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Premium book shadow */
.book-shadow {
  box-shadow:
    0 1px 1px rgba(0,0,0,0.08),
    0 4px 8px rgba(0,0,0,0.08),
    0 12px 24px rgba(0,0,0,0.12);
}

.book-shadow-hover {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.book-shadow-hover:hover {
  box-shadow:
    0 4px 8px rgba(0,0,0,0.12),
    0 16px 32px rgba(0,0,0,0.18),
    0 24px 48px rgba(0,0,0,0.18);
  transform: translateY(-4px);
}

/* Float animation */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.float-animation { animation: float 4s ease-in-out infinite; }

/* Fade in up */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.5s ease-out forwards; }

/* Line clamp */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Book card 3D hover */
.book-card-3d { perspective: 1000px; }
.book-card-3d-inner { transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }

/* Buttons */
.btn-primary {
  background-color: var(--brand-500);
  color: white;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-primary:hover {
  background-color: var(--brand-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 90, 63, 0.25);
}

.btn-outline {
  background-color: white;
  color: var(--brand-800);
  border: 1px solid var(--brand-200);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-outline:hover {
  background-color: var(--brand-50);
  border-color: var(--brand-400);
}

.btn-ghost {
  background-color: transparent;
  color: var(--brand-600);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.btn-ghost:hover { background-color: var(--brand-100); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
.badge-discount { background-color: var(--accent-500); color: white; }
.badge-bestseller { background-color: #f59e0b; color: white; }
.badge-new { background-color: #059669; color: white; }

/* Toast */
.toast {
  background-color: white;
  border: 1px solid var(--brand-200);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 280px;
  max-width: 360px;
  pointer-events: auto;
  animation: fadeInUp 0.25s ease-out;
}

/* Card */
.card {
  background-color: white;
  border: 1px solid var(--brand-100);
  border-radius: 1rem;
  overflow: hidden;
}

/* Inputs */
.input {
  background-color: white;
  border: 1px solid var(--brand-200);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--brand-900);
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(124, 90, 63, 0.15);
}

/* Hidden state */
.hidden { display: none !important; }

/* Container utility (in case Tailwind CDN misses) */
.container-mw {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: 1280px;
}

/* Mobile menu off-canvas */
.mobile-menu {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: 85%;
  max-width: 360px;
  background: white;
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0,0,0,0.2);
}
.mobile-menu.open { transform: translateX(0); }

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 55;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.backdrop.open { opacity: 1; }

/* Quantity selector */
.qty-btn {
  width: 40px;
  height: 40px;
  background: white;
  border: 1px solid var(--brand-200);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.qty-btn:hover { background: var(--brand-50); }

/* Star rating */
.star {
  width: 16px;
  height: 16px;
  color: #d1d5db;
  fill: currentColor;
}
.star.filled { color: #f59e0b; }

/* Sticky header shadow on scroll */
.header-shadow {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  background: rgba(250, 246, 241, 0.95);
  backdrop-filter: blur(8px);
}

/* Smooth transitions for nav links */
.nav-link {
  position: relative;
  padding: 0.5rem 1rem;
  color: rgba(36, 24, 17, 0.7);
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.2s;
  cursor: pointer;
  background: none;
  border: none;
}
.nav-link:hover { color: var(--brand-600); }
.nav-link.active { color: var(--brand-600); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--brand-500);
  border-radius: 1px;
}

/* Tabs */
.tab {
  padding: 0.75rem 1rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  cursor: pointer;
  transition: all 0.2s;
}
.tab.active {
  color: var(--brand-600);
  border-bottom-color: var(--brand-500);
}
.tab:hover { color: var(--brand-800); }

/* Loading skeleton */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--brand-100), var(--brand-50), var(--brand-100));
  background-size: 1000px 100%;
  animation: shimmer 1.5s infinite;
}

/* Hide scrollbar on horizontal sliders */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* Print-friendly */
@media print {
  #header, #footer, #toasts { display: none !important; }
}
