/* ===== KLATA — CHARTE GRAPHIQUE ===== */
:root {
  --k-primary:        #5B4FCF;
  --k-primary-light:  #EEF0FD;
  --k-primary-dark:   #4840A8;
  --k-bg:             #F7F7F7;
  --k-card:           #FFFFFF;
  --k-text:           #1A1A2E;
  --k-text-muted:     #8C8C8C;
  --k-star:           #FFC107;
  --k-success:        #4CAF50;
  --k-danger:         #E53935;
  --k-border:         #E8E8E8;
  --k-on-progress:    #4A90E2;
  --k-completed:      #27AE60;

  --radius:        16px;
  --radius-card:   20px;
  --radius-btn:    14px;
  --btn-height:    52px;
  --pad-x:         20px;
  --shadow-card:   0 4px 20px rgba(0,0,0,.07);
  --shadow-sm:     0 2px 8px rgba(0,0,0,.05);
  --anim:          .25s ease;

  --navbar-h:      68px;
  --footer-h:      64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
svg { display: block; max-width: 100%; max-height: 100%; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--k-bg);
  color: var(--k-text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; cursor: pointer; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul { list-style: none; }
input, textarea, select { font: inherit; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--k-border); border-radius: 3px; }

/* ===== LAYOUT ===== */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--pad-x); }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--navbar-h);
  background: var(--k-card);
  border-bottom: 1px solid var(--k-border);
  box-shadow: var(--shadow-sm);
}
.navbar-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.navbar-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 800;
  color: var(--k-primary);
}
.navbar-logo svg { width: 32px; height: 32px; }

/* Mobile search bar */
.mobile-search-bar {
  display: none;
  align-items: center;
  background: var(--k-card);
  border: 1.5px solid var(--k-border);
  border-radius: 12px;
  padding: 0 14px; height: 44px; gap: 10px;
  margin: 10px 16px 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: border-color var(--anim), box-shadow var(--anim);
}
.mobile-search-bar:focus-within {
  border-color: var(--k-primary);
  box-shadow: 0 0 0 3px rgba(91,79,207,.12);
}
.mobile-search-bar input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 14px; color: var(--k-text); font-family: inherit;
}
.mobile-search-bar input::placeholder { color: var(--k-text-muted); }
.mobile-search-bar svg { color: var(--k-text-muted); flex-shrink: 0; }

.navbar-search {
  flex: 1; max-width: 480px;
  display: flex; align-items: center;
  background: var(--k-bg);
  border: 1.5px solid var(--k-border);
  border-radius: var(--radius);
  padding: 0 14px; height: 44px; gap: 10px;
  transition: border-color var(--anim);
}
.navbar-search:focus-within { border-color: var(--k-primary); }
.navbar-search input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 14px; color: var(--k-text);
}
.navbar-search input::placeholder { color: var(--k-text-muted); }
.navbar-search svg { color: var(--k-text-muted); flex-shrink: 0; }

.navbar-actions { display: flex; align-items: center; gap: 6px; }

.nav-btn {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  color: var(--k-text);
  transition: background var(--anim), color var(--anim);
  position: relative;
}
.nav-btn:hover { background: var(--k-bg); }
.nav-btn svg { width: 22px; height: 22px; flex-shrink: 0; }

.cart-badge {
  position: absolute; top: 6px; right: 6px;
  width: 16px; height: 16px;
  background: var(--k-primary);
  color: white; font-size: 10px; font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cart-badge.hidden { display: none; }

.btn-login {
  padding: 0 18px; height: 40px;
  background: var(--k-primary);
  color: white; font-size: 14px; font-weight: 600;
  border-radius: var(--radius-btn);
  transition: background var(--anim);
}
.btn-login:hover { background: var(--k-primary-dark); }

/* ===== MOBILE NAV ===== */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--footer-h);
  background: var(--k-card);
  border-top: 1px solid var(--k-border);
  z-index: 100;
  padding: 0 var(--pad-x);
}
.mobile-nav-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-around;
}
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 12px; border-radius: 12px;
  color: var(--k-text-muted); font-size: 11px;
  transition: color var(--anim);
}
.mobile-nav-item svg { width: 22px; height: 22px; }
.mobile-nav-item.active { color: var(--k-primary); }
.mobile-nav-cart { position: relative; }

