/* =========================================================
   KNIHA – Modern Bookstore  |  Main Stylesheet
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;0,700;0,900;1,400&family=Inter:wght@400;500;600&display=swap');

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

:root {
  --primary:      #0047AB;
  --primary-dark: #003080;
  --accent:       #FF6F61;
  --accent-dark:  #e85a4c;
  --bg:           #F5F5F5;
  --surface:      #FFFFFF;
  --text:         #1A1A1A;
  --text-muted:   #666666;
  --border:       #E0E0E0;
  --star:         #F5A623;
  --topbar-bg:    #1A1A2E;
  --radius:       4px;
  --shadow:       0 2px 8px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

h1,h2,h3,h4,h5 {
  font-family: 'Crimson Pro', serif;
  line-height: 1.2;
  color: var(--text);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  transition: background .2s, box-shadow .2s, transform .1s;
}
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: 0 2px 8px rgba(0,71,171,.35); }

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-dark); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.btn-dark {
  background: var(--text);
  color: #fff;
}
.btn-dark:hover { background: #333; }

.btn-sm { padding: 7px 14px; font-size: 0.8125rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Top Utility Bar ──────────────────────────────────── */
.topbar {
  background: var(--topbar-bg);
  color: rgba(255,255,255,.75);
  font-size: 0.75rem;
  padding: 6px 0;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar-left { display: flex; gap: 20px; }
.topbar-right { display: flex; gap: 20px; }
.topbar a { color: rgba(255,255,255,.75); }
.topbar a:hover { color: #fff; }

/* ── Main Header ──────────────────────────────────────── */
.site-header {
  background: var(--surface);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-family: 'Crimson Pro', serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -1px;
  flex-shrink: 0;
}

.search-bar {
  flex: 1;
  display: flex;
  max-width: 560px;
}
.search-bar input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 0.875rem;
  outline: none;
  transition: border-color .2s;
}
.search-bar input:focus { border-color: var(--primary); }
.search-bar .cat-select {
  padding: 9px 10px;
  border: 1.5px solid var(--border);
  border-right: none;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg);
  outline: none;
  cursor: pointer;
}
.search-bar .search-btn {
  padding: 9px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background .2s;
}
.search-bar .search-btn:hover { background: var(--primary-dark); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}
.header-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  color: var(--text-muted);
  position: relative;
  background: none;
  border: none;
  padding: 0;
}
.header-action svg { width: 22px; height: 22px; }
.header-action:hover { color: var(--primary); }
.header-action .badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Main Navigation ──────────────────────────────────── */
.main-nav {
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.main-nav .container {
  display: flex;
  align-items: center;
}
.main-nav a {
  display: block;
  padding: 12px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  transition: color .2s, border-bottom .2s;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.main-nav a.nav-sale {
  color: var(--accent);
}
.main-nav a.nav-sale:hover { color: var(--accent-dark); border-bottom-color: var(--accent); }

/* ── Hero Slider ──────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: #1a1a2e;
}
.slider-track {
  display: flex;
  transition: transform .5s ease;
}
.slide {
  min-width: 100%;
  height: 340px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(.55);
}
.slide-content {
  position: relative;
  z-index: 1;
  padding: 0 60px;
  max-width: 520px;
}
.slide-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 10px;
}
.slide-content h2 {
  font-size: 2.8rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.1;
}
.slide-content p {
  color: rgba(255,255,255,.85);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.5;
}
.slider-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}
.slider-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  border: none;
  cursor: pointer;
  transition: background .2s, width .2s;
}
.slider-dot.active {
  background: #fff;
  width: 24px;
  border-radius: 4px;
}
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background .2s;
}
.slider-btn:hover { background: rgba(255,255,255,.3); }
.slider-btn-prev { left: 16px; }
.slider-btn-next { right: 16px; }

/* ── Section Titles ───────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--accent);
  margin-top: 4px;
  border-radius: 2px;
}
.section-link {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 500;
}
.section-link:hover { text-decoration: underline; }

/* ── Book Cards ───────────────────────────────────────── */
.books-section { padding: 48px 0; background: var(--surface); }

.books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.book-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.book-cover {
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
  overflow: hidden;
  position: relative;
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.book-card:hover .book-cover img { transform: scale(1.04); }

.book-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 2px;
  text-transform: uppercase;
}

.book-info {
  padding: 14px;
}
.book-title {
  font-family: 'Crimson Pro', serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.book-price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}
.book-price .original-price {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 400;
  margin-left: 6px;
}
.book-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 10px;
  color: var(--star);
  font-size: 0.8rem;
}
.book-stars span { color: var(--text-muted); margin-left: 4px; }

/* ── Events Section ───────────────────────────────────── */
.events-section { padding: 48px 0; background: var(--bg); }

.events-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.event-card {
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.event-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.event-photo {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #e0e0e0;
}
.event-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform .3s;
}
.event-card:hover .event-photo img { transform: scale(1.05); }

.event-info { padding: 14px; }
.event-name {
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.event-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-style: italic;
}
.event-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.event-meta strong { color: var(--text); }

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  background: #1a1a2e;
  color: rgba(255,255,255,.75);
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 36px;
}
.footer-col h4 {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 7px; }
.footer-col a {
  font-size: 0.8125rem;
  color: rgba(255,255,255,.65);
  transition: color .2s;
}
.footer-col a:hover { color: #fff; }
.footer-col p { font-size: 0.8125rem; line-height: 1.6; }
.footer-col address {
  font-style: normal;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: rgba(255,255,255,.65);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-bottom p { font-size: 0.78rem; color: rgba(255,255,255,.45); }

.social-links {
  display: flex;
  gap: 14px;
}
.social-links a {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.7);
  font-size: 0.875rem;
  transition: background .2s, color .2s;
}
.social-links a:hover { background: var(--primary); color: #fff; }

/* ── Breadcrumb ───────────────────────────────────────── */
.breadcrumb {
  padding: 14px 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--text); }

/* ── Book Detail Page ─────────────────────────────────── */
.book-detail-section { padding: 32px 0 56px; }

.book-detail-grid {
  display: grid;
  grid-template-columns: 280px 1fr 240px;
  gap: 40px;
  align-items: start;
}

.book-detail-cover {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}
.book-detail-cover img { width: 100%; border-radius: 8px; }
.look-inside-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.65);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.4);
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
}

