/* ========================================================================
   CSS VARIABLES - LIGHT THEME DEFAULT
   ======================================================================== */

:root {
  /* Text role colours */
  --text-primary: #434c5e;
  --text-secondary: #6b7586;
  --text-support: #4e5768;
  --text-muted: #9ba3b0;
  --text-accent: #d67c6c;
  --text-on-accent: #f5f5f5;

  /* Theme colours */
  --color-bg-primary: #f6f7f8;
  --color-bg-secondary: #eceef0;
  --color-stage-bg: #f6f7f8;
  --color-surface: #f8f9fb;
  --color-image-panel: #fdfefe;
  --color-panel-base: #f8f9fb;
  --color-panel-muted: #f3f5f7;
  --color-panel-active: #fcfdfe;
  --color-card-bg: #eceef0;
  --color-border: #ddd8d4;
  --color-border-subtle: rgba(61, 57, 53, 0.1);
  --color-divider-soft: rgba(0, 0, 0, 0.05);

  /* Typography */
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  --leading-tight: 1.2;
  --leading-relaxed: 1.6;

  /* Layout */
  --content-max: 1200px;
  --container-padding: clamp(1.25rem, 2.2vw + 0.35rem, 2.5rem);
  --navbar-height: 74px;
  --sidebar-width: 420px;
  --price-footer-height: 140px;

  /* Effects */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
}

/* ========================================================================
   DARK THEME OVERRIDE
   ======================================================================== */

:root.dark-theme,
html.dark-theme {
  --text-primary: #e7e5e1;
  --text-secondary: #9daab6;
  --text-support: #c2c9c6;
  --text-muted: #7a8390;
  --text-on-accent: #2a2623;

  --color-bg-primary: #1f2226;
  --color-bg-secondary: #1a1d20;
  --color-stage-bg: #1f2226;
  --color-surface: #222830;
  --color-image-panel: #1e252b;
  --color-panel-base: #222830;
  --color-panel-muted: #1b2027;
  --color-panel-active: #2b343f;
  --color-card-bg: #1a1d20;
  --color-border: #514b45;
  --color-border-subtle: rgba(240, 240, 240, 0.08);
  --color-divider-soft: rgba(255, 255, 255, 0.05);
}

/* ========================================================================
   BILINGUAL CONTENT VISIBILITY
   ======================================================================== */

/* Hide all i18n wrappers by default, then show the active language */
.i18n { display: none; }
html[lang="en"] .i18n[lang="en"] { display: contents; }
html[lang="no"] .i18n[lang="no"] { display: contents; }

/* Static crawl-only summary block - hidden immediately when JS runs */
.conf-static-summary { display: none; }

/* ========================================================================
   RESET AND BASE STYLES
   ======================================================================== */

.skip-nav {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 10000;
  padding: 8px 16px;
  background: var(--color-bg-primary);
  color: var(--text-primary);
  border: 2px solid var(--text-accent);
  border-radius: 4px;
  font-size: 0.875rem;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-nav:focus {
  top: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  background-color: var(--color-stage-bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding-top: var(--navbar-height);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================================================
   NAVIGATION - matches landing page and catalog DNA
   ======================================================================== */

.navbar {
  --navbar-control-scale: 0.95;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-stage-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  height: var(--navbar-height);
  transition: transform 0.3s ease-in-out;
  isolation: isolate;
}

.navbar-hidden {
  transform: translateY(-100%);
}

.navbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.01);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
  z-index: 1;
}

body.menu-open .navbar::before {
  opacity: 1;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  position: relative;
}

/* Logo */
.navbar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  position: relative;
  z-index: 0;
  transition: filter 0.3s ease;
}

.navbar-logo-svg {
  height: 28px;
  width: auto;
}

.logo-text {
  fill: var(--text-primary);
  transition: fill var(--transition-base);
}

.logo-accent {
  fill: var(--text-accent);
}

/* Control buttons */
.navbar-controls {
  display: flex;
  align-items: center;
  gap: calc(0.8rem * var(--navbar-control-scale));
  position: relative;
  z-index: 2;
}