/* ===== PAGES ===== */
.page { display: none; padding-bottom: 40px; }
.page.active { display: block; }
main { min-height: calc(100vh - var(--navbar-h)); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-height);
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-size: 15px; font-weight: 600;
  transition: all var(--anim);
  white-space: nowrap;
  overflow: hidden;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--k-primary); color: white; }
.btn-primary:hover { background: var(--k-primary-dark); transform: translateY(-1px); }
.btn-outline {
  background: none;
  border: 1.5px solid var(--k-primary);
  color: var(--k-primary);
}
.btn-outline:hover { background: var(--k-primary-light); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 13px; border-radius: 10px; }
.btn-danger { background: var(--k-danger); color: white; }
.btn-success { background: var(--k-success); color: white; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title { font-size: 20px; font-weight: 700; color: var(--k-text); }
.section-link { font-size: 14px; font-weight: 600; color: var(--k-primary); cursor: pointer; }
.section-link:hover { opacity: .8; }

/* ===== CARDS ===== */
.book-card {
  background: var(--k-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--anim), box-shadow var(--anim);
  cursor: pointer;
}
.book-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(91,79,207,.15); }

.book-card-cover {
  width: 100%; aspect-ratio: 2/3;
  background: var(--k-primary-light);
  position: relative; overflow: hidden;
}
.book-card-cover img.cover-bg {
  position: absolute; inset: -8px;
  width: calc(100% + 16px); height: calc(100% + 16px);
  object-fit: cover;
  filter: blur(12px) brightness(.85);
  transform: scale(1.05);
  z-index: 0;
}
.book-card-cover img.cover-main {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  z-index: 1;
}
.book-card-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--k-primary-light), #ddd9f5);
}
.book-card-cover-placeholder svg { width: 40px; height: 40px; color: var(--k-primary); opacity: .5; }

.book-card-fav {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px;
  background: rgba(255,255,255,.9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  transition: transform var(--anim);
}
.book-card-fav:hover { transform: scale(1.1); }
.book-card-fav svg { width: 18px; height: 18px; color: var(--k-text-muted); }
.book-card-fav.active svg { color: var(--k-danger); fill: var(--k-danger); }

.book-card-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700;
  background: var(--k-primary); color: white;
}
.book-card-badge.new { background: var(--k-success); }

.book-card-body { padding: 14px; }
.book-card-title {
  font-size: 14px; font-weight: 700; color: var(--k-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 4px; line-height: 1.3; min-height: 2.6em;
}
.book-card-author { font-size: 12px; color: var(--k-text-muted); margin-bottom: 8px; min-height: 2.4em; line-height: 1.2em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-card-footer { display: flex; align-items: center; justify-content: space-between; }
.book-card-price { font-size: 15px; font-weight: 800; color: var(--k-primary); }
.book-card-rating {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--k-text-muted);
}
.book-card-rating svg { width: 13px; height: 13px; color: var(--k-star); fill: var(--k-star); }

/* ===== GRID ===== */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
}

/* ===== HORIZONTAL SCROLL ===== */
.scroll-row {
  display: flex; gap: 16px;
  overflow-x: auto;
  padding: 8px 4px 12px;
  scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row .book-card { flex: 0 0 160px; }

/* ===== BANNER CAROUSEL ===== */
.banner-wrap {
  position: relative; overflow: hidden;
  border-radius: var(--radius-card);
  height: 180px; background: var(--k-primary-light);
  margin-bottom: 8px;
}
.banner-slide {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  background: linear-gradient(135deg, var(--k-primary), #9B87F5);
  padding: 28px;
  opacity: 0; transition: opacity .5s ease;
}
.banner-slide.active { opacity: 1; }
.banner-slide img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.banner-text {
  position: relative; z-index: 1;
  flex: 1;
}
.banner-title { font-size: 20px; font-weight: 800; color: white; margin-bottom: 6px; }
.banner-subtitle { font-size: 13px; color: rgba(255,255,255,.8); }
.banner-icon {
  position: relative; z-index: 1;
  opacity: .2;
}
.banner-icon svg { width: 80px; height: 80px; color: white; }

.banner-dots {
  display: flex; gap: 6px; justify-content: center; margin-top: 10px;
}
.banner-dot {
  height: 6px; border-radius: 3px;
  background: var(--k-border);
  transition: all .3s ease;
  cursor: pointer;
}
.banner-dot.active { background: var(--k-primary); width: 20px; }
.banner-dot:not(.active) { width: 6px; }

/* ===== GENRE CHIPS ===== */
.genre-chips {
  display: flex; gap: 12px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.genre-chips::-webkit-scrollbar { display: none; }
.genre-chip {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  flex-shrink: 0; cursor: pointer;
}
.genre-chip-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--k-primary-light);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--anim), transform var(--anim);
}
.genre-chip:hover .genre-chip-icon { background: var(--k-primary); transform: scale(1.08); }
.genre-chip:hover .genre-chip-icon svg { color: white; }
.genre-chip-icon svg { width: 24px; height: 24px; color: var(--k-primary); flex-shrink: 0; }
.genre-chip-label { font-size: 11px; color: var(--k-text-muted); text-align: center; white-space: nowrap; }

