:root {
  /* Colors */
  --color-primary: #0E1B2E;
  --color-primary-light: #13233B;
  --color-accent-mint: #1FBF8F;
  --color-accent-gold: #E3B23C;
  --color-bg-light: #F7F8FA;
  --color-bg-white: #FFFFFF;
  --color-text-main: #2A3B52;
  --color-text-muted: #64748B;
  --color-border: #E2E8F0;

  /* Typography */
  --font-main: "Inter", system-ui, -apple-system, sans-serif;
  
  /* Shadows & Radii */
  --shadow-sm: 0 4px 6px -1px rgba(14, 27, 46, 0.05), 0 2px 4px -2px rgba(14, 27, 46, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(14, 27, 46, 0.08), 0 4px 6px -4px rgba(14, 27, 46, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(14, 27, 46, 0.1), 0 8px 10px -6px rgba(14, 27, 46, 0.05);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 200ms ease;
  --transition-normal: 300ms ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-main);
  background-color: var(--color-bg-light);
  color: var(--color-text-main);
  line-height: 1.6;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button, input, textarea {
  font-family: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-primary);
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 0.5em;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

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

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-light {
  background-color: var(--color-bg-white);
}

.section-dark {
  background-color: var(--color-primary);
  color: var(--color-bg-white);
}

.section-dark h2, .section-dark h3 {
  color: var(--color-bg-white);
}

.section-dark .text-muted {
  color: #94A3B8;
}

.grid {
  display: grid;
  gap: 2rem;
}

.grid-cols-2 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(1, 1fr); }

@media (min-width: 768px) {
  .grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Buttons & CTA */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: all var(--transition-fast);
  text-align: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--color-accent-mint);
  color: var(--color-primary);
}

.btn-primary:hover {
  background-color: #1AA87D;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--color-accent-gold);
  color: var(--color-primary);
}

.btn-secondary:hover {
  background-color: #CFA135;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}

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

.btn-outline-light {
  border: 2px solid var(--color-bg-white);
  color: var(--color-bg-white);
}

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

.btn-block {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-bg-white);
  color: var(--color-text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent-mint);
  box-shadow: 0 0 0 3px rgba(31, 191, 143, 0.2);
}

/* Header & Navigation */
.header {
  background-color: var(--color-bg-white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  height: 80px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--color-accent-mint);
}

.nav-links {
  display: none;
  gap: 2rem;
  font-weight: 500;
}

@media (min-width: 1024px) {
  .nav-links {
    display: flex;
    gap: 1.25rem;
  }
}

@media (min-width: 1280px) {
  .nav-links {
    gap: 2rem;
  }
}

.nav-link {
  color: var(--color-text-main);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--color-accent-mint);
  transition: width var(--transition-fast);
}

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

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.search-bar {
  display: none;
  position: relative;
}

@media (min-width: 768px) {
  .search-bar { display: block; }
}

.search-input {
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  width: 250px;
  background-color: var(--color-bg-light);
  transition: all var(--transition-fast);
}

.search-input:focus {
  width: 300px;
  outline: none;
  border-color: var(--color-accent-mint);
  background-color: var(--color-bg-white);
}

.search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  width: 18px;
  height: 18px;
}

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--color-primary);
  transition: color var(--transition-fast);
}

.cart-btn:hover {
  color: var(--color-accent-mint);
}

.cart-icon {
  width: 24px;
  height: 24px;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--color-accent-gold);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.mobile-menu-btn {
  display: block;
  color: var(--color-primary);
}

@media (min-width: 1024px) {
  .mobile-menu-btn { display: none; }
}

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  top: 80px;
  left: 0;
  width: 100%;
  height: calc(100vh - 80px);
  background-color: var(--color-bg-white);
  z-index: 90;
  padding: 2rem;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  overflow-y: auto;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu .nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 1.25rem;
}

/* Cart Drawer */
.cart-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(14, 27, 46, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.cart-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background-color: var(--color-bg-white);
  z-index: 1001;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transition: right var(--transition-normal);
}

