/* MS Library (ایم ایس لائبریری) - CSS Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* Color Variables and Themes */
:root {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

/* 1. Modern Light (Clean modern theme, royal slate/gold details) */
:root, [data-theme="modern-light"] {
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F1F5F9;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --accent-gold: #D97706; /* Amber gold */
  --accent-gold-hover: #B45309;
  --accent-brown: #334155; /* Slate */
  --border-color: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(226, 232, 240, 0.8);
}

/* 2. Emerald Forest (Luxurious gold & forest green details) */
[data-theme="emerald-luxury"] {
  --bg-primary: #F4F6F4;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #E6ECE6;
  --text-primary: #112F11;
  --text-secondary: #3D5A3D;
  --accent-gold: #C5A059; /* Luxury metallic gold */
  --accent-gold-hover: #9E7D3F;
  --accent-brown: #064E3B; /* Emerald Forest */
  --border-color: #D3DDD3;
  --shadow-sm: 0 1px 3px rgba(6, 78, 59, 0.05);
  --shadow-md: 0 4px 12px rgba(6, 78, 59, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(6, 78, 59, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(211, 221, 211, 0.7);
}

/* 3. Midnight Dark (Sleek slate dark theme with purple/indigo accents) */
[data-theme="midnight-dark"] {
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-tertiary: #334155;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --accent-gold: #A78BFA; /* Lavender Purple */
  --accent-gold-hover: #C4B5FD;
  --accent-brown: #818CF8; /* Indigo */
  --border-color: #334155;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --glass-bg: rgba(30, 41, 59, 0.85);
  --glass-border: rgba(51, 65, 85, 0.5);
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-gold) var(--bg-tertiary);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, .brand-font {
  font-family: var(--font-serif);
  font-weight: 700;
}

button, input, textarea, select {
  font-family: inherit;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-gold);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold-hover);
}

/* Utility Classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.text-center { text-align: center; }
.flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* Elegant Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  gap: 8px;
}

.btn-primary {
  background-color: var(--accent-gold);
  color: #1A1A1A;
}
.btn-primary:hover {
  background-color: var(--accent-gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(197, 160, 89, 0.3);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-danger {
  background-color: #E25C5C;
  color: #FFF;
}
.btn-danger:hover {
  background-color: #C24343;
}

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition-smooth);
}

.nav-wrapper {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-brown) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FAF7F2;
  font-family: var(--font-serif);
  font-weight: bold;
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--bg-primary);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-brand {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.logo-sub {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-gold);
  margin-top: -2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  position: relative;
}
.icon-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--accent-gold);
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--accent-gold);
  color: #1A1A1A;
  font-size: 0.75rem;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* Elegant Hero Banner */
.hero {
  padding: 80px 0 60px 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--glass-bg), var(--bg-primary)), url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?q=80&w=1200') center/cover no-repeat;
}

.hero-content {
  max-width: 650px;
  margin: 0 auto;
}

.hero-subtitle {
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

/* Instant Search & Autocomplete */
.search-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto 40px auto;
  z-index: 10;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon-inside {
  position: absolute;
  left: 16px;
  color: var(--text-secondary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}
.search-input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 4px rgba(197, 160, 89, 0.15);
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 50;
  animation: fadeIn 0.2s ease-out;
}

.autocomplete-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border-bottom: 1px solid var(--bg-tertiary);
}
.autocomplete-item:last-child {
  border-bottom: none;
}
.autocomplete-item:hover {
  background-color: var(--bg-tertiary);
}

.autocomplete-cover {
  width: 32px;
  height: 44px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  color: #FFF;
  font-weight: bold;
}

.autocomplete-details {
  display: flex;
  flex-direction: column;
}

.autocomplete-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.autocomplete-author {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Category Filter Tabs */
.tabs-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 16px 24px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  position: relative;
  transition: var(--transition-smooth);
}
.tab-btn:hover {
  color: var(--accent-gold);
}
.tab-btn.active {
  color: var(--accent-gold);
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--accent-gold);
  border-radius: 2px 2px 0 0;
}

/* Premium Tactile Book Cards */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
  margin-bottom: 80px;
}

.book-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.book-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-gold);
}

/* 3D-Like Physical Book Cover */
.book-cover-container {
  width: 100%;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  perspective: 1000px;
}

.book-cover {
  width: 160px;
  height: 220px;
  border-radius: 4px 12px 12px 4px;
  position: relative;
  box-shadow: 10px 10px 20px rgba(0,0,0,0.3);
  transform: rotateY(-15deg);
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
  display: flex;
  flex-direction: column;
  padding: 20px;
  color: #FFF;
  justify-content: space-between;
  overflow: hidden;
}
.book-card:hover .book-cover {
  transform: rotateY(-5deg) scale(1.05);
  box-shadow: 12px 12px 24px rgba(0,0,0,0.4);
}

.book-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  z-index: 5;
}

.book-cover-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 20px;
}