.navbar-btn {
  width: calc(39px * var(--navbar-control-scale));
  height: calc(39px * var(--navbar-control-scale));
  border-radius: calc(12px * var(--navbar-control-scale));
  background: transparent;
  border: 1px solid rgba(214, 124, 108, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.navbar-btn:focus {
  outline: none;
}

body.dark-theme .navbar-btn {
  border-color: rgba(214, 124, 108, 0.3);
}

.navbar-icon-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Theme toggle icons */
.theme-icon {
  position: absolute;
  width: 19px;
  height: 22.8px;
  transition: all 0.5s ease;
}

.theme-icon.sun-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.theme-icon.moon-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

body.dark-theme .theme-icon.sun-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

body.dark-theme .theme-icon.moon-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

/* Language toggle flags */
.flag-icon {
  width: 19px;
  height: 14.25px;
  position: absolute;
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
  border-radius: 2px;
}

.language-toggle[data-lang="en"] .flag-no {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.language-toggle[data-lang="en"] .flag-gb {
  opacity: 0;
  transform: rotate(-55deg) scale(0.82);
}

.language-toggle[data-lang="no"] .flag-no {
  opacity: 0;
  transform: rotate(55deg) scale(0.82);
}

.language-toggle[data-lang="no"] .flag-gb {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* Hamburger menu */
.hamburger-line {
  width: 17.1px;
  height: 1.9px;
  background-color: var(--text-primary);
  border-radius: 1.9px;
  position: absolute;
  transition: all 0.3s ease;
}

.hamburger-line.hamburger-line-upper {
  transform: translateY(-5.7px);
}

.hamburger-line.hamburger-line-lower {
  transform: translateY(5.7px);
}

.hamburger-menu.active .hamburger-line.hamburger-line-upper {
  transform: translateY(0) rotate(45deg);
}

.hamburger-menu.active .hamburger-line.hamburger-line-center {
  opacity: 0;
  transform: scale(0);
}

.hamburger-menu.active .hamburger-line.hamburger-line-lower {
  transform: translateY(0) rotate(-45deg);
}

.hamburger-menu.active .hamburger-line {
  background-color: var(--text-accent);
}

.hamburger-menu.active {
  border-color: rgba(214, 124, 108, 0.25);
  background: linear-gradient(
    135deg,
    rgba(214, 124, 108, 0.12),
    rgba(214, 124, 108, 0.06)
  );
}

/* Menu panel */
.menu-panel {
  position: absolute;
  top: 100%;
  right: var(--container-padding);
  margin-top: 0.7rem;
  width: 250px;
  background: var(--color-bg-primary);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  padding: 0.75rem;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.4s ease;
}

.menu-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

body.dark-theme .menu-panel {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.menu-link {
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: var(--weight-medium);
  font-size: 0.95rem;
}

.menu-link-discuss {
  margin-top: 0.5rem;
  color: var(--text-accent);
  border: 1px solid rgba(214, 124, 108, 0.3);
  text-align: center;
}

/* Page overlay */
.page-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.01);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  z-index: 98;
  transition: opacity 0.4s ease;
}

.page-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ========================================================================
   CONFIGURATOR - centering stage and main two-column layout
   ======================================================================== */

/* Fills remaining viewport height and centers the configurator panel
   vertically - same principle as the hero section on the landing page */
.conf-centering-stage {
  min-height: calc(100vh - var(--navbar-height));
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.configurator {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 0;
  width: calc(100% - 2 * var(--container-padding));
  max-width: calc(var(--content-max) - 2 * var(--container-padding));
  height: calc(100vh - var(--navbar-height) - 1.5rem);
  max-height: 860px;
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: none;
}

/* ========================================================================
   IMAGE DISPLAY AREA - left column
   ======================================================================== */

.conf-image-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 2.5rem 1.5rem;
  overflow: hidden;
  position: relative;
  min-width: 0;
  border-radius: 0;
  background: var(--color-image-panel);
}

/* Fixed 4:3 presentation area for the product image */
.conf-image-frame {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16 / 10;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-image-panel);
}

/* Stacked images for crossfade - each new image layers on top */
.conf-image-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.conf-image-frame img.conf-image-active {
  opacity: 1;
  z-index: 1;
}

/* Placeholder for missing renders */
.conf-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--color-image-panel);
  color: var(--text-muted);
}

.conf-placeholder.conf-placeholder-visible {
  display: flex;
}

.conf-placeholder svg {
  opacity: 0.25;
}

.conf-placeholder-text {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: 0.02em;
}

/* Price context pill - base, selections, reset - below the image */
.conf-price-bar {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  width: min(100%, 500px);
  margin-top: 1.85rem;
  padding: 0.7rem 1.4rem;
  background: var(--color-image-panel);
  border-radius: 999px;
  border: none;
  box-shadow: none;
}

.conf-price-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  justify-self: center;
}

