@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f8fbff;
  --surface: #ffffff;
  --surface-soft: #f5f8ff;
  --text: #1d2733;
  --muted: #667085;
  --primary: #b42419;
  --primary-soft: #f7e3e2;
  --border: rgba(136, 152, 170, 0.15);
  --shadow-soft: 0 22px 55px rgba(46, 93, 126, 0.12);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(180, 36, 25, 0.08), transparent 28%),
              radial-gradient(circle at bottom right, rgba(27, 56, 99, 0.08), transparent 25%),
              linear-gradient(180deg, var(--bg), #ffffff 65%);
  color: var(--text);
}

body, button, input, select, textarea {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#catalog,
#featured,
#contact {
  scroll-margin-top: 96px;
}

.site-header {
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(29, 39, 51, 0.08);
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--primary) !important;
  font-size: 1.35rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  color: var(--text);
  font-size: 1.1rem;
}

.topbar-search {
  min-width: 0;
}

.topbar-search input {
  border-radius: 999px;
  padding-right: 3rem;
  border-color: rgba(29, 39, 51, 0.14);
}

.topbar-search-btn {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  width: 2.4rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #b42419, #e74a37);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

#topbarSearchSuggestions {
  top: 100%;
  margin-top: 0.35rem;
  z-index: 1050;
}

.topbar-actions {
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: var(--text);
  font-size: 1.15rem;
  text-decoration: none;
}

.icon-btn:hover {
  background: var(--surface-soft);
  color: var(--primary);
}

.icon-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.shop-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.75rem 0;
  position: sticky;
  top: 88px;
  z-index: 30;
}

.shop-sidebar-heading {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.25rem 1.1rem 0.6rem;
}

.sidebar-link,
.sidebar-group-link {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  border: none;
  background: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.82rem;
  text-decoration: none;
  text-align: left;
}

.sidebar-link:hover,
.sidebar-group:hover > .sidebar-group-link {
  background: var(--surface-soft);
  color: var(--primary);
}

.sidebar-link-all {
  border-top: 1px solid var(--border);
  margin-top: 0.35rem;
  padding-top: 0.75rem;
}

.sidebar-icon {
  flex-shrink: 0;
  width: 1.15rem;
  font-size: 0.95rem;
  text-align: center;
}

.sidebar-label {
  flex-grow: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-count {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.sidebar-caret {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--muted);
}

/* Flyout megamenu (desktop) */
.sidebar-group {
  position: relative;
}

.sidebar-flyout {
  display: none;
  position: absolute;
  left: calc(100% + 6px);
  top: -0.75rem;
  width: 440px;
  max-width: 60vw;
  max-height: 80vh;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  z-index: 1035;
}

.sidebar-group:hover > .sidebar-flyout {
  display: block;
}

/* Transparent bridge so the hover survives the gap between item and flyout. */
.sidebar-flyout::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 0;
  width: 12px;
  height: 100%;
}

.sidebar-flyout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-flyout-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.sidebar-flyout-all {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-flyout-all:hover {
  text-decoration: underline;
}

.sidebar-flyout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.15rem 0.75rem;
}

.sidebar-flyout-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.8rem;
  text-decoration: none;
}

.sidebar-flyout-item:hover {
  background: var(--surface-soft);
  color: var(--primary);
}