.book-cover-author {
  font-size: 0.8rem;
  opacity: 0.8;
  letter-spacing: 1px;
}

.book-category-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: rgba(0, 0, 0, 0.4);
  color: #FFF;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.book-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.book-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.book-author-link {
  font-size: 0.9rem;
  color: var(--accent-gold);
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 12px;
  display: inline-block;
}
.book-author-link:hover {
  text-decoration: underline;
}

.book-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.stars {
  color: var(--accent-gold);
  display: flex;
}

.reviews-count {
  color: var(--text-secondary);
}

.book-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.book-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.add-cart-btn {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.add-cart-btn:hover {
  background-color: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #1A1A1A;
}

/* Modal Overlay & Details Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: slideUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 10;
  transition: var(--transition-smooth);
}
.close-modal:hover {
  background-color: var(--border-color);
  transform: rotate(90deg);
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 40px;
}

@media (min-width: 768px) {
  .modal-grid {
    grid-template-columns: 320px 1fr;
  }
}

.modal-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-book-cover {
  width: 200px;
  height: 280px;
  border-radius: 4px 16px 16px 4px;
  box-shadow: 15px 15px 30px rgba(0, 0, 0, 0.4);
  margin-bottom: 24px;
}

.modal-right {
  display: flex;
  flex-direction: column;
}

.modal-book-title {
  font-size: 2.2rem;
  line-height: 1.2;
  margin-bottom: 8px;
}

.modal-author-link {
  font-size: 1.1rem;
  color: var(--accent-gold);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  align-self: flex-start;
  text-decoration: none;
}
.modal-author-link:hover {
  text-decoration: underline;
}

.modal-category {
  display: inline-block;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  align-self: flex-start;
  margin-bottom: 24px;
}

.modal-desc-heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 30px;
}

.modal-purchase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  margin-top: auto;
}

.modal-price {
  font-size: 1.8rem;
  font-weight: 700;
}

/* Author Profile Component inside Modal */
.author-profile-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.author-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.author-image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-gold);
}

.author-name {
  font-size: 1.8rem;
  font-weight: 700;
}

.author-bio {
  color: var(--text-secondary);
  font-size: 0.95rem;
  border-left: 3px solid var(--accent-gold);
  padding-left: 16px;
  margin-bottom: 16px;
}

.author-other-books-title {
  font-size: 1.25rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.author-books-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

.mini-book-card {
  cursor: pointer;
  text-align: center;
  transition: var(--transition-smooth);
}
.mini-book-card:hover {
  transform: translateY(-4px);
}

.mini-cover {
  width: 90px;
  height: 125px;
  border-radius: 4px 8px 8px 4px;
  margin: 0 auto 8px auto;
  box-shadow: 4px 4px 10px rgba(0,0,0,0.2);
}

.mini-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Slide-out Shopping Cart Drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background-color: var(--bg-secondary);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
  border-left: 1px solid var(--border-color);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.cart-drawer.open {
  right: 0;
}

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

.cart-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.close-cart {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: var(--transition-smooth);
}
.close-cart:hover {
  background-color: var(--bg-tertiary);
}

.cart-items-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cart-empty {
  text-align: center;
  color: var(--text-secondary);
  margin-top: 80px;
}

.cart-item {
  display: flex;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--bg-tertiary);
  padding-bottom: 16px;
}
.cart-item:last-child {
  border-bottom: none;
}

.cart-item-cover {
  width: 50px;
  height: 70px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 0.5rem;
  font-weight: bold;
}

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

.cart-item-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-item-price {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.quantity-btn {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-primary);
}
.quantity-btn:hover {
  background-color: var(--border-color);
}

.quantity-num {
  font-size: 0.9rem;
  font-weight: 600;
  width: 20px;
  text-align: center;
}

.remove-item-btn {
  background: none;
  border: none;
  color: #E25C5C;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 12px;
}
.remove-item-btn:hover {
  text-decoration: underline;
}

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

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Checkout View */
.checkout-view {
  padding: 40px 0;
  display: none;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

@media (min-width: 992px) {
  .checkout-grid {
    grid-template-columns: 1.6fr 1fr;
  }
}

.checkout-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.checkout-heading {
  font-size: 1.6rem;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}
.form-input:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.payment-method-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.payment-option {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 12px;
}
.payment-option.active {
  border-color: var(--accent-gold);
  background-color: rgba(197, 160, 89, 0.05);
}

.payment-option-title {
  font-weight: 600;
}

.payment-option-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Order Success Ticket */
.ticket-container {
  display: flex;
  justify-content: center;
  padding: 40px 0;
  display: none;
}

.ticket {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.ticket-header {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-brown) 100%);
  color: #FAF7F2;
  padding: 30px;
  text-align: center;
}

.ticket-header h3 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.ticket-body {
  padding: 30px;
}

.ticket-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border-color);
  padding: 12px 0;
  font-size: 0.95rem;
}
.ticket-row:last-child {
  border-bottom: none;
}