.conf-price-item-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.conf-price-item-value {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.conf-price-upgrades {
  color: var(--text-accent);
}

/* Reset button */
.conf-reset-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  justify-self: center;
  padding: 0.3rem 0.6rem;
  font-family: var(--font-family);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.conf-reset-btn:hover {
  color: var(--text-accent);
}

/* ========================================================================
   CONFIGURATION SIDEBAR - right column
   ======================================================================== */

/* Suppress transitions during theme switch so right side changes at the same speed as left */
html.conf-theme-switching .conf-sidebar,
html.conf-theme-switching .conf-sidebar *,
html.conf-theme-switching .conf-sidebar-header,
html.conf-theme-switching .conf-sidebar-header * {
  transition: none !important;
}

.conf-sidebar {
  border-radius: 0;
  background: var(--color-panel-muted);
  transition: background var(--transition-fast);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-shadow: none;
}

.conf-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ========================================================================
   SIDEBAR HEADER - back link and product name
   ======================================================================== */

.conf-sidebar-header {
  padding: 1.25rem 1.5rem 0.75rem;
  flex-shrink: 0;
  background: var(--color-panel-muted);
  transition: background var(--transition-fast);
}

.conf-back-link {
  display: inline-block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: color var(--transition-fast);
}

.conf-back-link:hover {
  color: var(--text-accent);
}

.conf-product-name {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

/* Header reset button: XS only - hidden on all other sizes */
.conf-header-reset {
  display: none;
}

/* XS selections secondary line: hidden on all sizes except XS */
.conf-price-selections-xs {
  display: none;
}

/* ========================================================================
   SPACE NAVIGATION TABS - Exterior, Interior, Bathroom, Systems
   ======================================================================== */

.conf-space-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-divider-soft);
  padding: 0 1.5rem;
  flex-shrink: 0;
  position: relative;
}

.conf-space-tab {
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  flex: 1 1 0;
  text-align: center;
  transition: color var(--transition-base);
}

.conf-space-tab:hover {
  color: var(--text-primary);
}

.conf-space-tab.conf-space-tab-active {
  color: var(--text-accent);
  font-weight: var(--weight-semibold);
}

/* Sliding indicator bar */
.conf-space-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--text-accent);
  border-radius: 1px;
  pointer-events: none;
  transition:
    transform var(--transition-base),
    width var(--transition-base);
}

/* ========================================================================
   CATEGORIES AREA - scrollable list of category accordions
   ======================================================================== */

.conf-categories {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.65rem 0.25rem 0.8rem;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.conf-categories::-webkit-scrollbar {
  width: 4px;
}

.conf-categories::-webkit-scrollbar-track {
  background: transparent;
}

.conf-categories::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

/* Each space group wraps its categories */
.conf-space-group {
  display: none;
}

.conf-space-group.conf-space-group-active {
  display: block;
}

/* ========================================================================
   CATEGORY ACCORDION - collapsible sections with options inside
   ======================================================================== */

.conf-category {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--color-panel-base);
  margin: 0 0.75rem 0.55rem;
  transition: background var(--transition-fast);
}

.conf-category:last-child {
  margin-bottom: 0.75rem;
}

.conf-category.conf-category-open {
  background: var(--color-panel-active);
  border-color: var(--color-divider-soft);
}

/* Category header - clickable to expand/collapse */
.conf-category-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  text-align: left;
  transition: background var(--transition-fast);
}

.conf-category-header:hover {
  background: var(--color-panel-active);
}

.conf-category.conf-category-open .conf-category-header {
  border-bottom: 1px solid var(--color-divider-soft);
}

.conf-category-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  flex-shrink: 0;
}

.conf-category-selection {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-left: auto;
  padding-right: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
  text-align: right;
}

/* Chevron that rotates on expand */
.conf-category-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.conf-category.conf-category-open .conf-category-chevron {
  transform: rotate(90deg);
}

/* Options container - hidden when collapsed */
.conf-options {
  display: none;
  padding: 0.2rem 1rem 0.35rem;
}

.conf-category.conf-category-open .conf-options {
  display: block;
}

/* ========================================================================
   OPTION ITEMS - selectable radio-style options within a category
   ======================================================================== */

.conf-option {
  display: flex;
  align-items: stretch;
  min-height: 2.7rem;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

/* Hidden native radio */
.conf-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.conf-option-select {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  min-height: 2.7rem;
  padding: 0 0.5rem 0 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow 0.08s ease,
    transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.conf-option-select:hover {
  background: var(--color-panel-active);
}

.conf-option-select:active {
  background: var(--color-panel-active);
  box-shadow: inset 0 0 0 1px var(--color-border);
  transform: scale(0.992);
}

.conf-option.conf-option-selected .conf-option-select {
  background: var(--color-panel-active);
}

.conf-option input[type="radio"]:focus-visible + .conf-option-select {
  outline: 2px solid var(--text-accent);
  outline-offset: 2px;
}

/* Custom radio circle */
.conf-option-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
  margin-right: 0.75rem;
  position: relative;
  transition: border-color var(--transition-fast);
}

.conf-option-radio::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-accent);
  transform: scale(0);
  transition: transform var(--transition-fast);
}

.conf-option.conf-option-selected .conf-option-radio {
  border-color: var(--text-accent);
}

.conf-option.conf-option-selected .conf-option-radio::after {
  transform: scale(1);
}