.cart-drawer.open {
  right: 0;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.close-cart {
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.close-cart:hover {
  color: var(--color-primary);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.cart-item-img {
  width: 80px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.cart-item-price {
  font-weight: 700;
  color: var(--color-accent-mint);
}

.cart-item-remove {
  color: #EF4444;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-bg-light);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

/* Cards */
.card {
  background-color: var(--color-bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.card-img-wrapper {
  position: relative;
  padding-top: 100%; /* Square for general cards, can override */
  overflow: hidden;
}

.card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Book Card Specific */
.book-card .card-img-wrapper {
  padding-top: 140%; /* Book aspect ratio */
  background-color: #E2E8F0;
}

.book-card .card-body {
  text-align: center;
}

.book-author {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.book-title {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  flex: 1;
}

.book-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

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

/* Footer */
.footer {
  background-color: var(--color-primary-light);
  color: var(--color-bg-white);
  padding: 4rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.footer-heading {
  color: var(--color-bg-white);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.footer-text {
  color: #94A3B8;
  margin-bottom: 1.5rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  color: #94A3B8;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--color-accent-mint);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  color: #94A3B8;
  transition: color var(--transition-fast);
  display: block;
}

.social-link:hover {
  color: var(--color-bg-white);
}

.payment-icons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.payment-icons svg, 
.payment-icons img {
  height: 25px;
  fill: #94A3B8;
  filter: brightness(0) invert(1);
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.payment-icons svg:hover, 
.payment-icons img:hover {
  opacity: 1;
}
.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: #94A3B8;
  font-size: 0.875rem;
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  background-color: var(--color-bg-white);
  padding: 4rem 0;
}

@media (min-width: 1024px) {
  .hero {
    padding: 6rem 0;
  }
}

.hero-content {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-text h1 {
  margin-bottom: 1.5rem;
}

.hero-text p {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  max-width: 540px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-img-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* Testimonials */
.testimonial-card {
  padding: 2.5rem;
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-direction: column; /* Default for mobile */
}

@media (min-width: 768px) {
  .testimonial-card {
    flex-direction: row;
    justify-content: space-between;
  }
}

.testimonial-text {
  font-size: 1.125rem;
  line-height: 1.6;
  color: #1F2937;
  font-weight: 500;
  flex: 1;
  margin: 0;
}

@media (min-width: 768px) {
  .testimonial-text {
    font-size: 1.25rem;
  }
}

.testimonial-author-block {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .testimonial-author-block {
    min-width: 250px;
  }
}

.testimonial-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.testimonial-info h4 {
  margin-bottom: 0.25rem;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--color-primary);
}

.testimonial-info p {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* Alerts / Toasts */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background-color: var(--color-primary);
  color: var(--color-bg-white);
  padding: 1rem 2rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  font-weight: 500;
  animation: slideUpFade 0.3s ease forwards;
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* AI Chat Widget */
.ai-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

.ai-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--color-accent-mint);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform var(--transition-fast);
  border: none;
  padding: 0;
  outline: none;
}

.ai-toggle:hover {
  transform: scale(1.05);
}

.ai-toggle svg {
  width: 32px;
  height: 32px;
}

.ai-chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  max-height: calc(100vh - 120px);
  background-color: var(--color-bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  transition: all var(--transition-normal);
}

.ai-chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

@media (max-width: 480px) {
  .ai-chat-window {
    width: calc(100vw - 2rem);
    right: -1rem;
  }
}

.ai-header {
  background-color: var(--color-primary);
  color: var(--color-bg-white);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-header h3 {
  color: var(--color-bg-white);
  font-size: 1.125rem;
  margin: 0;
}

.ai-close {
  color: var(--color-bg-white);
  opacity: 0.8;
}

.ai-close:hover {
  opacity: 1;
}

.ai-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: var(--color-bg-light);
}

.ai-msg {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.ai-msg.bot {
  background-color: var(--color-bg-white);
  color: var(--color-text-main);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.ai-msg.user {
  background-color: var(--color-accent-mint);
  color: var(--color-primary);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-input-area {
  padding: 1rem;
  background-color: var(--color-bg-white);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 0.5rem;
}

.ai-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  outline: none;
}

.ai-input:focus {
  border-color: var(--color-accent-mint);
}

.ai-send {
  background-color: var(--color-primary);
  color: var(--color-bg-white);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.typing-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 0.5rem 1rem;
  background: var(--color-bg-white);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
}

.typing-indicator.active {
  display: flex;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-primary);
  color: var(--color-bg-white);
  padding: 1.5rem;
  z-index: 2000;
  transform: translateY(100%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cookie-banner.show {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .cookie-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cookie-text {
  font-size: 0.875rem;
  color: #94A3B8;
}

.cookie-text a {
  color: var(--color-accent-mint);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Animations & Microinteractions */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }

/* Filter Buttons (Shop) */
.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-bg-light);
  color: var(--color-text-muted);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background-color: var(--color-primary);
  color: var(--color-bg-white);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--color-bg-light);
  color: var(--color-text-main);
  margin-bottom: 1rem;
}

.badge-mint {
  background-color: rgba(31, 191, 143, 0.1);
  color: #14805F;
}
