/* ====================================================
   Book Store – Customer Storefront
   Uses Bootstrap 4 as base. This file adds layout + design on top.
   ==================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f4f5f9;
  color: #1a1e2e;
  margin: 0;
  padding-top: 62px;
}

/* ── NAV ──────────────────────────────────────────────── */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; height: 62px;
  background: #1d2b4f;
  z-index: 900;
  box-shadow: 0 2px 16px rgba(0,0,0,.28);
}
.topnav-inner {
  max-width: 1240px; margin: 0 auto;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.topnav-brand {
  font-size: 18px; font-weight: 800; color: #fff;
  text-decoration: none; letter-spacing: -.02em; flex-shrink: 0;
}
.topnav-brand span { color: #7fb3f5; }
.topnav-brand:hover { color: #fff; text-decoration: none; }

.topnav-right { display: flex; align-items: center; gap: 4px; }

.topnav-link {
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,.65);
  padding: 7px 13px; border-radius: 8px;
  text-decoration: none; transition: all .15s;
  display: inline-flex; align-items: center;
}
.topnav-link:hover, .topnav-link.active {
  color: #fff; background: rgba(255,255,255,.12); text-decoration: none;
}

/* Cart */
.cart-wrap { position: relative; }
.cart-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); color: #fff;
  padding: 7px 13px; border-radius: 8px; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.cart-btn:hover { background: rgba(255,255,255,.2); }
.cart-count {
  background: #e74c3c; color: #fff;
  font-size: 10px; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-drop {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  width: 300px; background: #fff; border-radius: 12px;
  border: 1px solid #e8ecf5;
  box-shadow: 0 12px 36px rgba(0,0,0,.16);
  z-index: 1000; overflow: hidden;
}
.cart-drop.open { display: block; }
.cart-drop-head {
  padding: 12px 16px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: #9aa3b8;
  border-bottom: 1px solid #f0f2f9; background: #f8f9fd;
}
.cart-drop-foot { padding: 10px 14px; border-top: 1px solid #f0f2f9; background: #f8f9fd; }
.cart-drop-btn {
  display: block; background: #1d2b4f; color: #fff;
  border-radius: 9px; padding: 9px; text-align: center;
  font-size: 12px; font-weight: 700; text-decoration: none;
  transition: background .15s;
}
.cart-drop-btn:hover { background: #2c4070; color: #fff; text-decoration: none; }
.cart-drop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid #f8f9fd;
}
.cart-drop-img {
  width: 40px; height: 40px; border-radius: 6px;
  object-fit: cover; border: 1px solid #e8ecf5; flex-shrink: 0;
}
.cart-drop-title { font-size: 12px; font-weight: 700; color: #1d2b4f; }
.cart-drop-qty   { font-size: 11px; color: #9aa3b8; }

/* User */
.user-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; color: rgba(255,255,255,.75);
  font-size: 13px; font-weight: 500; cursor: pointer;
  padding: 6px 12px; border-radius: 8px; transition: all .15s;
}
.user-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.user-btn::after { display: none !important; }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #4a6fdc; color: #fff;
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.user-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-drop {
  border-radius: 12px !important; border: 1px solid #e8ecf5 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.12) !important;
  padding: 6px !important; min-width: 170px !important;
}
.user-drop-item { font-size: 13px !important; border-radius: 7px; padding: 8px 12px !important; }
.user-drop-item i { color: #9aa3b8; margin-right: 6px; }

/* Login btn */
.login-btn {
  background: rgba(255,255,255,.14); color: #fff;
  border: 1px solid rgba(255,255,255,.25); border-radius: 8px;
  padding: 7px 16px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.login-btn:hover { background: rgba(255,255,255,.24); }

/* ── PAGE BODY ─────────────────────────────────────────── */
.page-body { min-height: calc(100vh - 62px); }

/* ── HERO ──────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1d2b4f 0%, #2a3f74 55%, #3d5a9e 100%);
  padding: 60px 24px 52px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -45deg, transparent, transparent 40px,
    rgba(255,255,255,.015) 40px, rgba(255,255,255,.015) 80px
  );
}
.hero-content { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.hero h1 {
  font-size: 34px; font-weight: 800; color: #fff;
  margin: 0 0 10px; letter-spacing: -.03em; line-height: 1.18;
}
.hero h1 em { font-style: normal; color: #7fb3f5; }
.hero p { font-size: 15px; color: rgba(255,255,255,.6); margin: 0 0 26px; }
.hero-stats {
  display: inline-flex; gap: 24px; margin-top: 6px;
  background: rgba(255,255,255,.08); border-radius: 12px;
  padding: 12px 24px; border: 1px solid rgba(255,255,255,.1);
}
.hero-stat-val { font-size: 20px; font-weight: 800; color: #fff; line-height: 1; }
.hero-stat-lbl { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }

/* ── LAYOUT ────────────────────────────────────────────── */
.store-wrap {
  max-width: 1240px; margin: 0 auto; padding: 32px 20px 60px;
}
.store-sidebar-col  { width: 220px; flex-shrink: 0; }
.store-content-col  { flex: 1; min-width: 0; }
.store-layout       { display: flex; gap: 26px; align-items: flex-start; }

/* ── CATEGORY SIDEBAR ──────────────────────────────────── */
.sidebar {
  background: #fff; border-radius: 12px;
  border: 1px solid #e8ecf5;
  overflow: hidden;
  position: sticky; top: 78px;
}
.sidebar-header {
  padding: 13px 16px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: #9aa3b8;
  border-bottom: 1px solid #f0f2f9; background: #f8f9fd;
  display: flex; align-items: center; gap: 6px;
}
.sidebar-header i { color: #c0c8dc; }
.cat-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: #5a6282; border-left: 3px solid transparent;
  text-decoration: none; transition: all .13s; cursor: pointer;
  border-bottom: 1px solid #f8f9fd;
}
.cat-link:last-child { border-bottom: none; }
.cat-link:hover { background: #f5f7ff; color: #1d2b4f; border-left-color: #4a6fdc; text-decoration: none; }
.cat-link.active { background: #eef2ff; color: #1d2b4f; border-left-color: #1d2b4f; font-weight: 700; }
.cat-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; background: #e8ecf5; color: #9aa3b8;
  flex-shrink: 0;
}
.cat-link.active .cat-badge { background: #1d2b4f; color: #fff; }

/* ── BOOK CARDS ────────────────────────────────────────── */
.books-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.books-header-title { font-size: 15px; font-weight: 700; color: #1d2b4f; margin: 0; }
.books-count { font-size: 12px; color: #9aa3b8; }

.book-card {
  background: #fff; border-radius: 12px;
  border: 1px solid #e8ecf5;
  overflow: hidden; cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  display: flex; flex-direction: column;
  height: 100%;
}
.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(29,43,79,.13);
  border-color: #d0d8ee;
}
.book-thumb {
  height: 200px; overflow: hidden;
  background: #f0f2f8; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.book-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.book-card:hover .book-thumb img { transform: scale(1.05); }
.book-price-badge {
  position: absolute; top: 10px; right: 10px;
  background: #1d2b4f; color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
}
.book-body { padding: 14px 15px; flex: 1; display: flex; flex-direction: column; }
.book-title { font-size: 14px; font-weight: 700; color: #1d2b4f; margin: 0 0 3px; line-height: 1.35; }
.book-author { font-size: 12px; color: #9aa3b8; margin: 0 0 8px; }
.book-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.book-tag {
  font-size: 10px; font-weight: 700;
  background: #eef2ff; color: #4a6fdc;
  padding: 2px 8px; border-radius: 10px;
}
.book-desc {
  font-size: 12px; color: #6b7494; flex: 1; margin: 0;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  line-height: 1.55;
}
.book-footer {
  padding: 11px 15px; border-top: 1px solid #f0f2f9;
  display: flex; align-items: center; justify-content: space-between;
}
.book-price { font-size: 16px; font-weight: 800; color: #1d2b4f; }
.btn-view {
  background: #1d2b4f; color: #fff; border: none;
  border-radius: 8px; padding: 6px 14px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background .15s; white-space: nowrap;
}
.btn-view:hover { background: #2c4070; }

/* No books empty state */
.no-books {
  text-align: center; padding: 64px 20px;
  background: #fff; border-radius: 12px; border: 1px solid #e8ecf5;
}
.no-books i { font-size: 52px; color: #d0d6ec; display: block; margin-bottom: 14px; }
.no-books p { font-size: 15px; font-weight: 600; color: #9aa3b8; margin: 0; }

/* ── BOOK SLIDE PANEL ──────────────────────────────────── */
#book-panel {
  position: fixed; top: 0; right: -460px; width: 440px;
  height: 100vh; background: #fff; z-index: 800;
  box-shadow: -8px 0 40px rgba(0,0,0,.16);
  transition: right .28s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; display: flex; flex-direction: column;
}
#book-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,22,42,.4); z-index: 799;
  backdrop-filter: blur(2px);
}
.panel-top {
  position: sticky; top: 0; background: #fff;
  padding: 16px 20px; border-bottom: 1px solid #e8ecf5; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
}
.panel-top h6 { font-size: 15px; font-weight: 800; color: #1d2b4f; margin: 0; }
.panel-close-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: #f0f2f8; border: none; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #9aa3b8; transition: all .13s;
}
.panel-close-btn:hover { background: #e4e8f0; color: #1d2b4f; }
.panel-body { padding: 20px; flex: 1; }

/* Qty control */
.qty-row { display: flex; align-items: center; gap: 10px; }
.qty-ctrl { display: flex; align-items: center; }
.qty-btn {
  width: 36px; height: 36px; background: #f4f5f9; border: 1.5px solid #e8ecf5;
  font-size: 16px; font-weight: 600; cursor: pointer; color: #1d2b4f;
  display: flex; align-items: center; justify-content: center;
  transition: background .13s;
}
.qty-btn:first-child { border-radius: 9px 0 0 9px; }
.qty-btn:last-child  { border-radius: 0 9px 9px 0; }
.qty-btn:hover { background: #e4e8f0; }
.qty-input {
  width: 46px; height: 36px; text-align: center;
  border: 1.5px solid #e8ecf5; border-left: none; border-right: none;
  font-size: 14px; font-weight: 700; color: #1d2b4f;
  outline: none; background: #fff;
}
.btn-add-cart {
  flex: 1; background: #1d2b4f; color: #fff; border: none;
  border-radius: 9px; padding: 10px 16px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-add-cart:hover { background: #2c4070; }

/* ── CART PAGE ─────────────────────────────────────────── */
.cart-page { max-width: 1000px; margin: 0 auto; padding: 32px 20px 60px; }
.cart-title { font-size: 22px; font-weight: 800; color: #1d2b4f; margin: 0 0 24px; }

.cart-empty {
  text-align: center; padding: 80px 20px;
  background: #fff; border-radius: 14px; border: 1px solid #e8ecf5;
}
.cart-empty i { font-size: 56px; color: #d0d6ec; display: block; margin-bottom: 16px; }
.cart-empty p { font-size: 16px; font-weight: 600; color: #9aa3b8; margin: 0 0 20px; }
.cart-empty a {
  background: #1d2b4f; color: #fff; border-radius: 9px;
  padding: 11px 28px; font-size: 13px; font-weight: 700; display: inline-block;
  text-decoration: none;
}
.cart-empty a:hover { background: #2c4070; color: #fff; }

.cart-row {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: 12px; border: 1px solid #e8ecf5;
  padding: 14px 16px; margin-bottom: 12px;
}
.cart-img { width: 70px; height: 70px; object-fit: cover; border-radius: 9px; border: 1px solid #e8ecf5; flex-shrink: 0; }
.cart-info { flex: 1; min-width: 0; }
.cart-item-title  { font-size: 14px; font-weight: 700; color: #1d2b4f; margin: 0 0 2px; }
.cart-item-author { font-size: 12px; color: #9aa3b8; margin: 0 0 4px; }
.cart-item-price  { font-size: 13px; color: #4a6fdc; font-weight: 700; margin: 0; }
.cart-total-cell  { font-size: 15px; font-weight: 800; color: #1d2b4f; min-width: 75px; text-align: right; }
.btn-remove {
  display: block; background: none; border: none; cursor: pointer;
  font-size: 11px; font-weight: 700; color: #c0392b; padding: 2px 0; margin-top: 4px;
}
.btn-remove:hover { text-decoration: underline; }

.order-summary {
  background: #fff; border-radius: 14px; border: 1px solid #e8ecf5;
  padding: 22px 20px; position: sticky; top: 78px;
}
.summary-title { font-size: 14px; font-weight: 700; color: #1d2b4f; margin: 0 0 16px; }
.summary-line {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 8px 0;
  border-bottom: 1px solid #f0f2f9; color: #6b7494;
}
.summary-total-line {
  display: flex; justify-content: space-between;
  font-size: 16px; font-weight: 800; color: #1d2b4f;
  padding: 12px 0 0; border-top: 2px solid #e8ecf5; margin-top: 4px;
}
.btn-checkout {
  width: 100%; background: #1d2b4f; color: #fff;
  border: none; border-radius: 10px; padding: 13px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background .15s; margin-top: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-checkout:hover { background: #2c4070; }

/* ── ABOUT PAGE ────────────────────────────────────────── */
.about-hero {
  background: linear-gradient(135deg, #1d2b4f, #2f4882);
  padding: 56px 24px; text-align: center;
}
.about-hero h1 { font-size: 28px; font-weight: 800; color: #fff; margin: 0 0 8px; }
.about-hero p  { font-size: 14px; color: rgba(255,255,255,.55); margin: 0; }
.about-card {
  max-width: 780px; margin: 32px auto;
  background: #fff; border-radius: 16px; border: 1px solid #e8ecf5;
  padding: 36px 42px; box-shadow: 0 4px 20px rgba(0,0,0,.06);
}

/* ── MODALS ────────────────────────────────────────────── */
.bsmodal         { border: none !important; border-radius: 16px !important; overflow: hidden; }
.bsmodal-header  { padding: 18px 22px 14px !important; border-bottom: 1px solid #f0f2f9 !important; }
.bsmodal-body    { padding: 20px 22px !important; }
.modal-title     { font-size: 16px !important; font-weight: 800 !important; color: #1d2b4f !important; }

.flabel {
  font-size: 11px; font-weight: 700; color: #6b7494;
  text-transform: uppercase; letter-spacing: .06em;
  display: block; margin-bottom: 5px;
}
.fcontrol {
  border-radius: 9px !important; border: 1.5px solid #dde3f0 !important;
  padding: 9px 13px !important; font-size: 13px !important; color: #1a1e2e !important;
  transition: border-color .15s, box-shadow .15s;
}
.fcontrol:focus {
  border-color: #4a6fdc !important;
  box-shadow: 0 0 0 3px rgba(74,111,220,.12) !important;
}
.submit-btn {
  background: #1d2b4f; color: #fff; border: none; border-radius: 9px;
  padding: 11px; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .15s; display: block; width: 100%; margin-top: 4px;
}
.submit-btn:hover { background: #2c4070; }

/* ── FOOTER ────────────────────────────────────────────── */
.store-footer {
  background: #1d2b4f; padding: 48px 0 22px; margin-top: 0;
}
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.footer-brand { font-size: 17px; font-weight: 800; color: #fff; margin-bottom: 7px; }
.footer-brand span { color: #7fb3f5; }
.footer-sub   { font-size: 13px; color: rgba(255,255,255,.4); margin: 0; }
.footer-head  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.3); margin-bottom: 12px; }
.footer-link  { display: block; font-size: 13px; color: rgba(255,255,255,.55); margin-bottom: 7px; text-decoration: none; transition: color .13s; }
.footer-link:hover { color: #fff; }
.footer-copy  { border-top: 1px solid rgba(255,255,255,.08); margin-top: 32px; padding-top: 18px; text-align: center; font-size: 12px; color: rgba(255,255,255,.25); }

/* ── RESPONSIVE ────────────────────────────────────────── */
@media(max-width: 767px) {
  .topnav-inner { padding: 0 14px; }
  .topnav-brand { font-size: 15px; }
  .topnav-link  { padding: 7px 10px; font-size: 12px; }
  .user-name    { display: none; }
  .store-layout { flex-direction: column; }
  .store-sidebar-col { width: 100%; }
  .sidebar      { position: static; }
  .hero h1      { font-size: 26px; }
  #book-panel   { width: 100%; right: -100%; }
  .about-card   { padding: 22px 18px; }
}