/* Option name */
.conf-option-name {
  font-size: var(--text-sm);
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

/* Option price label */
.conf-option-price {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  flex-shrink: 0;
  margin-left: 0.75rem;
  min-width: 86px;
  text-align: right;
}

.conf-option-price-base {
  color: var(--text-muted);
  font-weight: var(--weight-regular);
  font-style: italic;
}

.conf-option-meta {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.conf-option-info-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-width: 20px;
  margin-left: 0.55rem;
  flex-shrink: 0;
}

.conf-option-info-slot-empty {
  visibility: hidden;
  pointer-events: none;
}

.conf-option-info-btn,
.conf-toggle-info-btn {
  width: 19px;
  height: 19px;
  min-width: 19px;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    opacity var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    background var(--transition-fast),
    box-shadow 0.08s ease,
    transform 0.08s ease;
}

.conf-option-info-btn:hover,
.conf-toggle-info-btn:hover,
.conf-option-info-btn:focus-visible,
.conf-toggle-info-btn:focus-visible,
.conf-option-info-btn[aria-expanded="true"],
.conf-toggle-info-btn[aria-expanded="true"] {
  color: var(--text-secondary);
  border-color: var(--text-secondary);
  background: var(--color-panel-active);
  opacity: 0.65;
}

.conf-option-info-btn:active,
.conf-toggle-info-btn:active {
  color: var(--text-secondary);
  border-color: var(--text-secondary);
  background: var(--color-panel-active);
  opacity: 0.72;
  box-shadow: inset 0 0 0 1px var(--color-border);
  transform: scale(0.92);
}

/* ========================================================================
   TOGGLE OPTIONS - binary on/off switches for add-ons
   ======================================================================== */

.conf-toggle {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.5rem;
  margin: 0 0.75rem;
  border-bottom: 1px solid var(--color-divider-soft);
  cursor: pointer;
}

.conf-toggle:last-child {
  border-bottom: none;
}

.conf-toggle-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  min-width: 0;
}

.conf-toggle-meta {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.conf-toggle-price {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  margin-right: 0.5rem;
}

/* Toggle switch track */
.conf-toggle-switch {
  width: 40px;
  height: 22px;
  background: var(--color-border);
  border-radius: 11px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition-fast);
  border: none;
  cursor: pointer;
  padding: 0;
}

.conf-toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.conf-toggle.conf-toggle-on .conf-toggle-switch {
  background: var(--text-accent);
}

.conf-toggle.conf-toggle-on .conf-toggle-switch::after {
  transform: translateX(18px);
}

body.dark-theme .conf-toggle-switch::after {
  background: var(--color-bg-primary);
}

/* Toggle info slot - mirrors radio option info slot placement */
.conf-toggle-info-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-width: 20px;
  margin-left: 0.75rem;
  flex-shrink: 0;
}

.conf-toggle-info-slot-empty {
  visibility: hidden;
}

/* ========================================================================
   OPTION DETAILS POPOVER - on-demand contextual explanation
   ======================================================================== */

.conf-option-popover-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 108;
}

.conf-option-popover {
  position: fixed;
  top: 0;
  left: 0;
  width: min(340px, calc(100vw - 1rem));
  padding: 0.72rem 0.78rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-image-panel);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.09);
  z-index: 109;
}

.conf-option-popover-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.conf-option-popover-context {
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
  flex: 1;
}

.conf-option-popover-close {
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.conf-option-popover-close:hover {
  color: var(--text-accent);
}

.conf-option-popover-title {
  margin-top: 0.2rem;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  line-height: 1.32;
}

.conf-option-popover-text {
  margin-top: 0.34rem;
  font-size: var(--text-sm);
  color: var(--text-support);
  line-height: 1.42;
}

.conf-option-popover-toggle {
  margin-top: 0.38rem;
  border: none;
  background: none;
  color: var(--text-accent);
  font-family: var(--font-family);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  padding: 0;
}

.conf-option-popover-toggle:hover {
  text-decoration: underline;
}

/* ========================================================================
   QUOTE OVERLAY - configuration summary and contact form
   ======================================================================== */

/* --- Backdrop --- */

.conf-quote-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 110;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.conf-quote-backdrop.conf-quote-visible {
  opacity: 1;
}

/* --- Overlay panel --- */

.conf-quote-overlay {
  position: fixed;
  inset: 0;
  z-index: 111;
  background: var(--color-bg-primary);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
  overflow: hidden;
  pointer-events: none;
}

.conf-quote-overlay.conf-quote-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* --- Header --- */

.conf-quote-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--color-divider-soft);
  background: var(--color-surface);
}

.conf-quote-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.conf-quote-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: transparent;
  color: #d67c6c;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.conf-quote-close:hover {
  color: #d67c6c;
  border-color: #d67c6c;
}

/* --- Scrollable body --- */

.conf-quote-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  -webkit-overflow-scrolling: touch;
}

/* --- Two-column content layout (desktop) --- */

