/* Apollo Building Products Digital Catalog Flipbook
   Built for simple HTML integration and easy PDF swapping.
*/

:root {
  --abp-blue: #0b4a7f;
  --abp-blue-dark: #06375f;
  --abp-gold: #c99b32;
  --ink: #17202a;
  --muted: #667085;
  --line: #e6e8ec;
  --bg: #ffffff;
  --soft: #f6f8fb;
  --shadow: 0 18px 60px rgba(16, 24, 40, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(11,74,127,0.08), transparent 34rem),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

a {
  color: var(--abp-blue);
}

.page-shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 24px;
}

.site-header {
  text-align: center;
  margin: 0 auto 24px;
}

.logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.brand-logo {
  max-width: min(340px, 82vw);
  height: auto;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 12px;
  color: var(--abp-gold);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--abp-blue-dark);
}

.intro {
  max-width: 720px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.catalog-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(11,74,127,.35);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.09);
  outline: none;
}

.btn.primary {
  background: var(--abp-blue);
  border-color: var(--abp-blue);
  color: #fff;
}

.btn.primary:hover {
  background: var(--abp-blue-dark);
}

.btn.subtle {
  background: var(--soft);
}

.page-jump,
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 38px;
  padding: 5px 9px 5px 12px;
}

.page-jump label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.page-jump input {
  width: 68px;
}

.search-box {
  flex: 1 1 260px;
  max-width: 420px;
}

input[type="number"],
input[type="search"] {
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  min-height: 28px;
}

input[type="number"]:focus,
input[type="search"]:focus {
  outline: none;
}

input[type="search"] {
  width: 100%;
}

.zoom-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  min-width: 45px;
  text-align: center;
}

.status-bar {
  padding: 10px 16px;
  min-height: 42px;
  color: var(--muted);
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.status-bar.error {
  color: #8a1f11;
  background: #fff3f0;
}

.viewer-stage {
  min-height: 720px;
  padding: clamp(18px, 4vw, 48px);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(11,74,127,.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(11,74,127,.04) 1px, transparent 1px),
    #fff;
  background-size: 42px 42px;
}

.flipbook {
  margin: 0 auto;
  transform-origin: center center;
  transition: transform .2s ease;
}

.catalog-page {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(16,24,40,.16);
}

.catalog-page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.mobile-note {
  display: none;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  padding: 12px 16px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 22px 12px 0;
}

.noscript {
  width: min(760px, calc(100% - 32px));
  margin: 20px auto;
  padding: 16px;
  border: 1px solid #f3c4ba;
  background: #fff3f0;
  border-radius: 14px;
  color: #8a1f11;
}

.sr-only {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

body.is-fullscreen .catalog-card,
.catalog-card:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.catalog-card:fullscreen .viewer-stage {
  height: calc(100vh - 132px);
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100% - 18px, 1500px);
    padding-top: 18px;
  }

  .toolbar {
    position: static;
  }

  .btn,
  .page-jump,
  .search-box {
    width: 100%;
    justify-content: center;
  }

  .search-box {
    max-width: none;
  }

  .viewer-stage {
    min-height: 540px;
    padding: 18px 10px;
  }

  .mobile-note {
    display: block;
  }
}

/* v5: keep realistic PageFlip curl, but render pages lazily. */
.page-loader {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .04em;
  background:
    linear-gradient(90deg, rgba(11,74,127,.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(11,74,127,.035) 1px, transparent 1px),
    #fff;
  background-size: 24px 24px;
}

@media (max-width: 860px) {
  .catalog-card {
    display: flex;
    flex-direction: column;
  }

  .status-bar {
    order: 1;
  }

  .viewer-stage {
    order: 2;
  }

  .toolbar {
    order: 3;
    border-top: 1px solid var(--line);
    border-bottom: 0;
  }

  .mobile-note {
    order: 4;
  }
}