/* ===== HOME HERO ===== */
.home-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 0 16px;
}
.home-greeting { font-size: 16px; font-weight: 700; }
.home-subtitle { font-size: 13px; color: var(--k-text-muted); }

/* ===== BOOK DETAIL ===== */
.book-detail-wrap {
  max-width: 900px; margin: 0 auto; padding: 32px var(--pad-x);
}
.book-detail-grid {
  display: grid; grid-template-columns: 280px 1fr; gap: 40px;
  align-items: start;
}
.book-detail-cover {
  width: 100%; border-radius: var(--radius-card);
  overflow: hidden; box-shadow: var(--shadow-card);
  aspect-ratio: 2/3; background: var(--k-primary-light);
}
.book-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-detail-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--k-primary-light), #ddd9f5);
}
.book-detail-cover-placeholder svg { width: 80px; height: 80px; color: var(--k-primary); opacity: .4; }

.book-detail-title { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.book-detail-author { font-size: 16px; color: var(--k-text-muted); margin-bottom: 16px; }
.book-detail-rating { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.book-detail-rating-stars { display: flex; gap: 2px; }
.book-detail-rating-stars svg { width: 18px; height: 18px; color: var(--k-star); fill: var(--k-star); }
.book-detail-rating-count { font-size: 14px; color: var(--k-text-muted); }

.book-detail-price { font-size: 30px; font-weight: 800; color: var(--k-primary); margin-bottom: 8px; }
.book-detail-stock { font-size: 13px; font-weight: 600; margin-bottom: 24px; }
.book-detail-stock.in { color: var(--k-success); }
.book-detail-stock.out { color: var(--k-danger); }

.format-selector { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.format-chip {
  padding: 8px 16px; border-radius: 10px;
  border: 1.5px solid var(--k-border);
  font-size: 13px; font-weight: 600; color: var(--k-text-muted);
  transition: all var(--anim); cursor: pointer;
}
.format-chip.active {
  border-color: var(--k-primary);
  background: var(--k-primary-light);
  color: var(--k-primary);
}

.qty-selector {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px;
}
.qty-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1.5px solid var(--k-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600;
  transition: all var(--anim);
}
.qty-btn:hover { border-color: var(--k-primary); color: var(--k-primary); }
.qty-value { font-size: 18px; font-weight: 700; min-width: 24px; text-align: center; }

.book-detail-actions { display: flex; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }
.book-detail-actions .btn { flex: 1; min-width: 160px; }

.book-meta-list { display: flex; flex-direction: column; gap: 12px; }
.book-meta-row { display: flex; gap: 8px; font-size: 14px; }
.book-meta-label { color: var(--k-text-muted); min-width: 100px; flex-shrink: 0; }
.book-meta-value { font-weight: 600; }

.book-description { font-size: 15px; line-height: 1.7; color: var(--k-text); margin-top: 28px; }
.book-description-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; }

/* Reviews */
.reviews-section { margin-top: 32px; }
.reviews-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.review-form { background: var(--k-surface); border-radius: 16px; padding: 16px; margin-bottom: 20px; }
.review-form-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.star-picker { display: flex; gap: 6px; margin-bottom: 12px; }
.star-pick { width: 32px; height: 32px; cursor: pointer; fill: var(--k-border); transition: fill .15s, transform .1s; }
.star-pick.active { fill: var(--k-star); }
.star-pick:hover { transform: scale(1.15); }
.review-login-hint { font-size: 14px; color: var(--k-text-muted); margin-bottom: 16px; }
.review-item { padding: 14px 0; border-bottom: 1px solid var(--k-border); }
.review-item:last-child { border-bottom: none; }
.review-item-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review-item-user { font-size: 14px; font-weight: 600; }
.review-item-stars { display: flex; gap: 2px; }
.review-item-stars svg { width: 14px; height: 14px; }
.review-item-comment { font-size: 14px; color: var(--k-text-muted); line-height: 1.5; margin: 0; }
.review-empty { font-size: 14px; color: var(--k-text-muted); }

/* ===== CART ===== */
.cart-wrap {
  max-width: 800px; margin: 0 auto; padding: 32px var(--pad-x);
}
.cart-title { font-size: 24px; font-weight: 800; margin-bottom: 24px; }
.cart-empty {
  text-align: center; padding: 80px 20px;
}
.cart-empty svg { width: 80px; height: 80px; color: var(--k-border); margin: 0 auto 16px; }
.cart-empty-text { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.cart-empty-sub { font-size: 14px; color: var(--k-text-muted); margin-bottom: 28px; }

.cart-items { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.cart-item {
  background: var(--k-card); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm);
  display: flex; gap: 16px; align-items: center;
}
.cart-item-cover {
  width: 72px; height: 96px; border-radius: 10px;
  overflow: hidden; flex-shrink: 0; background: var(--k-primary-light);
}
.cart-item-cover img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-cover-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--k-primary-light);
}
.cart-item-cover-ph svg { width: 28px; height: 28px; color: var(--k-primary); opacity: .5; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-author { font-size: 13px; color: var(--k-text-muted); margin-bottom: 8px; }
.cart-item-format { font-size: 12px; color: var(--k-primary); font-weight: 600; margin-bottom: 12px; }
.cart-item-bottom { display: flex; align-items: center; justify-content: space-between; }
.cart-item-price { font-size: 16px; font-weight: 800; color: var(--k-primary); }
.cart-item-qty-remove { display: flex; align-items: center; gap: 10px; }
.cart-item-qty {
  display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--k-border); border-radius: 10px; padding: 4px 10px;
}
.cart-item-qty button { font-size: 16px; color: var(--k-text-muted); width: 20px; text-align: center; }
.cart-item-qty span { font-size: 14px; font-weight: 700; min-width: 20px; text-align: center; }
.cart-item-remove { color: var(--k-danger); }
.cart-item-remove svg { width: 18px; height: 18px; }

.cart-summary {
  background: var(--k-card); border-radius: var(--radius-card);
  padding: 24px; box-shadow: var(--shadow-card);
}
.cart-summary-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.cart-summary-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 15px; }
.cart-summary-row.total { font-size: 18px; font-weight: 800; color: var(--k-primary); border-top: 1.5px solid var(--k-border); padding-top: 16px; margin-top: 4px; }