.conf-quote-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4.5rem;
  max-width: 900px;
  margin: 0 auto;
}

/* --- Summary section --- */

.conf-quote-summary-title,
.conf-quote-form-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.conf-quote-form-intro {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin: -0.75rem 0 1.5rem;
}

.conf-quote-space-group {
  margin-bottom: 1.25rem;
}

.conf-quote-space-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-divider-soft);
  margin-bottom: 0.4rem;
}

.conf-quote-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.3rem 0;
  font-size: var(--text-sm);
  gap: 0.75rem;
}

.conf-quote-line-category {
  color: var(--text-muted);
  font-size: var(--text-xs);
  flex-shrink: 0;
  width: 38%;
  min-width: 120px;
}

.conf-quote-line-option {
  flex: 1;
  color: var(--text-primary);
}

.conf-quote-line-price {
  text-align: right;
  white-space: nowrap;
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.conf-quote-line-price.is-included {
  color: var(--text-muted);
  font-weight: var(--weight-regular);
  font-style: italic;
}

/* --- Total block --- */

.conf-quote-total {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--color-border);
}

.conf-quote-total-line {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.conf-quote-total-final {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--color-divider-soft);
}

/* --- Form section --- */

.conf-quote-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}

.conf-quote-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.conf-quote-input,
.conf-quote-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-family);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--color-panel-muted);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  box-sizing: border-box;
}

.conf-quote-input:focus,
.conf-quote-textarea:focus {
  border-color: var(--text-accent);
  box-shadow: 0 0 0 3px rgba(214, 124, 108, 0.12);
}

.conf-quote-textarea {
  resize: vertical;
  min-height: 160px;
}

/* Invalid field states */
.conf-quote-field.is-invalid .conf-quote-input,
.conf-quote-field.is-invalid .conf-quote-textarea {
  border-color: var(--text-accent);
}

.conf-quote-field.needs-attention .conf-quote-input,
.conf-quote-field.needs-attention .conf-quote-textarea {
  animation: conf-quote-pulse 0.3s ease-in-out 2;
}

@keyframes conf-quote-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(214, 124, 108, 0.12);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(214, 124, 108, 0.25);
  }
}

/* Honeypot - invisible to real visitors */
.conf-quote-honeypot {
  display: none;
  visibility: hidden;
}

/* Submit button */
.conf-quote-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1rem;
  margin-top: 0.5rem;
  background: var(--text-accent);
  color: var(--text-on-accent);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast);
}

.conf-quote-submit:hover {
  background: #c46d5d;
  transform: translateY(-1px);
}

.conf-quote-submit:active {
  transform: translateY(0);
}

.conf-quote-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Status messages */
.conf-quote-status {
  font-size: var(--text-sm);
  line-height: 1.5;
  padding: 0.5rem 0;
  min-height: 0;
}

.conf-quote-status:empty {
  display: none;
}

.conf-quote-status.is-success {
  color: #5a8a6a;
}

.conf-quote-status.is-error {
  color: #c46d5d;
}

/* --- Quote overlay: XL (1024-1199) --- */

@media (min-width: 1024px) and (max-width: 1199px) {
  .conf-quote-content {
    gap: 3.75rem;
    max-width: 840px;
  }
}

/* --- Quote overlay: L (768-1023) tablet --- */

@media (min-width: 768px) and (max-width: 1023px) {
  .conf-quote-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 540px;
  }
  .conf-quote-body {
    padding: 1.5rem;
  }
  .conf-quote-header {
    padding: 0.85rem 1.5rem;
  }
}

/* --- Quote overlay: M (450-767) --- */

@media (min-width: 450px) and (max-width: 767px) {
  .conf-quote-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 540px;
    margin: 0 auto;
  }
  .conf-quote-body {
    padding: 1.25rem;
  }
  .conf-quote-header {
    padding: 0.75rem 1.25rem;
  }
  .conf-quote-title {
    font-size: var(--text-base);
  }
}

/* --- Quote overlay: S (420-449) --- */

@media (min-width: 420px) and (max-width: 449px) {
  .conf-quote-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: none;
  }
  .conf-quote-body {
    padding: 1rem;
  }
  .conf-quote-header {
    padding: 0.75rem 1rem;
  }
  .conf-quote-title {
    font-size: var(--text-base);
  }
  .conf-quote-line {
    font-size: var(--text-xs);
  }
  .conf-quote-line-category {
    min-width: 70px;
  }
}

/* --- Quote overlay: XS (0-419) --- */

@media (max-width: 419px) {
  .conf-quote-content {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: none;
  }
  .conf-quote-body {
    padding: 0.85rem;
  }
  .conf-quote-header {
    padding: 0.65rem 0.85rem;
  }
  .conf-quote-title {
    font-size: var(--text-sm);
  }
  .conf-quote-line {
    font-size: var(--text-xs);
  }
  .conf-quote-close {
    width: 32px;
    height: 32px;
  }
}

