/* Fonts and shared colors */
@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/Satoshi-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/Satoshi-Medium.otf") format("opentype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/Satoshi-Bold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --modulam-paper: #FDFBF6;
  --modulam-paper-glass: #FDFBF6;
  --modulam-ink: #3b3b3b;
  --modulam-muted: #74716d;
  --modulam-accent: #fd565e;
  --modulam-accent-soft: rgba(253, 86, 94, 0.12);
  --modulam-line: rgba(59, 59, 59, 0.24);
  --modulam-shadow: 0 14px 34px rgba(34, 29, 25, 0.18);
}

body,
button,
input,
select,
output {
  font-family: "Satoshi", Arial, sans-serif;
}

/* Shared page styles and legacy panels */
.top-menu {
  height: 68px;
  padding: 0 40px;
  background: var(--modulam-paper-glass);
  border-bottom: 1px solid var(--modulam-ink);
  box-shadow: 0 4px 18px rgba(34, 29, 25, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.top-menu .modulam-logo img {
  height: 36px;
}

.interior-panel,
.environments-panel,
.sizes-panel {
  border: 1px solid var(--modulam-line);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: var(--modulam-paper-glass);
  color: var(--modulam-ink);
  box-shadow: var(--modulam-shadow);
  font-family: "Satoshi", Arial, sans-serif;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.environments-panel h2,
.sizes-panel h2,
.interior-panel h2 {
  color: var(--modulam-ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.configuration-label {
  color: var(--modulam-muted);
  font-family: "Satoshi", Arial, sans-serif;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.environment-option,
.size-option,
.hall-type-option {
  min-height: 38px;
  border: 1px solid var(--modulam-accent);
  border-radius: 8px;
  background: transparent;
  color: var(--modulam-accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.environment-option:hover,
.environment-option.active,
.size-option:hover,
.size-option.active,
.hall-type-option:hover,
.hall-type-option.active {
  background: var(--modulam-accent);
  color: #fff;
  transform: translateY(-1px);
}

.interior-collapse,
.environments-collapse,
.sizes-collapse,
.interior-expand,
.environments-expand,
.sizes-expand {
  border-color: var(--modulam-accent);
  background: var(--modulam-paper);
  color: var(--modulam-accent);
  box-shadow: 5px 8px 18px rgba(34, 29, 25, 0.13);
}

.interior-collapse:hover,
.environments-collapse:hover,
.sizes-collapse:hover,
.interior-expand:hover,
.environments-expand:hover,
.sizes-expand:hover {
  background: var(--modulam-accent);
  color: #fff;
}

.interior-plan {
  border-color: var(--modulam-line);
  background: #fff;
}

#prev,
#next {
  display: none !important;
  width: 50px;
  height: 50px;
  border: 1px solid var(--modulam-accent);
  background: var(--modulam-paper-glass);
  color: var(--modulam-accent);
  box-shadow: 0 8px 22px rgba(34, 29, 25, 0.18);
  font-size: 25px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

#prev:hover,
#next:hover {
  background: var(--modulam-accent);
  color: #fff;
}

#scrub {
  accent-color: var(--modulam-accent);
}

#frameNumber {
  color: var(--modulam-accent);
}

/* Configurator panel and its options */
.config-panel {
  position: fixed;
  top: 86px;
  bottom: 24px;
  left: 0;
  z-index: 31;
  width: min(320px, 84vw);
  box-sizing: border-box;
  border: 1px solid var(--modulam-line);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: var(--modulam-paper-glass);
  color: var(--modulam-ink);
  box-shadow: var(--modulam-shadow);
  transform: translateX(-100%);
  transition: transform 320ms ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.config-panel.open {
  transform: translateX(0);
}

.config-panel-scroll {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  padding: 20px 20px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: var(--modulam-accent) transparent;
  scrollbar-width: thin;
}

.config-panel .environments-panel,
.config-panel .hall-type-panel,
.config-panel .sizes-panel,
.config-panel .interior-panel {
  position: static;
  width: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--modulam-ink);
  opacity: 1;
  transform: none;
  pointer-events: auto;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.config-panel .environments-panel,
.config-panel .hall-type-panel,
.config-panel .sizes-panel,
.config-panel .doors-panel,
.config-panel .colors-panel,
.config-panel .fire-resistance-panel,
.config-panel .snow-zone-panel {
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--modulam-line);
}

.config-panel-title {
  margin: 0 0 8px;
  color: var(--modulam-ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.config-panel-intro {
  margin: 0 0 24px;
  color: var(--modulam-muted);
  font-size: 14px;
  line-height: 1.45;
}

.config-panel .environments-panel h2,
.config-panel .sizes-panel h2,
.config-panel .doors-panel h2,
.config-panel .colors-panel h2,
.config-panel .fire-resistance-panel h2,
.config-panel .snow-zone-panel h2,
.config-panel .progress-panel h2,
.config-panel .interior-panel h2 {
  margin: 0 0 14px;
  text-align: left;
  color: var(--modulam-ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.door-grid,
.color-grid,
.fire-resistance-options {
  display: grid;
  gap: 8px;
}

.door-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.color-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fire-resistance-description {
  margin: 0 0 14px;
  color: var(--modulam-muted);
  font-size: 13px;
  line-height: 1.45;
}

.door-description {
  margin: 12px 0 0;
  color: var(--modulam-muted);
  font-size: 13px;
  line-height: 1.45;
}

.fire-resistance-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.snow-map-art {
  position: relative;
  width: 100%;
  line-height: 0;
}

.snow-map-art > svg {
  display: block;
  width: 100%;
  height: auto;
}

.snow-map-art > .mk-map-overlay {
  position: absolute;
  inset: 0;
}

.snow-map-art .mk-zone-area {
  fill: transparent;
  cursor: pointer;
}

.snow-map-art #snowZoneHighlight path {
  fill: #fd565e;
}

.snow-zone-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.snow-zone-message {
  margin: 12px 0 0;
  color: var(--modulam-muted);
  font-size: 13px;
  line-height: 1.45;
}

.snow-zone-message[hidden] {
  display: none;
}

.progress-optional {
  color: var(--modulam-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.progress-description {
  margin: 0 0 14px;
  color: var(--modulam-muted);
  font-size: 13px;
  line-height: 1.45;
}

.progress-options {
  display: grid;
  gap: 8px;
}

.progress-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.progress-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.progress-option span {
  display: flex;
  min-height: 38px;
  box-sizing: border-box;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--modulam-accent);
  border-radius: 8px;
  background: transparent;
  color: var(--modulam-accent);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  transition: background 150ms ease, color 150ms ease;
}

.progress-option:hover span,
.progress-option input:checked + span {
  background: var(--modulam-accent);
  color: #fff;
}

.progress-option input:focus-visible + span {
  outline: 2px solid var(--modulam-accent);
  outline-offset: 3px;
}

.door-option,
.color-option,
.fire-resistance-option,
.snow-zone-option {
  position: static;
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--modulam-accent);
  border-radius: 8px;
  background: transparent;
  color: var(--modulam-accent);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transform: none;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.door-option:hover,
.door-option.active,
.color-option:hover,
.color-option.active,
.fire-resistance-option:hover,
.fire-resistance-option.active,
.snow-zone-option:hover,
.snow-zone-option.active {
  background: var(--modulam-accent);
  color: #fff;
  transform: translateY(-1px);
}

.color-option {
  display: grid;
  place-items: center;
}

.color-swatch {
  display: block;
  width: 24px;
  height: 24px;
  box-sizing: border-box;
  border: 1px solid rgba(59, 59, 59, 0.42);
  border-radius: 50%;
}

.color-swatch-light {
  background: #c9c9c7;
}

.color-swatch-brick {
  background: #b55239;
}

.color-swatch-very-dark {
  background: #1f2122;
}

.color-option.active .color-swatch,
.color-option:hover .color-swatch {
  border-color: #fff;
}

.config-panel .interior-panel-content {
  align-items: stretch;
  text-align: left;
}

.config-panel .interior-panel {
  margin-top: auto;
  padding-top: 22px;
}

.config-panel .interior-plan {
  width: 100%;
  margin: 6px auto 18px;
  background: #fff url("assets/images/view_background.png") center / cover no-repeat !important;
}

.config-panel .interior-plan::before {
  background-image: url("assets/images/view_background.png") !important;
  background-position: center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  opacity: 1;
}

.config-collapse,
.config-expand {
  position: fixed;
  display: grid;
  place-items: center;
  width: 38px;
  height: 64px;
  padding: 0;
  border: 1px solid var(--modulam-accent);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: var(--modulam-paper);
  color: var(--modulam-accent);
  box-shadow: 5px 8px 18px rgba(34, 29, 25, 0.13);
  font-family: "Satoshi", Arial, sans-serif;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 160ms ease, color 160ms ease;
}

.config-collapse {
  position: absolute;
  top: 50%;
  right: -38px;
}

.config-panel:not(.open) .config-collapse {
  display: none;
}

.config-expand {
  top: 50%;
  left: 0;
  z-index: 31;
  display: none;
}

.config-expand.visible {
  display: grid;
}

.config-collapse:hover,
.config-expand:hover {
  background: var(--modulam-accent);
  color: #fff;
}

body:not(.plan-mode) .config-panel,
body:not(.plan-mode) .config-expand {
  display: none !important;
}

@media (max-width: 700px) {
  .top-menu {
    height: 62px;
    padding: 0 20px;
  }

  .top-menu .modulam-logo img {
    height: 31px;
  }

  .config-panel {
    top: 74px;
    bottom: 12px;
    width: min(300px, 86vw);
  }

  .config-panel-scroll {
    padding: 16px 16px 20px;
  }

  #prev {
    left: 10px;
  }

  #next {
    right: 10px;
  }
}

/* Active plan layout: fixed header and right-side configurator */
body.plan-mode {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: var(--modulam-paper);
}

body.plan-mode .top-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  height: 68px;
  box-sizing: border-box;
  padding: 0 28px;
  border: 0;
  border-bottom: 2px solid rgba(59, 59, 59, 0.65);
  background: var(--modulam-paper);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.plan-mode .top-menu .header-nav {
  position: absolute;
  left: 50%;
  display: flex;
  max-width: calc(100% - 360px);
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 28px);
  margin-left: 0;
  overflow-x: auto;
  scrollbar-width: none;
  transform: translateX(-50%);
}

body.plan-mode .top-menu .header-nav::-webkit-scrollbar {
  display: none;
}

body.plan-mode .top-menu .header-nav a {
  flex: 0 0 auto;
  color: var(--modulam-ink);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms ease;
}

body.plan-mode .top-menu .header-nav a:hover,
body.plan-mode .top-menu .header-nav a:focus-visible {
  color: #bd4b51;
}

body.plan-mode .top-menu .header-nav a[aria-current="page"] {
  color: #151515;
}

body.plan-mode .top-menu .header-nav a:hover {
  transform: none;
}

@media (max-width: 700px) {
  body.plan-mode .top-menu {
    padding: 0 16px;
  }

  body.plan-mode .top-menu .header-nav {
    position: static;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    justify-content: center;
    display: flex;
    gap: 16px;
    margin-left: 18px;
    transform: none;
  }

  body.plan-mode .top-menu .header-nav a {
    font-size: 12px;
  }
}

/* Right sidebar */
body.plan-mode .config-panel {
  --config-sidebar-width: min(432px, 40.5vw);
  top: 68px;
  right: 0;
  bottom: 0;
  left: auto;
  width: var(--config-sidebar-width);
  border: 0;
  border-left: 0;
  border-radius: 0;
  transform: none;
  transition: none;
  background: var(--modulam-paper);
  box-shadow: none;
}

body.plan-mode .config-panel.open {
  transform: none;
}

body.plan-mode .config-panel-scroll {
  height: 100%;
  padding: 22px 18px 20px;
}

body.plan-mode .config-collapse,
body.plan-mode .config-expand {
  display: none !important;
}

.hall-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hall-type-option {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: auto;
  width: 100%;
  height: 38px;
  padding: 0 8px;
  border-radius: 8px;
  line-height: 1.2;
  transform: none;
}

.hall-type-option:hover,
.hall-type-option.active {
  transform: translateY(-1px);
}

.config-panel .sizes-panel[hidden],
.config-panel .doors-panel[hidden],
.config-panel .colors-panel[hidden] {
  display: none;
}

/* Render viewport */
.render-area {
  position: fixed;
  top: 88px;
  right: calc(min(432px, 40.5vw) + 15px);
  bottom: 20px;
  left: 30px;
  z-index: 4;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--modulam-paper);
}

@media (max-width: 900px) {
  body.plan-mode .config-panel {
    --config-sidebar-width: min(432px, 45.9vw);
  }

  .render-area {
    right: calc(min(432px, 45.9vw) + 15px);
    left: 30px;
  }
}

/* Intentional final surface overrides keep the agreed #FDFBF6 background. */
html,
body.plan-mode,
body.plan-mode .top-menu,
body.plan-mode .config-panel,
body.plan-mode .config-panel-scroll,
body.plan-mode .render-area {
  background: var(--modulam-paper) !important;
}

body.plan-mode .top-menu,
body.plan-mode .config-panel,
body.plan-mode .render-area {
  box-shadow: none !important;
}

body.plan-mode .top-menu,
body.plan-mode .config-panel {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