/* ===== CHECKOUT ===== */
.checkout-wrap {
  max-width: 600px; margin: 0 auto; padding: 32px var(--pad-x);
}
.checkout-title { font-size: 24px; font-weight: 800; margin-bottom: 24px; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--k-text); }
.form-input {
  width: 100%; height: 50px;
  border: 1.5px solid var(--k-border);
  border-radius: var(--radius);
  padding: 0 16px; font-size: 15px;
  background: var(--k-card);
  transition: border-color var(--anim);
  color: var(--k-text);
}
.form-input:focus { outline: none; border-color: var(--k-primary); }
.form-input::placeholder { color: var(--k-text-muted); }
.form-textarea {
  width: 100%; min-height: 100px;
  border: 1.5px solid var(--k-border); border-radius: var(--radius);
  padding: 14px 16px; font-size: 15px;
  background: var(--k-card); resize: vertical;
  transition: border-color var(--anim);
  color: var(--k-text);
}
.form-textarea:focus { outline: none; border-color: var(--k-primary); }

.checkout-section-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; margin-top: 28px; }

/* ===== AUTH ===== */
.auth-page {
  min-height: calc(100vh - var(--navbar-h));
  display: flex; align-items: center; justify-content: center;
  padding: 40px var(--pad-x);
}
.auth-card {
  background: var(--k-card); border-radius: var(--radius-card);
  padding: 40px; box-shadow: var(--shadow-card);
  width: 100%; max-width: 420px;
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 28px; }
.auth-logo-mark {
  width: 64px; height: 64px; border-radius: 20px;
  background: var(--k-primary);
  display: flex; align-items: center; justify-content: center;
}
.auth-logo-mark svg { width: 36px; height: 36px; color: white; }
.auth-title { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-subtitle { font-size: 14px; color: var(--k-text-muted); text-align: center; margin-bottom: 32px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--k-border); }
.auth-divider span { font-size: 13px; color: var(--k-text-muted); }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--k-text-muted); }
.auth-footer a { color: var(--k-primary); font-weight: 600; cursor: pointer; }
.auth-error {
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 10px; padding: 12px 16px;
  font-size: 14px; color: var(--k-danger); margin-bottom: 16px;
  display: none;
}
.auth-error.show { display: block; }