/* ========================================================================
   STICKY PRICE FOOTER - always visible total and quote button
   ======================================================================== */

.conf-price-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--color-divider-soft);
  background: var(--color-panel-muted);
  transition: background var(--transition-fast);
}

/* Compact info row: hidden on desktop, shown on tablet and mobile */
.conf-price-meta-row {
  display: none;
}

/* Action row: wraps price area and quote button */
.conf-price-action-row {
  padding: 1rem 1.5rem 1.25rem;
}

.conf-price-area {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
}

.conf-price-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.conf-price-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
}

/* Primary conversion button */
.conf-quote-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--text-accent);
  color: var(--text-on-accent);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.01em;
}

.conf-quote-btn:hover {
  background: #c46d5d;
  transform: translateY(-1px);
}

.conf-quote-btn:active {
  transform: translateY(0);
}

/* ========================================================================
   TABLET LAYOUT - L (768 to 1023)
   ======================================================================== */

@media (min-width: 768px) and (max-width: 1023px) {
  .conf-centering-stage {
    align-items: flex-start;
    padding: 1.5rem var(--container-padding);
  }

  /* Content-driven panel: takes only the height it needs */
  .configurator {
    display: flex;
    flex-direction: column;
    width: calc(100% - 2 * var(--container-padding));
    max-width: 540px;
    height: auto;
    max-height: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  /* Header bar: back link left, product name centered */
  .conf-sidebar-header {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--color-image-panel);
    border-bottom: 1px solid var(--color-divider-soft);
  }

  .conf-sidebar-header .conf-back-link {
    margin-bottom: 0;
  }

  .conf-sidebar-header .conf-product-name {
    text-align: center;
    font-size: var(--text-lg);
  }

  /* Header reset button: visible on L, right-aligned in the 3-column header grid */
  .conf-header-reset {
    display: inline-flex;
    justify-self: end;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    min-height: auto;
    transition: color var(--transition-fast);
    margin-right: 0.25rem;
  }

  .conf-header-reset:hover {
    color: var(--text-accent);
  }

  /* Image area: centered with breathing room */
  .conf-image-area {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    display: block;
    background: var(--color-image-panel);
  }

  .conf-image-frame {
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-md);
    max-width: none;
    width: 90%;
    margin: 0 auto;
  }

  .conf-image-frame img {
    object-fit: cover;
  }

  /* Hide price bar from image area - context moves to the bottom panel */
  .conf-price-bar {
    display: none;
  }

  /* Configuration panel: tabs + categories + combined bottom bar */
  .conf-sidebar {
    flex: none;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--color-divider-soft);
    overflow: hidden;
  }

  .conf-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .conf-space-tabs {
    flex-shrink: 0;
  }

  /* Categories bounded and scrollable - bottom bar sits naturally after them */
  .conf-categories {
    max-height: 384px;
    overflow-y: auto;
  }

  /* Bottom panel: single row with three balanced elements */
  .conf-price-footer {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--color-divider-soft);
    background: var(--color-image-panel);
  }

  /* Meta row hidden - base price and reset moved out of footer */
  .conf-price-meta-row {
    display: none;
  }

  /* Three elements in a row with balanced spacing */
  .conf-price-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1.5rem;
    gap: 0;
  }

  /* Estimated price - label above value */
  .conf-price-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
    flex: none;
    text-align: center;
    margin-bottom: 0;
    padding: 0;
  }

  .conf-price-label {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.2;
    white-space: nowrap;
  }

  .conf-price-value {
    font-size: 1rem;
    font-weight: var(--weight-semibold);
    line-height: 1.2;
    white-space: nowrap;
  }

  /* Selections - label above value */
  .conf-price-selections-xs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0;
  }

  .conf-price-selections-xs .conf-price-item-label {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1;
  }

  .conf-price-selections-xs .conf-price-item-value {
    font-size: 0.92rem;
    font-weight: var(--weight-semibold);
    line-height: 1.2;
    white-space: nowrap;
  }

  /* Quote button: compact, balanced with text elements */
  .conf-quote-btn {
    width: auto;
    margin: 0;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.4rem;
    font-size: 0.78rem;
    white-space: nowrap;
  }
}

/* ========================================================================
   M MOBILE LAYOUT (max-width: 767)
   ======================================================================== */

