:root {
  color-scheme: light;
  --page-width: 1055px;
  --brand-blue: #003b6a;
  --brand-gold: #d29a27;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #f2eee7;
}

body {
  min-width: 320px;
  margin: 0;
  background: #f2eee7;
  font-family: Arial, Helvetica, sans-serif;
}

.catalogue {
  width: min(100%, var(--page-width));
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 34px rgb(0 32 60 / 14%);
}

.page {
  position: relative;
  width: 100%;
  margin: 0;
  overflow: hidden;
  background: #fff;
}

.page-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 0;
}

.category-link,
.logo-home-link {
  position: absolute;
  z-index: 2;
  display: block;
  border-radius: 18px;
  color: transparent;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.category-link::after {
  position: absolute;
  left: 50%;
  bottom: 8%;
  padding: 8px 13px;
  border: 1px solid rgb(255 255 255 / 75%);
  border-radius: 999px;
  background: rgb(0 59 106 / 92%);
  box-shadow: 0 6px 18px rgb(0 0 0 / 22%);
  color: #fff;
  content: attr(data-label);
  font-size: clamp(11px, 1.5vw, 16px);
  font-weight: 700;
  letter-spacing: .02em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.category-link:hover,
.category-link:focus-visible {
  outline: 4px solid rgb(210 154 39 / 90%);
  outline-offset: -4px;
  background: rgb(255 255 255 / 10%);
}

.category-link:hover::after,
.category-link:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.category-link:focus-visible,
.logo-home-link:focus-visible,
.icon-button:focus-visible {
  outline: 4px solid var(--brand-gold);
  outline-offset: 3px;
}

/* Most inner pages place the Origo logo in this top-left area. */
.logo-home-link {
  left: 1.5%;
  top: 1%;
  width: 24%;
  height: 13%;
}

.logo-home-link:hover {
  background: rgb(255 255 255 / 8%);
}

.top-controls {
  position: fixed;
  z-index: 20;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.icon-button {
  display: grid;
  width: 52px;
  height: 52px;
  padding: 0;
  place-items: center;
  border: 2px solid rgb(210 154 39 / 85%);
  border-radius: 50%;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 7px 22px rgb(0 36 67 / 24%);
  color: var(--brand-blue);
  cursor: pointer;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.icon-button:hover {
  box-shadow: 0 9px 26px rgb(0 36 67 / 30%);
  transform: translateY(-2px);
}

.icon-button svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.category-switcher {
  position: relative;
}

.categories-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: max(220px, min(280px, calc(100vw - 28px)));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgb(210 154 39 / 60%);
  border-radius: 16px;
  background: rgb(255 255 255 / 98%);
  box-shadow: 0 14px 34px rgb(0 36 67 / 28%);
  backdrop-filter: blur(8px);
}

.categories-menu[hidden] {
  display: none;
}

.categories-menu-title {
  padding: 8px 10px 4px;
  color: #8a8373;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.categories-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--brand-blue);
  font: 700 13px/1.2 Arial, Helvetica, sans-serif;
  letter-spacing: .02em;
  text-decoration: none;
}

.categories-menu a:hover,
.categories-menu a:focus-visible {
  background: rgb(0 59 106 / 8%);
  outline: none;
}

.categories-menu a.is-current {
  background: rgb(210 154 39 / 18%);
  pointer-events: none;
}

.categories-menu-divider {
  margin: 6px 4px;
  border: 0;
  border-top: 1px solid rgb(0 59 106 / 12%);
}

.collection-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgb(210 154 39 / 60%);
  border-radius: 999px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 8px 28px rgb(0 36 67 / 25%);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.page-arrow {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #fff;
  cursor: pointer;
}

.page-arrow:hover:not(:disabled) {
  background: #005086;
}

.page-arrow:disabled {
  cursor: default;
  opacity: .28;
}

.page-arrow:focus-visible,
.page-select:focus-visible {
  outline: 3px solid var(--brand-gold);
  outline-offset: 2px;
}

.page-arrow svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.page-select {
  min-width: 116px;
  height: 42px;
  padding: 0 30px 0 13px;
  border: 0;
  border-radius: 999px;
  background-color: #fff;
  color: var(--brand-blue);
  cursor: pointer;
  font: 700 14px/1 Arial, Helvetica, sans-serif;
  text-align: center;
}

.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The category/home artwork remains fully visible inside the device. */
.home-viewer {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, #fff 0, #eee9df 58%, #d8d0c2 100%);
}

.home-viewer .catalogue {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: transparent;
  box-shadow: none;
}

.home-viewer .page {
  width: min(100vw, calc(100dvh * 1055 / 1491));
  height: auto;
  aspect-ratio: 1055 / 1491;
  box-shadow: 0 12px 42px rgb(38 28 11 / 20%);
}

.home-viewer .page-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Full-screen book viewer used by the three inner collections. */
.book-viewer {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background:
    radial-gradient(circle at 50% 45%, #fff 0, #eee9df 58%, #d8d0c2 100%);
}

.book-viewer .catalogue {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  perspective: 2400px;
  perspective-origin: 50% 48%;
  background: transparent;
  box-shadow: none;
  touch-action: none;
}

.book-viewer .page {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: visible;
  visibility: hidden;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transform: rotateY(0deg);
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity, filter;
}

/* Sized via its inline aspect-ratio (set per page to match that page's
   image) so it shrink-wraps to the image's actual rendered box on any
   screen shape, instead of the full-bleed page. Percentage max-height alone
   can't do this reliably: it only resolves against a definite ancestor
   height, which this flex item doesn't have without aspect-ratio. Hotspots
   positioned inside it (by %) then line up with the picture everywhere. */
.book-viewer .page-frame {
  position: relative;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
}

.book-viewer .page-frame .page-image {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
}

.book-viewer .page.is-current {
  z-index: 2;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.book-viewer .page.is-turning {
  visibility: visible;
}

.book-viewer .page-image {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 100%;
  min-height: 0;
  max-height: none;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgb(38 28 11 / 18%));
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.book-viewer .page::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(0 0 0 / 26%), transparent 16%, transparent 82%, rgb(255 255 255 / 20%));
  content: "";
  opacity: 0;
  pointer-events: none;
}

.book-viewer .page.is-turning::after {
  animation: page-shade 720ms ease-in-out;
}

/* Compact book controls: side arrows plus a slim counter at the bottom. */
.book-viewer .collection-nav {
  position: fixed;
  inset: 0;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  transform: none;
  backdrop-filter: none;
}

.book-viewer .collection-nav label {
  position: absolute;
  left: 50%;
  bottom: max(9px, env(safe-area-inset-bottom));
  pointer-events: auto;
  transform: translateX(-50%);
}

.book-viewer .page-arrow {
  position: absolute;
  top: 50%;
  width: 38px;
  height: 58px;
  border: 1px solid rgb(210 154 39 / 72%);
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 5px 17px rgb(0 36 67 / 20%);
  color: var(--brand-blue);
  opacity: .82;
  pointer-events: auto;
  transform: translateY(-50%);
  backdrop-filter: blur(6px);
}

.book-viewer .page-arrow:hover:not(:disabled) {
  background: #fff;
  opacity: 1;
}

.book-viewer .page-arrow[data-direction="previous"] {
  left: 10px;
  border-radius: 7px 20px 20px 7px;
}

.book-viewer .page-arrow[data-direction="next"] {
  right: 10px;
  border-radius: 20px 7px 7px 20px;
}

.book-viewer .page-arrow svg {
  width: 19px;
  height: 19px;
}

.book-viewer .page-select {
  min-width: 94px;
  height: 28px;
  padding: 0 24px 0 10px;
  border: 1px solid rgb(210 154 39 / 65%);
  background-color: rgb(255 255 255 / 91%);
  box-shadow: 0 4px 14px rgb(0 36 67 / 18%);
  font-size: 11px;
  backdrop-filter: blur(6px);
}

.zoom-controls {
  position: fixed;
  z-index: 21;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgb(210 154 39 / 65%);
  border-radius: 999px;
  background: rgb(255 255 255 / 91%);
  box-shadow: 0 5px 18px rgb(0 36 67 / 18%);
  backdrop-filter: blur(6px);
}

.zoom-button,
.zoom-level {
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--brand-blue);
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}

.zoom-button {
  width: 30px;
  font-size: 20px;
  line-height: 1;
}

.zoom-level {
  min-width: 48px;
  padding: 0 6px;
  font-size: 11px;
}

.zoom-button:hover:not(:disabled),
.zoom-level:hover:not(:disabled) {
  background: rgb(0 59 106 / 10%);
}

.zoom-button:disabled {
  cursor: default;
  opacity: .3;
}

.zoom-button:focus-visible,
.zoom-level:focus-visible {
  outline: 3px solid var(--brand-gold);
  outline-offset: 1px;
}

.book-viewer.is-zoomed .page.is-current {
  cursor: grab;
}

.book-viewer.is-zoomed .page.is-current:active {
  cursor: grabbing;
}

.book-viewer .logo-home-link {
  display: none;
}

.book-viewer .collection-nav,
.book-viewer .top-controls,
.book-viewer .zoom-controls {
  transition: opacity 160ms ease;
}

.book-viewer.is-animating .collection-nav,
.book-viewer.is-animating .top-controls,
.book-viewer.is-animating .zoom-controls {
  opacity: .42;
}

@keyframes page-shade {
  0%, 100% { opacity: 0; }
  48% { opacity: .58; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .book-viewer .page::after {
    animation: none;
  }
}

@media (max-width: 620px) {
  .top-controls {
    gap: 8px;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .icon-button svg {
    width: 23px;
    height: 23px;
  }

  .categories-menu {
    width: max(200px, min(260px, calc(100vw - 20px)));
  }

  .category-link {
    border-radius: 8px;
  }

  .category-link::after {
    padding: 5px 8px;
  }

  .collection-nav {
    bottom: max(10px, env(safe-area-inset-bottom));
    gap: 4px;
    padding: 5px;
  }

  .book-viewer .page-image {
    filter: drop-shadow(0 7px 14px rgb(38 28 11 / 16%));
  }

  .home-viewer .page {
    box-shadow: 0 7px 25px rgb(38 28 11 / 17%);
  }

  .book-viewer .collection-nav {
    inset: 0;
    padding: 0;
  }

  .book-viewer .page-arrow {
    width: 32px;
    height: 50px;
  }

  .book-viewer .page-arrow[data-direction="previous"] {
    left: 6px;
  }

  .book-viewer .page-arrow[data-direction="next"] {
    right: 6px;
  }

  .book-viewer .page-select {
    min-width: 88px;
    height: 26px;
    padding-right: 21px;
    font-size: 10px;
  }

  .zoom-controls {
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    padding: 2px;
  }

  .zoom-button,
  .zoom-level {
    height: 27px;
  }

  .zoom-button {
    width: 27px;
    font-size: 18px;
  }

  .zoom-level {
    min-width: 43px;
    font-size: 10px;
  }

  .page-arrow {
    width: 38px;
    height: 38px;
  }

  .page-select {
    min-width: 104px;
    height: 38px;
    padding-right: 24px;
    font-size: 12px;
  }
}

@media print {
  html,
  body {
    background: #fff;
  }

  .catalogue {
    width: var(--page-width);
    max-width: none;
    box-shadow: none;
  }

  .page {
    break-after: page;
    page-break-after: always;
  }

  .page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .top-controls,
  .collection-nav,
  .zoom-controls,
  .category-link,
  .logo-home-link {
    display: none;
  }
}

/* Category hotspots on the MAIN booklet's own button artwork (pages 3-7). */
.hotspot-cushion { left: 8.1%; top: 47.7%; width: 31.9%; height: 7.4%; }
.hotspot-runner { left: 61.9%; top: 91.3%; width: 32.5%; height: 4.6%; }
.hotspot-mat { left: 29.4%; top: 19.5%; width: 41.3%; height: 5.1%; }
.hotspot-bag { left: 29.4%; top: 65.3%; width: 41.3%; height: 5.1%; }
.hotspot-stool { left: 31.9%; top: 21.3%; width: 34.4%; height: 5.6%; }
.hotspot-wall-hanging { left: 28.1%; top: 48.7%; width: 43.1%; height: 5.6%; }
.hotspot-assorted { left: 0; top: 20.4%; width: 35.6%; height: 5.6%; }
.hotspot-sofa-cover { left: 0; top: 55.1%; width: 41.3%; height: 5.6%; }
.hotspot-bedsheet { left: 10%; top: 51%; width: 35.6%; height: 5.6%; }