/* ===== ORDERS ===== */
.orders-wrap { max-width: 700px; margin: 0 auto; padding: 32px var(--pad-x); }
.orders-title { font-size: 24px; font-weight: 800; margin-bottom: 24px; }
.order-card {
  background: var(--k-card); border-radius: var(--radius-card);
  padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.order-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.order-id { font-size: 13px; color: var(--k-text-muted); }
.order-date { font-size: 13px; color: var(--k-text-muted); }
.order-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 700;
}
.order-status.pending { background: #FFF3E0; color: #E65100; }
.order-status.confirmed { background: #E3F2FD; color: var(--k-on-progress); }
.order-status.delivering { background: #EDE7F6; color: var(--k-primary); }
.order-status.delivered { background: #E8F5E9; color: var(--k-completed); }
.order-status.cancelled { background: #FFEBEE; color: var(--k-danger); }

.order-items-preview { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.order-item-thumb {
  width: 48px; height: 64px; border-radius: 8px;
  background: var(--k-primary-light); overflow: hidden;
}
.order-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-item-thumb-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.order-item-thumb-ph svg { width: 20px; height: 20px; color: var(--k-primary); opacity: .5; }

.order-book-titles { margin-bottom: 12px; }
.order-book-title { font-size: 13px; font-weight: 600; color: var(--k-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.6; }
.order-card-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--k-border); padding-top: 14px; }
.order-total { font-size: 16px; font-weight: 800; color: var(--k-primary); }

/* ===== PROFILE ===== */
.profile-wrap { max-width: 600px; margin: 0 auto; padding: 32px var(--pad-x); }
.profile-header {
  display: flex; align-items: center; gap: 20px;
  background: var(--k-card); border-radius: var(--radius-card);
  padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 24px;
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--k-primary-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-avatar svg { width: 36px; height: 36px; color: var(--k-primary); }
.profile-name { font-size: 20px; font-weight: 800; }
.profile-email { font-size: 14px; color: var(--k-text-muted); }

.profile-menu { display: flex; flex-direction: column; gap: 12px; }
.profile-menu-item {
  background: var(--k-card); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: transform var(--anim);
}
.profile-menu-item:hover { transform: translateX(4px); }
.profile-menu-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--k-primary-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-menu-icon svg { width: 22px; height: 22px; color: var(--k-primary); flex-shrink: 0; }
.profile-menu-label { font-size: 15px; font-weight: 600; }
.profile-menu-chevron { margin-left: auto; color: var(--k-text-muted); }
.profile-menu-chevron svg { width: 18px; height: 18px; }

/* ===== CATALOG PAGE ===== */
.catalog-wrap { padding: 24px var(--pad-x); }
.catalog-header { margin-bottom: 24px; }
.catalog-header h1 { font-size: 26px; font-weight: 800; margin-bottom: 16px; }

.filter-bar {
  display: flex; gap: 10px; overflow-x: auto;
  padding-bottom: 4px; scrollbar-width: none; margin-bottom: 24px;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-pill {
  padding: 8px 18px; border-radius: 20px;
  border: 1.5px solid var(--k-border);
  font-size: 13px; font-weight: 600; color: var(--k-text-muted);
  white-space: nowrap; cursor: pointer;
  transition: all var(--anim); flex-shrink: 0;
}
.filter-pill.active {
  background: var(--k-primary); border-color: var(--k-primary); color: white;
}
.filter-pill:hover:not(.active) { border-color: var(--k-primary); color: var(--k-primary); }

/* ===== TOAST ===== */
.toast-container {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--k-text); color: white;
  padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  display: flex; align-items: center; gap: 8px;
  animation: toastIn .3s ease;
  pointer-events: auto;
}
.toast.success { background: var(--k-success); }
.toast.error { background: var(--k-danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ===== FAVORITES ===== */
.favorites-wrap { padding: 32px var(--pad-x); max-width: 1200px; margin: 0 auto; }

/* ===== LOADER ===== */
.page-loader {
  display: flex; align-items: center; justify-content: center;
  padding: 80px 20px;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--k-primary-light);
  border-top-color: var(--k-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SKELETON ===== */
.skel {
  background: linear-gradient(90deg, var(--k-border) 25%, #f0f0f0 50%, var(--k-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-card { height: 240px; border-radius: var(--radius-card); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 80px 20px;
}
.empty-state svg { width: 80px; height: 80px; color: var(--k-border); margin: 0 auto 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { font-size: 14px; color: var(--k-text-muted); }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--k-text-muted);
  padding: 20px 0 0;
}
.breadcrumb a { color: var(--k-primary); }
.breadcrumb svg { width: 14px; height: 14px; }

/* ===== SEARCH ===== */
.search-results { padding: 24px var(--pad-x); }
.search-query-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.search-query-count { font-size: 14px; color: var(--k-text-muted); margin-bottom: 24px; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--k-text); color: rgba(255,255,255,.7);
  padding: 40px var(--pad-x) 24px;
  margin-top: 60px;
}
.site-footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 40px; max-width: 1200px; margin: 0 auto 32px;
}
.footer-brand-name { font-size: 22px; font-weight: 800; color: white; margin-bottom: 10px; }
.footer-brand-tagline { font-size: 14px; line-height: 1.6; }
.footer-col-title { font-size: 14px; font-weight: 700; color: white; margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 14px; transition: color var(--anim); }
.footer-links a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px; text-align: center; font-size: 13px;
  max-width: 1200px; margin: 0 auto;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 200; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity var(--anim);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--k-card); border-radius: var(--radius-card) var(--radius-card) 0 0;
  width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto;
  padding: 28px; transform: translateY(100%);
  transition: transform .3s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--k-border); margin: 0 auto 20px;
}
.modal-title { font-size: 20px; font-weight: 800; margin-bottom: 20px; }

/* ===== BACK BUTTON ===== */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--k-primary);
  margin-bottom: 20px; padding: 4px 0;
  cursor: pointer;
}
.back-btn svg { width: 18px; height: 18px; }

/* ===== SECTION ===== */
.section { margin-bottom: 36px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar-search { display: none; }
  .mobile-search-bar { display: flex; }
  .site-footer { display: none; }
  .mobile-nav { display: block; }
  main { padding-bottom: var(--footer-h); }

  .book-detail-grid {
    grid-template-columns: 1fr;
  }
  .book-detail-cover { max-width: 260px; margin: 0 auto; }
  .book-detail-wrap { padding: 20px var(--pad-x); }
  .site-footer-grid { grid-template-columns: 1fr; gap: 24px; }

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

  .catalog-wrap { padding: 16px var(--pad-x); }
}

@media (max-width: 480px) {
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cart-item { flex-direction: row; }
}

/* ===== NOTIFICATION DOT ===== */
.notif-dot {
  width: 8px; height: 8px;
  background: var(--k-danger); border-radius: 50%;
  position: absolute; top: 8px; right: 8px;
}

/* ===== QUANTITY BADGE ===== */
.qty-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; border-radius: 10px;
  background: var(--k-primary); color: white;
  font-size: 11px; font-weight: 700; padding: 0 5px;
}

/* ===== PAYMENT METHODS ===== */
.payment-methods { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.payment-method {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  border: 2px solid var(--k-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--anim);
  background: var(--k-card);
}
.payment-method:hover { border-color: var(--k-primary); }
.payment-method.active { border-color: var(--k-primary); background: var(--k-primary-light); }
.payment-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--k-border); flex-shrink: 0; transition: border-color var(--anim); }
.payment-method.active .payment-radio { border-color: var(--k-primary); border-width: 5px; }
.payment-method-label { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.payment-method-sub { font-size: 12px; color: var(--k-text-muted); }

/* ===== CHECKOUT SUCCESS ===== */
.order-success {
  text-align: center; padding: 80px 20px;
}
.order-success-icon {
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--k-primary-light);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.order-success-icon svg { width: 48px; height: 48px; color: var(--k-primary); }
.order-success h2 { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.order-success p { font-size: 15px; color: var(--k-text-muted); margin-bottom: 32px; }