.book-detail-info h1 {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 4px;
}
.book-detail-info .author-link {
  color: var(--primary);
  font-size: 0.9375rem;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 12px;
}
.rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.stars { color: var(--star); font-size: 1rem; }
.rating-count { font-size: 0.875rem; color: var(--text-muted); }

.price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}
.price-main { font-size: 2rem; font-weight: 700; color: var(--primary); }
.price-original { font-size: 1rem; color: var(--text-muted); text-decoration: line-through; }
.price-save { font-size: 0.8rem; background: #e8f5e9; color: #388e3c; padding: 2px 8px; border-radius: 2px; font-weight: 600; }

.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content p { font-size: 0.9rem; line-height: 1.7; color: #333; }

.buy-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.buy-box-price { font-size: 1.6rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.buy-box-shipping {
  font-size: 0.8rem;
  color: #388e3c;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.buy-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.buy-actions .btn { font-size: 0.9rem; padding: 12px 20px; }

.related-books h3 {
  font-size: 1.1rem;
  margin-bottom: 14px;
}
.related-grid { display: flex; flex-direction: column; gap: 14px; }
.related-item { display: flex; gap: 10px; }
.related-cover {
  width: 56px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #e8eaf6;
}
.related-cover img { width: 100%; }
.related-info { display: flex; flex-direction: column; gap: 3px; }
.related-info .title { font-size: 0.82rem; font-weight: 600; line-height: 1.3; }
.related-info .author { font-size: 0.75rem; color: var(--text-muted); }
.related-info .price { font-size: 0.85rem; font-weight: 600; color: var(--primary); }

/* Reviews */
.reviews-section { padding: 40px 0 56px; background: var(--bg); }
.reviews-summary { display: flex; gap: 40px; margin-bottom: 32px; align-items: center; }
.reviews-score { text-align: center; }
.reviews-score .big { font-size: 3.5rem; font-weight: 900; color: var(--primary); line-height: 1; }
.reviews-score .stars { font-size: 1.4rem; }
.reviews-score .count { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.rating-bars { flex: 1; max-width: 300px; }
.rating-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 0.8rem; }
.bar-bg { flex: 1; height: 6px; background: var(--border); border-radius: 3px; }
.bar-fill { height: 6px; background: var(--star); border-radius: 3px; }

.reviews-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px;
}
.review-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 10px; }
.reviewer-name { font-weight: 600; font-size: 0.9rem; }
.review-date { font-size: 0.78rem; color: var(--text-muted); }
.review-text { font-size: 0.875rem; color: #333; line-height: 1.6; }

/* ── Search / Catalog Page ────────────────────────────── */
.catalog-section { padding: 32px 0 56px; }
.catalog-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }

.filters-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
}
.filter-group { margin-bottom: 22px; }
.filter-group h4 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.filter-group h4 span { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8375rem;
  padding: 4px 0;
  cursor: pointer;
}
.filter-option input { cursor: pointer; accent-color: var(--primary); }
.filter-option:hover { color: var(--primary); }

.price-range-inputs { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.price-range-inputs input[type=number] {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
}
.price-range-inputs span { color: var(--text-muted); font-size: 0.8125rem; }

.catalog-main {}
.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.catalog-toolbar h2 { font-size: 1.5rem; }
.catalog-toolbar p { font-size: 0.8125rem; color: var(--text-muted); }
.sort-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  background: var(--surface);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
}
.page-btn {
  width: 36px; height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s, color .2s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.ellipsis { border: none; background: none; cursor: default; }

/* ── Cart Page ────────────────────────────────────────── */
.cart-section { padding: 32px 0 56px; }
.checkout-steps {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
}
.step {
  flex: 1;
  text-align: center;
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 3px solid var(--border);
  position: relative;
}
.step.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.step.done {
  color: #388e3c;
  border-bottom-color: #388e3c;
}

.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }

.cart-items { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.cart-items h2 { font-size: 1.25rem; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.cart-item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.cart-item:last-of-type { border-bottom: none; }
.cart-item-img { width: 70px; flex-shrink: 0; border-radius: 4px; overflow: hidden; background: #e8eaf6; }
.cart-item-img img { width: 100%; }
.cart-item-details { flex: 1; }
.cart-item-details .title { font-weight: 600; margin-bottom: 2px; font-size: 0.9375rem; }
.cart-item-details .author { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.cart-item-price { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  width: fit-content;
  margin-top: 8px;
}
.qty-btn {
  width: 30px; height: 30px;
  background: var(--bg);
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.qty-btn:hover { background: var(--border); }
.qty-value { width: 36px; text-align: center; font-size: 0.875rem; font-weight: 500; }

.remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 6px;
  transition: color .2s;
}
.remove-btn:hover { color: var(--accent); }

.order-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  position: sticky;
  top: 90px;
}
.order-summary h3 { font-size: 1.1rem; margin-bottom: 16px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 6px 0;
  color: var(--text-muted);
}
.summary-row.total {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
}
.order-summary .btn { margin-top: 16px; }

.also-bought { margin-top: 24px; }
.also-bought h3 { font-size: 1.1rem; margin-bottom: 14px; }
.also-bought-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.also-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; text-align: center; padding: 10px; }
.also-card .cover { background: #e8eaf6; border-radius: 4px; margin-bottom: 8px; overflow: hidden; }
.also-card .cover img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.also-card .title { font-size: 0.78rem; font-weight: 600; margin-bottom: 2px; }
.also-card .price { font-size: 0.8rem; color: var(--primary); font-weight: 600; }

/* ── Utility ──────────────────────────────────────────── */
.visually-hidden { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1024px) {
  .books-grid, .events-grid { grid-template-columns: repeat(3, 1fr); }
  .book-detail-grid { grid-template-columns: 240px 1fr 210px; gap: 24px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .topbar { display: none; }
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .search-bar { order: 3; max-width: 100%; width: 100%; }
  .main-nav .container { overflow-x: auto; gap: 0; }
  .main-nav a { padding: 10px 14px; white-space: nowrap; }
  .books-grid, .events-grid { grid-template-columns: repeat(2, 1fr); }
  .book-detail-grid { grid-template-columns: 1fr; }
  .buy-box { display: none; }
  .catalog-layout { grid-template-columns: 1fr; }
  .filters-panel { display: none; }
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .reviews-grid { grid-template-columns: 1fr; }
  .slide { height: 240px; }
  .slide-content { padding: 0 40px; }
  .slide-content h2 { font-size: 2rem; }
}

@media (max-width: 480px) {
  .books-grid, .events-grid { grid-template-columns: 1fr 1fr; }
  .catalog-grid { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   PHP E-shop Extensions
   ========================================================= */

/* ── Alert messages ──────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: .875rem; }
.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4caf50; }
.alert-error   { background: #fce4ec; color: #c62828; border-left: 4px solid #f44336; }
.alert-info    { background: #e3f2fd; color: #1565c0; border-left: 4px solid #2196f3; }

/* ── Form fields ─────────────────────────────────────── */
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field label { font-size: .8125rem; font-weight: 500; color: var(--text); }
.form-field input,
.form-field select,
.form-field textarea {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  outline: none;
  transition: border-color .2s;
  background: var(--surface);
  font-family: inherit;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--primary); }
.form-field input::placeholder { color: #bbb; }

/* ── Toast ───────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: #1a1a2e; color: #fff; padding: 14px 20px; border-radius: 8px;
  font-size: .875rem; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transform: translateY(80px); opacity: 0;
  transition: transform .3s, opacity .3s;
}
#toast.show { transform: none; opacity: 1; }

/* ── Admin Layout ────────────────────────────────────── */
/* (additional admin styles are in admin.css) */

/* ── Mega-menu ───────────────────────────────────────── */
.mega-menu-wrap {
  position: static;   /* let .main-nav be the positioning parent */
  display: inline-flex;
  align-items: center;
}
.mega-trigger {
  display: flex; align-items: center; gap: 4px; cursor: pointer;
}
.mega-arrow { font-size: .65rem; transition: transform .2s; }
.mega-menu-wrap:hover .mega-arrow { transform: rotate(180deg); }

/* Nav must be the stacking/positioning root for full-width drop */
.main-nav { position: relative; }

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,.12);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .2s, transform .2s;
}
.mega-menu-wrap:hover .mega-menu,
.mega-menu-wrap:focus-within .mega-menu {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
/* Inner flex row — each column scrolls independently */
.mega-menu > .container {
  display: flex !important;
  gap: 0;
  align-items: flex-start;
  padding: 0;
}
.mega-col {
  flex: 1;
  padding: 16px 20px;
  border-right: 1px solid var(--border);
  max-height: 70vh;
  overflow-y: auto;
  /* subtle scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.mega-col:last-child { border-right: none; }
.mega-col::-webkit-scrollbar { width: 4px; }
.mega-col::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.mega-heading {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.mega-link {
  display: block;
  font-size: .82rem;
  color: var(--text);
  text-decoration: none;
  padding: 5px 0;
  transition: color .15s, padding-left .15s;
}
.mega-link:hover,
.mega-link-active { color: var(--primary); padding-left: 6px; }

.mega-show-more {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 5px 0;
  background: none;
  border: none;
  border-top: 1px dashed var(--border);
  color: var(--primary);
  font-size: .8rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: opacity .15s;
}
.mega-show-more:hover { opacity: .75; }

/* ── Simple nav dropdown (DB submenu items) ──────────── */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  min-width: 200px;
  padding: 6px 0;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.mega-menu-wrap:hover .dropdown-menu,
.mega-menu-wrap:focus-within .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.dropdown-item {
  display: block;
  padding: 9px 18px;
  font-size: .875rem;
  color: var(--text);
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.dropdown-item:hover, .dropdown-item.active { background: var(--bg); color: var(--primary); }

/* ── "Viac" nav overflow button ──────────────────────── */
.nav-more-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  color: inherit;
}
.nav-more-menu { min-width: 180px; }
.nav-more-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