.ticket-label {
  color: var(--text-secondary);
}

.ticket-value {
  font-weight: 600;
}

.ticket-total {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  border-top: 2px solid var(--accent-gold);
  padding-top: 16px;
  margin-top: 8px;
}

/* Editable Admin Dashboard Panel */
.admin-view {
  padding: 40px 0;
  display: none;
}

.admin-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
}

@media (max-width: 768px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-sidebar {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 16px;
  height: fit-content;
}

.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-smooth);
  margin-bottom: 8px;
}
.admin-menu-item:hover, .admin-menu-item.active {
  background-color: var(--bg-tertiary);
  color: var(--accent-gold);
}

.admin-main {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.admin-tab-content {
  display: none;
}
.admin-tab-content.active {
  display: block;
}

/* CRUD Admin Forms and Lists */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.admin-table th, .admin-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  font-weight: 600;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
}

.admin-table tr:hover td {
  background-color: rgba(92, 69, 51, 0.02);
}

.book-row-cover {
  width: 36px;
  height: 50px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 0.5rem;
  font-weight: bold;
}

.action-row {
  display: flex;
  gap: 8px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-warning {
  background-color: rgba(197, 160, 89, 0.15);
  color: var(--accent-gold);
}

.badge-success {
  background-color: rgba(56, 239, 125, 0.15);
  color: #2ea44f;
}

/* Footer Section */
footer {
  background-color: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
  padding: 48px 0;
  margin-top: 80px;
  color: var(--text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-bottom: 40px;
}

.footer-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
}
.footer-links a:hover {
  color: var(--accent-gold);
}

.footer-owner-section {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 2px solid var(--accent-gold);
  padding-left: 16px;
}

.owner-name {
  font-weight: 700;
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
}

/* Keyframe Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Responsive Utilities */
@media (max-width: 576px) {
  .hero h1 { font-size: 2.2rem; }
  .tabs-wrapper { overflow-x: auto; justify-content: flex-start; }
  .tab-btn { padding: 12px 16px; font-size: 0.95rem; }
  .modal-grid { padding: 24px; }
  .modal-book-title { font-size: 1.6rem; }

  /* 2-column mobile responsive books catalog grid */
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 40px;
  }
  
  .book-card {
    padding: 12px;
    border-radius: var(--radius-sm);
  }
  
  .book-cover-container {
    height: 170px;
    margin-bottom: 12px;
  }
  
  .book-cover {
    width: 110px;
    height: 150px;
    padding: 10px;
    box-shadow: 5px 5px 12px rgba(0,0,0,0.25);
    border-radius: 3px 8px 8px 3px;
  }
  
  .book-cover-title {
    font-size: 0.85rem;
    margin-top: 10px;
  }
  
  .book-cover-author {
    font-size: 0.65rem;
  }
  
  .book-title {
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 2px;
  }
  
  .book-author-link {
    font-size: 0.75rem;
    margin-bottom: 8px;
  }
  
  .book-meta {
    gap: 4px;
    margin-bottom: 12px;
  }
  
  .stars {
    font-size: 0.65rem;
  }
  
  .reviews-count {
    font-size: 0.65rem;
  }
  
  .book-price-row {
    padding-top: 10px;
  }
  
  .book-price {
    font-size: 0.95rem;
  }
  
  .add-cart-btn {
    padding: 6px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
  }
}

/* Premium Floating WhatsApp Button */
.whatsapp-float-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #25D366;
  color: #FFF !important;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 999;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.whatsapp-float-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  animation: whatsapp-pulse 2s infinite;
}

.whatsapp-float-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
}

.whatsapp-tooltip {
  position: absolute;
  right: 80px;
  background-color: #1A1A1A;
  color: #FAF7F2;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-md);
}

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

@keyframes whatsapp-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* Theme Dropdown Selector Styles */
.theme-selector-wrapper {
  position: relative;
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 1000;
  min-width: 160px;
  animation: fadeIn 0.2s ease-out;
}

.theme-dropdown.show {
  display: flex;
}

.theme-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  color: var(--text-primary);
  text-align: left;
}

.theme-dropdown-item:hover {
  background-color: var(--bg-tertiary);
}

.theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

/* Custom premium styling for Store Settings Inputs */
#admin-settings-form input[type="file"] {
  padding: 8px 12px;
  background-color: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
  cursor: pointer;
}

#admin-settings-form input[type="file"]::-webkit-file-upload-button {
  background-color: var(--accent-gold);
  border: none;
  border-radius: var(--radius-sm);
  color: #1A1A1A;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
  transition: var(--transition-smooth);
}

#admin-settings-form input[type="file"]::-webkit-file-upload-button:hover {
  background-color: var(--accent-gold-hover);
}

#admin-settings-form input[type="checkbox"] {
  accent-color: var(--accent-gold);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

#settings-logo-preview-container img {
  transition: transform 0.3s ease;
}

#settings-logo-preview-container:hover img {
  transform: scale(1.1);
}


