/* Offline Catalog Stylesheet */
:root {
  --bg-page: #0f172a;
  --bg-canvas: #1e293b;
  --bg-sheet: #ffffff;
  --border-color: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-hot: #f43f5e;
  --accent-cold: #38bdf8;
  --accent-all: #a855f7;
  --shadow-sheet: 0 10px 30px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.catalog-counts {
  display: flex;
  gap: 8px;
}

.count-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.hot-badge {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-hot);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.cold-badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cold);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.total-badge {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.tabs {
  display: flex;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 6px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active.hot {
  background: var(--accent-hot);
  color: #fff;
}

.tab-btn.active.cold {
  background: var(--accent-cold);
  color: #0f172a;
}

.tab-btn.active.all {
  background: var(--accent-all);
  color: #fff;
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 100px;
  text-align: center;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.catalog-page-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 540px;
}

/* PDF-identical A4 Sheet */
.pdf-page-sheet {
  background: var(--bg-sheet);
  box-shadow: var(--shadow-sheet);
  border-radius: 8px;
  padding: 32px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 28px;
  width: 100%;
  aspect-ratio: 595.28 / 841.89; /* Exact A4 proportions */
}

/* 3:4 Beverage Frame */
.catalog-image-frame {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8fafc;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.catalog-image-frame:hover {
  transform: scale(1.015);
}

.catalog-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-height: 90vh;
  max-width: 90vw;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 6px;
}

.lightbox-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (max-width: 640px) {
  header {
    flex-direction: column;
    padding: 12px;
  }
  .pdf-page-sheet {
    aspect-ratio: auto;
    padding: 20px 16px;
    gap: 20px;
  }
  .catalog-image-frame {
    max-width: 100%;
  }
}
