* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.catalog-wrap {
  display: flex;
  flex-direction: column;
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 12px;
}

.catalog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  flex: 0 0 auto;
}

.catalog-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.catalog-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 7px 10px;
}

.catalog-brand img {
  height: 19px;
  width: auto;
  display: block;
}

.catalog-brand span {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.back {
  text-decoration: none;
  color: #ff6b00;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 11px;
  border-radius: 9px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  white-space: nowrap;
}

.viewer {
  flex: 1 1 auto;
  min-height: 0;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  overflow: auto;
}

.catalog-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 96px);
  border: 0;
  border-radius: 14px;
  background: #fff;
}

.is-hidden {
  display: none !important;
}

.mobile-pdfjs-viewer {
  height: 100%;
  min-height: calc(100vh - 120px);
  background: #0f172a;
  padding: 10px 8px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-pdf-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  margin-bottom: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  backdrop-filter: blur(2px);
}

.pdf-tool-btn,
.pdf-tool-link {
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #e2e8f0;
  background: #1e293b;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 8px;
  line-height: 1;
}

.pdf-tool-btn {
  cursor: pointer;
}

.pdf-tool-link {
  margin-left: auto;
}

.pdf-tool-link + .pdf-tool-link {
  margin-left: 0;
}

.mobile-pdfjs-status {
  color: #cbd5e1;
  font-size: 13px;
  text-align: center;
  padding: 10px 8px;
}

.mobile-pdfjs-pages {
  display: block;
}

.mobile-pdfjs-page {
  width: 100%;
  margin-bottom: 10px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.25);
  background: #111827;
}

.mobile-pdfjs-page canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
}

.mobile-pdf-actions {
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px;
  text-align: center;
}

.mobile-pdf-actions p {
  margin: 0 0 6px;
  color: #475569;
  font-size: 14px;
}

.pdf-btn {
  width: min(320px, 100%);
  text-decoration: none;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
}

.pdf-btn.primary {
  border-color: #ff6b00;
  background: #ff6b00;
  color: #fff;
}

@media (max-width: 900px) {
  .catalog-wrap { padding: 8px; }
  .catalog-top { padding: 9px 10px; }
  .catalog-brand { padding: 6px 8px; }
  .catalog-brand img { height: 17px; }
  .catalog-brand span { font-size: 11px; }
  .back { font-size: 12px; padding: 7px 9px; }
  .catalog-frame { min-height: calc(100vh - 88px); }
  .mobile-pdfjs-viewer { min-height: calc(100vh - 140px); }
  .mobile-pdf-actions { min-height: calc(100vh - 140px); }
  .mobile-pdf-actions p { font-size: 13px; }
}