@media (max-width: 767px) {
  .conf-centering-stage {
    align-items: flex-start;
    padding: 1rem var(--container-padding);
  }

  /* Content-driven panel: single column, fills available width */
  .configurator {
    display: flex;
    flex-direction: column;
    width: calc(100% - 2 * var(--container-padding));
    max-width: 540px;
    height: auto;
    max-height: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  /* Header bar: back link left, product name centered */
  .conf-sidebar-header {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0.65rem 1.25rem;
    background: var(--color-image-panel);
    border-bottom: 1px solid var(--color-divider-soft);
  }

  .conf-sidebar-header .conf-back-link {
    margin-bottom: 0;
  }

  .conf-sidebar-header .conf-product-name {
    text-align: center;
    font-size: var(--text-lg);
  }

  /* Image area: block display, tighter padding than L */
  .conf-image-area {
    flex-shrink: 0;
    padding: 0.875rem 1.25rem;
    display: block;
    background: var(--color-image-panel);
  }

  /* Image frame slightly wider than L (85% vs 80%) to fill narrower panel */
  .conf-image-frame {
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-md);
    max-width: none;
    width: 85%;
    margin: 0 auto;
  }

  .conf-image-frame img {
    object-fit: cover;
  }

  /* Price bar hidden - context lives in the bottom footer */
  .conf-price-bar {
    display: none;
  }

  .conf-sidebar {
    flex: none;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--color-divider-soft);
    overflow: hidden;
  }

  .conf-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .conf-space-tabs {
    flex-shrink: 0;
  }

  /* Categories bounded to keep footer always in view */
  .conf-categories {
    max-height: 336px;
    overflow-y: auto;
  }

  /* Header reset button visible, right-aligned in the 3-column header grid */
  .conf-header-reset {
    display: inline-flex;
    justify-self: end;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    min-height: auto;
    transition: color var(--transition-fast);
  }

  .conf-header-reset:hover {
    color: var(--text-accent);
  }

  /* Footer: meta row hidden - three-zone row handles all info */
  .conf-price-meta-row {
    display: none;
  }

  /* Footer: flex column container */
  .conf-price-footer {
    display: flex;
    flex-direction: column;
    background: var(--color-image-panel);
  }

  /* Single row: three elements with equal visual spacing that scales naturally */
  .conf-price-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.85rem 1.4rem;
    gap: 0;
  }

  /* Estimated price - label above value */
  .conf-price-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    flex: none;
    text-align: center;
    margin-bottom: 0;
    padding: 0;
  }

  .conf-price-label {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0;
  }

  .conf-price-value {
    font-size: 0.95rem;
    font-weight: var(--weight-semibold);
    line-height: 1.2;
  }

  /* Selections - label above value */
  .conf-price-selections-xs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0;
  }

  .conf-price-selections-xs .conf-price-item-label {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1;
  }

  .conf-price-selections-xs .conf-price-item-value {
    font-size: 0.88rem;
    font-weight: var(--weight-semibold);
    line-height: 1.2;
    white-space: nowrap;
  }

  /* Quote button: compact, same visual weight as the text elements */
  .conf-price-action-row > .conf-quote-btn {
    width: auto;
    margin: 0;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.2rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

/* ========================================================================
   S RANGE (420-449px) - frame hugs phone edges
   ======================================================================== */

@media (min-width: 420px) and (max-width: 449px) {
  .conf-centering-stage {
    padding: 0.75rem 0.375rem;
    min-height: auto;
  }

  .configurator {
    width: calc(100% - 0.75rem);
  }

  .conf-categories {
    max-height: 288px;
  }

  /* Header reset button visible on S, right-aligned in the 3-column header grid */
  .conf-header-reset {
    display: inline-flex;
    justify-self: end;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    min-height: auto;
    transition: color var(--transition-fast);
  }

  .conf-header-reset:hover {
    color: var(--text-accent);
  }

  /* Footer: single unified row - meta row hidden */
  .conf-price-meta-row {
    display: none;
  }

  /* Footer: override inherited M range two-column grid */
  .conf-price-footer {
    display: flex;
    flex-direction: column;
    background: var(--color-image-panel);
  }

  /* Single row: three elements spread to edges, max room for price strings */
  .conf-price-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.85rem 0.9rem;
    gap: 0;
  }

  /* Estimated price - label above value */
  .conf-price-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    flex: none;
    text-align: center;
    margin-bottom: 0;
    padding: 0;
  }

  .conf-price-label {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0;
  }

  .conf-price-value {
    font-size: 0.95rem;
    font-weight: var(--weight-semibold);
    line-height: 1.2;
  }

  /* Selections - label above value */
  .conf-price-selections-xs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0;
  }

  .conf-price-selections-xs .conf-price-item-label {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1;
  }

  .conf-price-selections-xs .conf-price-item-value {
    font-size: 0.88rem;
    font-weight: var(--weight-semibold);
    line-height: 1.2;
    white-space: nowrap;
  }

  /* Quote button: compact, same visual weight as text elements */
  .conf-quote-btn {
    width: auto;
    margin: 0;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.2rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

/* ========================================================================
   XS RANGE (max-width: 420px)
   ======================================================================== */

@media (max-width: 420px) {
  /* Panel reaches screen edges on very small screens */
  .conf-centering-stage {
    padding: 0.75rem 0;
    min-height: auto;
  }

  .configurator {
    width: 100%;
    border-radius: 0;
  }

  .conf-sidebar-header {
    padding: 0.55rem 1rem;
  }

  /* Back link needs white-space: nowrap at 320px - 1fr column is too narrow otherwise */
  .conf-sidebar-header .conf-back-link {
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .conf-sidebar-header .conf-product-name {
    font-size: var(--text-base);
  }

  .conf-image-area {
    padding: 0.75rem 1rem;
  }

  /* Wider frame on narrow screens to make the most of available width */
  .conf-image-frame {
    width: 92%;
  }

  /* Four tabs on 390px need reduced font and padding to avoid crowding */
  .conf-space-tab {
    font-size: 0.8rem;
    padding: 0.65rem 0.25rem;
  }

  .conf-category-header {
    padding: 0.65rem 1.25rem;
  }

  /* Tighter scroll area to keep more footer visible */
  .conf-categories {
    max-height: 264px;
  }

  /* Narrower price column so option names get more room */
  .conf-option-price {
    min-width: 68px;
  }

  /* Header reset button visible on XS, right-aligned in the 3-column header grid */
  .conf-header-reset {
    display: inline-flex;
    justify-self: end;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    min-height: auto;
    transition: color var(--transition-fast);
  }

  .conf-header-reset:hover {
    color: var(--text-accent);
  }

  /* Footer: single unified row - meta row hidden, all info in one line */
  .conf-price-meta-row {
    display: none;
  }

  /* Footer: collapse inherited two-column grid to single column, action row fills it */
  .conf-price-footer {
    display: flex;
    flex-direction: column;
    background: var(--color-image-panel);
  }

  /* Single row: three elements spread to edges, max room for price strings */
  .conf-price-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.55rem 0.9rem;
    gap: 0;
  }

  /* Estimated price - label above value */
  .conf-price-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    flex: none;
    text-align: center;
    margin-bottom: 0;
    padding: 0;
  }

  .conf-price-label {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0;
  }

  .conf-price-value {
    font-size: 0.95rem;
    font-weight: var(--weight-semibold);
    line-height: 1.2;
  }

  /* Selections - label above value */
  .conf-price-selections-xs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0;
  }

  .conf-price-selections-xs .conf-price-item-label {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1;
  }

  .conf-price-selections-xs .conf-price-item-value {
    font-size: 0.88rem;
    font-weight: var(--weight-semibold);
    line-height: 1.2;
    white-space: nowrap;
  }

  /* Quote button: compact, same visual weight as text elements */
  .conf-quote-btn {
    width: auto;
    margin: 0;
    border-radius: var(--radius-sm);
    padding: 0.45rem 1rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

/* ========================================================================
   DESKTOP HEIGHT BALANCE AND GRID LAYOUT (XL, XXL)
   ======================================================================== */

@media (min-width: 1024px) {
  .configurator {
    height: 680px;
    grid-template-areas:
      "image header"
      "image sidebar";
    grid-template-rows: auto 1fr;
  }

  .conf-sidebar-header {
    grid-area: header;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: baseline;
    padding: 2rem 1.5rem 1.5rem;
  }
  .conf-sidebar-header .conf-back-link {
    margin-bottom: 0;
  }
  .conf-sidebar-header .conf-product-name {
    text-align: right;
  }
  .conf-header-reset {
    display: none;
  }
  .conf-image-area {
    grid-area: image;
  }
  .conf-sidebar {
    grid-area: sidebar;
  }
}

/* ========================================================================
   XL SCREEN ADJUSTMENTS (1024 - 1199)
   ======================================================================== */

@media (min-width: 1024px) and (max-width: 1199px) {
  :root {
    --sidebar-width: 360px;
  }

  .conf-image-area {
    padding: 1.5rem 1rem 1rem;
  }

  .conf-price-bar {
    width: min(100%, 400px);
  }

  .conf-space-tab {
    font-size: var(--text-xs);
  }

  .conf-category-selection {
    max-width: 120px;
  }

  .conf-price-label {
    font-size: 0.65rem;
  }

  .conf-price-value {
    font-size: 1.25rem;
  }
}

/* ========================================================================
   XXL SCREEN ADJUSTMENTS (1200+)
   ======================================================================== */

@media (min-width: 1200px) {
  .configurator {
    max-width: 1150px;
  }

  .conf-image-area {
    padding: 1.5rem 1rem 1rem;
  }

  .conf-image-frame {
    max-width: 880px;
    border-radius: 16px;
  }

  .conf-image-frame img {
    border-radius: 16px;
  }
}

/* ========================================================================
   PAGE FOOTER
   ======================================================================== */

.conf-page-footer {
  width: 100%;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--color-border-subtle);
  margin-top: auto;
}

.conf-footer-copyright {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