.sidebar-flyout-item-label {
  flex-grow: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-flyout-more {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.sidebar-flyout-more:hover {
  text-decoration: underline;
}

#mobileSidebar .shop-sidebar {
  position: static;
  border: none;
  border-radius: 0;
}

/* On mobile the flyout can't be hovered; tapping a category opens its
   listing, and the full tree stays available on the categories page. */
@media (max-width: 991.98px) {
  .sidebar-flyout {
    display: none !important;
  }

  .sidebar-caret {
    display: none;
  }
}

.promo-banner {
  min-height: 200px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  background-repeat: no-repeat;
  background-size: cover;
}

.promo-banner .container,
.promo-banner .row {
  position: relative;
  z-index: 1;
}

.promo-banner h1 {
  font-size: clamp(1.75rem, 2.8vw, 2.75rem);
  line-height: 1.08;
}

.promo-banner .lead {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
}

.promo-tile {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.promo-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px rgba(46, 93, 126, 0.2);
  color: #fff;
}

.promo-tile .text-white-75 {
  color: rgba(255, 255, 255, 0.85);
}

.card {
  border-radius: 24px;
  border: 1px solid rgba(29, 39, 51, 0.08);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 48px rgba(46, 93, 126, 0.12);
}

.card-image-wrapper {
  overflow: hidden;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
}

.card-image-wrapper img {
  transition: transform .35s ease;
}

.card:hover .card-image-wrapper img {
  transform: scale(1.05);
}

.book-cover {
  height: 320px;
  object-fit: cover;
}

/* Fallback cover shown instead of the generic "no image" box — the
   title/author give the card something to show, so a row of unphotographed
   titles doesn't read as an unfinished catalog. */
.cover-placeholder {
  width: 100%;
  height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
  gap: 0.35rem;
  background: linear-gradient(160deg, #f7f9fd 0%, #eef2f9 100%);
}

.cover-placeholder-icon {
  font-size: 1.8rem;
  color: #8fa3c0;
  margin-bottom: 0.25rem;
}

.cover-placeholder-title {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #3d4757;
}

.cover-placeholder-author {
  font-size: 0.78rem;
  color: #8b98ad;
}

.cover-placeholder-detail {
  height: auto;
  aspect-ratio: 3 / 4;
  padding: 2rem;
}

.cover-placeholder-detail .cover-placeholder-icon {
  font-size: 2.75rem;
}

.cover-placeholder-detail .cover-placeholder-title {
  font-size: 1.2rem;
  -webkit-line-clamp: 4;
}

/* QR platba na konci objednávky */
.payment-qr {
  width: 220px;
  max-width: 100%;
}

.payment-qr svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Books with no cover fall back to static/img/no-cover.svg, which is sized by
   the same .book-cover / .detail-cover rules as a real cover, so the grid
   stays even. */

/* Reserve space for the product image before it loads so the content below
   it doesn't jump (CLS). object-fit: contain keeps the whole cover visible,
   since wide items (kalendare, mapy, puzzle) share this layout with books. */
.detail-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: var(--surface-soft);
}

.book-card {
  transition: transform .25s ease, box-shadow .25s ease;
}

/* --- Product card ------------------------------------------------------- */

.card-stars {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.card-type {
  font-size: 0.7rem;
  min-width: 0;
  max-width: 55%;
}

.card-title-link {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  text-decoration: none;
}

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

.card-author {
  font-size: 0.72rem;
  line-height: 1.25;
  margin-top: 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-stock {
  font-size: 0.76rem;
}

/* The card is narrow with four per row, so the price must not wrap under
   the cart button. */
.book-card .book-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}

.book-card .book-price.book-price-sm {
  font-size: 1rem;
}

/* Cart button, styled after the familiar green-cart pattern. */
.btn-cart {
  background: #ffffff;
  border: 1px solid rgba(29, 39, 51, 0.16);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  box-shadow: 0 1px 2px rgba(29, 39, 51, 0.06);
}

.btn-cart i {
  color: #2e9e4f;
  margin-right: 0.15rem;
}

.btn-cart:hover,
.btn-cart:focus {
  background: #f3fbf5;
  border-color: #2e9e4f;
  color: var(--text);
}

/* "Hlídat dostupnost" — shown instead of the cart button for out-of-stock
   items, so a dead cart click never happens. */
.btn-watch {
  background: #ffffff;
  border: 1px solid rgba(29, 39, 51, 0.16);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  box-shadow: 0 1px 2px rgba(29, 39, 51, 0.06);
}

.btn-watch i {
  color: #b47b19;
  margin-right: 0.15rem;
}

.btn-watch:hover,
.btn-watch:focus {
  background: #fdf6ec;
  border-color: #b47b19;
  color: var(--text);
}

.btn-watch.disabled {
  opacity: 0.85;
  cursor: default;
  pointer-events: none;
}

.book-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(46, 93, 126, 0.14);
}

.book-price {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.book-price-sm {
  font-size: 1.02rem;
}

.badge {
  border-radius: 999px;
  padding: 0.55em 0.9em;
}

.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  font-size: 1rem;
  border-radius: 0.65rem;
  background: rgba(180, 36, 25, 0.08);
}

.btn-primary {
  background: linear-gradient(135deg, #b42419, #e74a37);
  border: none;
  box-shadow: 0 15px 30px rgba(180, 36, 25, 0.22);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #8f1c15, #cc3c2b);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: rgba(180, 36, 25, 0.25);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: rgba(180, 36, 25, 0.08);
}

.pagination {
  gap: 0.15rem;
}

.pagination .page-link {
  border-radius: 10px;
  color: var(--text);
}

.pagination .page-link:hover {
  color: var(--primary);
  background: var(--surface-soft);
}

.pagination .page-link:focus {
  box-shadow: 0 0 0 0.15rem rgba(180, 36, 25, 0.14);
}

.pagination .page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.form-control,
.form-select {
  border-radius: 16px;
  border-color: rgba(29, 39, 51, 0.12);
  box-shadow: none;
}

.phone-input-group .input-group-text {
  border-radius: 16px 0 0 16px;
  background: var(--surface-soft);
  border-color: rgba(29, 39, 51, 0.12);
  color: var(--text);
  font-weight: 600;
}

.phone-input-group .form-control {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

#postal-code-hint {
  color: #a15c00;
  cursor: pointer;
  text-decoration: underline dotted;
}

.filter-bar .form-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.filter-bar .form-select,
.filter-bar .btn {
  border-radius: 10px;
  font-size: 0.85rem;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(180, 36, 25, 0.4);
  box-shadow: 0 0 0 0.15rem rgba(180, 36, 25, 0.14);
}

.list-group-item {
  border-radius: 18px;
  border: 1px solid rgba(29, 39, 51, 0.08);
}

footer {
  font-size: 0.95rem;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  color: var(--primary);
}

.footer-brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
}

.footer-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.footer-links li,
.footer-contact li {
  margin-bottom: 0.55rem;
}

.footer-links a,
.footer-contact a {
  color: var(--text);
}

.footer-contact i {
  color: var(--primary);
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.footer-social-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

/* Free-shipping progress bar in the cart. */
.shipping-progress-bar {
  height: 0.6rem;
  border-radius: 999px;
  background: var(--surface-soft);
}

.shipping-progress-bar .progress-bar {
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Clamp titles in the compact "recently viewed" cards to two lines so the
   card heights stay even. */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 767px) {
  .promo-banner {
    min-height: 220px;
  }

  .book-cover {
    height: 280px;
  }

  .cover-placeholder:not(.cover-placeholder-detail) {
    height: 280px;
  }
}

@media (max-width: 575px) {
  .brand {
    font-size: 1.05rem;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .sidebar-toggle {
    width: 36px;
    height: 36px;
  }
}

/* --- Stránka produktu --------------------------------------------------- */

.product-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.86rem;
  color: var(--muted);
}

.product-breadcrumb li + li::before {
  content: '\203A';
  margin-right: 0.4rem;
  color: #b6c1d0;
}

.product-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.product-breadcrumb a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.product-brand {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: underline;
  margin-bottom: 0.35rem;
}

.product-brand:hover {
  color: var(--primary);
}

.product-title {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.product-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  font-size: 0.95rem;
}

.product-rating-count {
  color: var(--muted);
  text-decoration: underline;
}

/* Long marketing copy is folded to seven lines; the checkbox next to it is the
   toggle, so unfolding works without JavaScript. */
.product-description {
  margin-top: 1rem;
}

.product-description-text {
  margin-bottom: 0;
  color: #3d4757;
}

.product-description.is-clamped .product-description-text {
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description-state:checked ~ .product-description-text {
  display: block;
  overflow: visible;
}

.product-description-toggle {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: underline;
  cursor: pointer;
}

.product-description-toggle::after {
  content: 'Zobrazit celý popis';
}

.product-description-state:checked ~ .product-description-toggle::after {
  content: 'Skrýt popis';
}

.product-description-toggle:hover {
  color: var(--primary);
}

.product-variants {
  margin-top: 1.5rem;
}

.product-section-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.product-section-hint {
  font-size: 0.76rem;
  color: #9aa5b5;
  margin-bottom: 0.6rem;
}

/* Gallery: click-to-zoom trigger over the main image + thumbnail rail. */
.gallery-zoom-btn {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(29, 39, 51, 0.18);
  z-index: 2;
}

.gallery-zoom-btn:hover {
  background: #ffffff;
  color: var(--primary);
}

.cover-thumbs {
  --thumb-size: 64px;
}

.cover-thumb {
  width: var(--thumb-size);
  height: var(--thumb-size);
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-soft);
  flex-shrink: 0;
}

.cover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-thumb.active,
.cover-thumb:hover {
  border-color: var(--primary);
}

.zoom-modal-close {
  z-index: 3;
}

.zoom-image {
  max-height: 85vh;
  object-fit: contain;
  background: transparent;
}

.variant-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  height: 100%;
  padding: 0.6rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.variant-tile:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(46, 93, 126, 0.1);
  color: var(--text);
}

.variant-thumb {
  width: 44px;
  height: 66px;
  object-fit: contain;
  margin-bottom: 0.25rem;
}

.variant-title {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.variant-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.variant-stock {
  font-size: 0.72rem;
}

.variant-stock.in {
  color: #1a7f37;
}

.variant-stock.out {
  color: var(--muted);
}

.product-price {
  font-size: 2.35rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin: 0.75rem 0 1rem;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.product-actions .btn {
  flex: 1 1 200px;
}

.product-codes {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: #9aa5b5;
}

@media (max-width: 575px) {
  .product-title {
    font-size: 1.45rem;
  }

  .product-price {
    font-size: 1.6rem;
  }
}
