:root {
  --accent: #2c3e50;
  --accent-dark: #1a252f;
  --border: #e0e0e0;
  --green: #27ae60;
  --red: #c0392b;
}

/* ── Category grid (home page) ───────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.category-card {
  display: block;
  background: var(--accent);
  color: white !important;
  text-decoration: none;
  padding: 1.5rem 1rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  line-height: 1.5;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  transition: background 0.15s;
}
.category-card:hover { background: var(--accent-dark); }
.category-card small { display: block; font-weight: 400; opacity: 0.75; font-size: 0.8rem; }
.category-card .sold-count { opacity: 0.85; text-decoration: line-through; }

/* ── Item card (photo | info) ────────────────────────────── */
.item {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}
.item:last-child { border-bottom: none; }
.item.sold { opacity: 0.55; }

/* Photo column — gallery carousel */
.item-gallery { position: relative; }

.gallery-cover {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  object-position: center top;
  border-radius: 4px;
  display: block;
  cursor: zoom-in;
}

.gallery-prev,
.gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s;
  z-index: 2;
  padding: 0;
  user-select: none;
}
.item-gallery:hover .gallery-prev,
.item-gallery:hover .gallery-next { opacity: 1; }
.gallery-prev:hover,
.gallery-next:hover { background: rgba(0, 0, 0, 0.7); }
.gallery-prev { left: 6px; }
.gallery-next { right: 6px; }

.gallery-count {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
  line-height: 1.4;
}

/* Placeholder */
.photo-placeholder {
  width: 100%;
  height: 200px;
  background: #f5f5f5;
  border: 2px dashed #d0d0d0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 0.85rem;
}

/* Info column */
.item-info { display: flex; flex-direction: column; gap: 0.4rem; }
.item-info h3 { margin: 0 0 0.1rem; font-size: 1.1rem; }

.item-price { font-size: 1.25rem; font-weight: 600; color: var(--accent); }

.avail-now   { font-size: 0.8rem; font-weight: 600; color: var(--green); }
.avail-date  { font-size: 0.8rem; color: #888; }
.avail-tbd   { font-size: 0.8rem; color: #aaa; font-style: italic; }

.sold-badge {
  display: inline-block;
  background: var(--red);
  color: white;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.item-desc { font-size: 0.875rem; color: #555; line-height: 1.55; margin: 0.2rem 0; }

.contact-btn {
  display: inline-block;
  background: var(--accent);
  color: white !important;
  text-decoration: none;
  padding: 0.5rem 1.1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  align-self: flex-start;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.contact-btn:hover { background: var(--accent-dark); }

/* ── Books mini-grid ─────────────────────────────────────── */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.book-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  break-inside: avoid;
}
.book-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: center top;
  cursor: zoom-in;
}
.book-card-body {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.book-card-body h4 { margin: 0; font-size: 0.9rem; line-height: 1.4; }
.book-price { font-size: 1.05rem; font-weight: 600; color: var(--accent); }

/* ── Lightgallery caption ────────────────────────────────── */
.lg-sub-html {
  background: rgba(0, 0, 0, 0.5) !important;
}
.lg-sub-html p {
  font-size: 400%;
  color: #fff !important;
  margin: 0;
}

@media (max-width: 640px) {
  .lg-sub-html p { font-size: 1.25rem; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .item { grid-template-columns: 1fr; }
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .item { grid-template-columns: 180px 1fr; break-inside: avoid; }
  .book-grid { grid-template-columns: repeat(3, 1fr); }
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .contact-btn {
    background: white !important;
    color: var(--accent) !important;
    border: 1px solid var(--accent);
  }
  .category-card {
    background: white !important;
    color: var(--accent) !important;
    border: 1px solid var(--accent);
  }
}
