/* ALTEO r17: mobile reading space and a visible model in the first viewport.
   Load after alteo-upgrade-details.*.css. No DOM movement or desktop overrides. */
@media (max-width:820px) {
  html { scroll-padding-top:72px; }
  body { padding-bottom:0; }
  html[data-alteo-sticky-visible="true"] body {
    padding-bottom:calc(64px + env(safe-area-inset-bottom));
  }
  .site-header {
    transition:transform .24s cubic-bezier(.2,.65,.3,1);
    will-change:auto;
  }
  html[data-alteo-header-hidden="true"] .site-header {
    transform:translateY(calc(-100% - 1px));
    pointer-events:none;
  }
  html[data-alteo-header-hidden="true"] .site-header:has(:focus-visible) { transform:none; pointer-events:auto; }
  .site-header .header-inner {
    min-height:60px;
    gap:12px;
  }
  .site-header .brand img { width:112px; }
  .site-header .header-actions { gap:7px; }
  .site-header .lang-switch {
    min-height:44px;
    padding:2px;
    gap:0;
  }
  .site-header .lang-switch a {
    min-width:44px;
    min-height:44px;
    padding-inline:8px;
    font-size:12px;
  }
  .site-header .menu-button { width:44px; height:44px; }
  .site-header .main-nav { max-height:calc(100dvh - 60px); overflow-y:auto; }

  /* Default is hidden even before JavaScript/hydration. Root JS exposes it
     only after the hero, and removes the marker while a form/dialog is open. */
  .mobile-action-bar {
    display:none;
    padding:7px 10px calc(7px + env(safe-area-inset-bottom));
    grid-template-columns:48px minmax(0,1fr);
    gap:8px;
  }
  html[data-alteo-sticky-visible="true"] .mobile-action-bar:not(.is-hidden) { display:grid; }
  .mobile-action-bar .button { min-height:48px; font-size:14px; }
  .mobile-action-bar .mobile-call { min-height:48px; }

  /* The next model should not occupy a third of a short mobile screen
     throughout the configurator. Its existing controls remain in normal flow. */
  .upgrade-planner-layout>.upgrade-studio.scene-shell {
    position:relative;
    top:auto;
    z-index:auto;
  }
  .upgrade-planner .scene-topline { min-height:44px; }
  .upgrade-planner .scene-topline :is(button,.scene-reset) { width:44px; height:44px; }
  .upgrade-planner .scene-swatches button { width:44px; height:44px; }
  .upgrade-planner .scene-tools { flex-wrap:wrap; }
  .upgrade-planner .scene-actions button { min-height:44px; }
  .upgrade-planner .upgrade-finance button { min-height:44px; }
}

@media (max-width:820px) {
  .alteo-hero .container.upgrade-hero-grid {
    width:calc(100% - 32px);
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:0;
    min-height:0;
    padding:12px 0 28px;
  }
  .alteo-hero .upgrade-copy { display:contents; }
  .alteo-hero .upgrade-copy>.upgrade-product-switch {
    order:0;
    margin:0 0 8px;
    padding:2px;
    min-height:44px;
  }
  .alteo-hero .upgrade-product-switch a {
    display:flex;
    align-items:center;
    min-height:44px;
    padding:8px 16px;
    font-size:12px;
  }
  .alteo-hero .upgrade-copy>h1 {
    order:1;
    margin:0;
    max-width:none;
    font-size:clamp(30px,8.6vw,37px);
    line-height:1.08;
    letter-spacing:-.04em;
    text-wrap:balance;
  }
  .alteo-hero .upgrade-copy>h1>span { margin-top:3px; }
  /* The longer Russian promise stays complete and legible, usually on one
     line at normal font scaling. Wrapping remains allowed if the user zooms. */
  html[lang="ru"] .alteo-hero .upgrade-copy>h1>span {
    font-size:clamp(24px,6.8vw,29px);
    line-height:1.15;
    letter-spacing:-.04em;
  }
  .alteo-hero .upgrade-copy>.upgrade-promo-grid {
    order:2;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    margin:12px 0 0;
  }
  .alteo-hero .upgrade-promo {
    min-width:0;
    padding:10px 11px;
    border-radius:12px;
  }
  .alteo-hero .upgrade-promo b {
    margin:0 0 3px;
    font-size:11px;
    line-height:1.25;
    letter-spacing:0;
  }
  .alteo-hero .upgrade-promo strong {
    font-size:29px;
    line-height:1.08;
    letter-spacing:-.035em;
  }
  .alteo-hero .upgrade-promo small {
    margin:3px 0 0;
    font-size:11px;
    line-height:1.35;
  }
  .alteo-hero .upgrade-hero-grid>.upgrade-studio.scene-shell {
    order:3;
    width:100%;
    margin:10px 0 0;
    align-self:stretch;
  }
  .alteo-hero .scene-topline {
    min-height:44px;
    padding-inline:0;
    gap:8px;
  }
  .alteo-hero .scene-topline>span {
    min-width:0;
    font-size:10px;
    line-height:1.35;
    letter-spacing:.02em;
  }
  .alteo-hero .scene-topline :is(button,.scene-reset) {
    width:44px;
    height:44px;
    flex:none;
    font-size:23px;
  }
  .alteo-hero .kitchen-canvas {
    height:220px;
    height:clamp(164px,28svh,260px);
    min-height:0;
    aspect-ratio:auto;
  }
  .alteo-hero .scene-fallback { inset:4px 0; border-radius:12px; }
  .alteo-hero .upgrade-scene-badge {
    top:58px;
    right:0;
    padding:6px 9px;
    font-size:9px;
    line-height:1.3;
    letter-spacing:.02em;
  }
  .alteo-hero .scene-tools {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;
    gap:5px 8px;
    padding:6px 0 0;
  }
  .alteo-hero .scene-swatches { gap:3px; }
  .alteo-hero .scene-swatches button {
    width:44px;
    height:44px;
    padding:5px;
  }
  .alteo-hero .scene-swatches button>span { width:29px; height:29px; }
  .alteo-hero .scene-swatches>span { display:none; }
  .alteo-hero .scene-actions {
    display:flex;
    flex:1 1 auto;
    justify-content:flex-end;
    gap:5px;
  }
  .alteo-hero .scene-actions button {
    min-width:0;
    min-height:44px;
    font-size:11px;
    line-height:1.3;
    padding:8px 9px;
    gap:5px;
    white-space:normal;
  }
  .alteo-hero .scene-help {
    margin:6px 0 0;
    font-size:11px;
    line-height:1.4;
  }
  .alteo-hero .upgrade-copy>.upgrade-hero-actions {
    order:4;
    margin:14px 0 0;
    gap:6px;
  }
  .alteo-hero .upgrade-hero-actions>a.button {
    min-height:50px;
    font-size:14px;
    line-height:1.25;
    padding:12px 18px;
    width:100%;
    flex-basis:100%;
    justify-content:space-between;
  }
  .alteo-hero .upgrade-hero-actions>a:not(.button) {
    min-height:44px;
    display:inline-flex;
    align-items:center;
    font-size:13px;
  }
  .alteo-hero .upgrade-copy>p.upgrade-hero-visit {
    order:5;
    margin:7px 0 0;
    max-width:none;
    font-size:12px;
    line-height:1.6;
  }
  .alteo-hero .upgrade-copy>.eyebrow {
    order:6;
    margin:22px 0 0;
    font-size:10px;
    line-height:1.5;
  }
  .alteo-hero .upgrade-copy>p.upgrade-lead {
    order:7;
    font-size:14px;
    line-height:1.65;
    margin:9px 0 0;
    max-width:none;
  }
  .alteo-hero .upgrade-copy>.upgrade-proof {
    order:8;
    margin:20px 0 0;
    padding-top:16px;
  }
  .alteo-hero .upgrade-copy>.upgrade-hero-note {
    order:9;
    font-size:12px;
    line-height:1.6;
    margin:14px 0 0;
  }
  .alteo-hero .upgrade-hero-grid>.upgrade-inspiration {
    order:10;
    margin:28px -16px 0;
    padding-inline:16px;
  }
  .alteo-hero .upgrade-inspiration-photos { margin-inline:-16px; }
}

/* Two rows give every scene action a full touch target instead of compressing
   the Russian labels or the three swatches into tiny buttons. */
@media (max-width:420px) {
  .alteo-hero .scene-actions {
    flex-basis:100%;
    width:100%;
  }
  .alteo-hero .scene-actions button { flex:1; }
}
@media (max-width:820px) and (max-height:700px) {
  .alteo-hero .container.upgrade-hero-grid { padding-top:10px; }
  .alteo-hero .upgrade-copy>.upgrade-product-switch { margin-bottom:6px; }
  .alteo-hero .upgrade-copy>.upgrade-promo-grid { margin-top:10px; }
  .alteo-hero .upgrade-hero-grid>.upgrade-studio.scene-shell { margin-top:8px; }
  .alteo-hero .kitchen-canvas {
    height:166px;
    height:clamp(156px,26svh,182px);
  }
}
@media (prefers-reduced-motion:reduce) {
  html[data-alteo-header-hidden="true"] .site-header { transition:none; }
}

/* Default sticky state stays hidden even before the small behavior module starts. */
@media(max-width:820px){
  html:not([data-alteo-sticky-visible="true"]) .mobile-action-bar,
  html[data-alteo-offer-open="true"] .mobile-action-bar{transform:translateY(calc(110% + env(safe-area-inset-bottom,0px)));visibility:hidden;pointer-events:none}
  .site-header{transition:transform .22s ease}
  html[data-alteo-header-hidden="true"] .site-header{transform:translateY(-102%);pointer-events:none}
  .mobile-action-bar{transition:transform .22s ease,visibility .22s; padding-bottom:max(10px,env(safe-area-inset-bottom,0px))}
}
.alteo-comfort-dialog{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);margin:0;z-index:10020;padding:0;border:0;border-radius:24px;max-width:520px;width:calc(100vw - 32px);max-height:calc(100dvh - 32px);color:#143c30;background:#f6f7f2;box-shadow:0 24px 100px #001f19a6;overflow-y:auto;overscroll-behavior:contain}
.alteo-comfort-backdrop{position:fixed;inset:0;z-index:10019;background:#001e18b8;backdrop-filter:blur(4px)}
.alteo-comfort-dialog::backdrop{background:#001e18b8;backdrop-filter:blur(4px)}
.alteo-comfort-panel{position:relative;display:flex;flex-direction:column;align-items:stretch;gap:13px;padding:30px}
.alteo-comfort-close{position:absolute;top:10px;right:12px;width:44px;height:44px;display:grid;place-items:center;border:0;border-radius:50%;background:#e7ece5;color:#123b2f;font:400 28px/1 system-ui;cursor:pointer;z-index:1}
.alteo-comfort-eyebrow{display:block;padding-right:34px;color:#487263;font:700 10px/1.4 system-ui;text-transform:uppercase;letter-spacing:.1em}
.alteo-comfort-photo{height:140px;width:100%;object-fit:cover;object-position:center 55%;border-radius:12px}
.alteo-comfort-panel h2{margin:0;font:800 clamp(25px,5.5vw,34px)/1.06 system-ui,sans-serif;letter-spacing:-.04em}
.alteo-comfort-intro{margin:0;font:400 15px/1.45 system-ui,sans-serif;color:#587165}
.alteo-comfort-benefits{position:relative;overflow:hidden;display:flex;flex-direction:column;gap:8px;padding:18px 18px 22px;background:linear-gradient(135deg,#0c4b3b,#183f2f);border:1px solid #bd8c30;border-radius:16px;color:#fff;font:600 15px/1.35 system-ui}
.alteo-comfort-benefits strong{font-size:22px;line-height:1.15;color:#ffbe10;letter-spacing:-.02em}
.alteo-comfort-benefits>strong,.alteo-comfort-benefits>span:not(.alteo-comfort-highlight){position:relative;z-index:1}
.alteo-comfort-highlight{position:absolute;bottom:0;left:0;width:100%;height:4px;background:linear-gradient(90deg,#c88c17,#ffce4a,#c88c17);transform-origin:left;animation:alteo-offer-glow 4s ease-in-out infinite}
@keyframes alteo-offer-glow{0%,100%{opacity:.6}50%{opacity:1}}
.alteo-comfort-cta{justify-content:center;text-align:center;width:100%;min-height:52px;padding:14px 15px;font-size:15px;line-height:1.3}
.alteo-comfort-note{margin:0;font:400 12px/1.45 system-ui;color:#586e64;text-align:center}
.alteo-comfort-later{border:0;padding:7px;background:none;color:#2a5848;font:600 13px/1.2 system-ui;cursor:pointer;text-decoration:underline;text-underline-offset:3px;min-height:44px}
.alteo-comfort-leave{border:1px solid #c4d0c6;border-radius:11px;background:transparent;color:#365748;padding:10px 16px;min-height:44px;font:600 13px/1.3 system-ui;cursor:pointer}
.alteo-comfort-dialog :focus-visible{outline:3px solid #db9a00;outline-offset:3px}
@media(max-width:820px){
 .alteo-comfort-dialog{position:fixed;inset:0;transform:none;margin:0;width:100%;height:100%;height:100dvh;max-width:none;max-height:none;border-radius:0;display:none}
 .alteo-comfort-dialog[open]{display:flex;align-items:safe center;justify-content:center}
 .alteo-comfort-panel{width:min(100%,480px);gap:clamp(9px,1.5dvh,15px);padding:max(22px,env(safe-area-inset-top,0px)) max(20px,env(safe-area-inset-right,0px)) max(16px,env(safe-area-inset-bottom,0px)) max(20px,env(safe-area-inset-left,0px))}
 .alteo-comfort-photo{height:clamp(96px,19dvh,155px)}
 .alteo-comfort-panel h2{font-size:clamp(25px,5.8vw,34px)}
}
@media(max-height:740px){
 .alteo-comfort-photo{display:none}
 .alteo-comfort-panel{gap:9px;padding-top:20px;padding-bottom:16px}
 .alteo-comfort-panel h2{font-size:26px}
 .alteo-comfort-intro{font-size:13px}
 .alteo-comfort-benefits{padding:11px 13px}
 .alteo-comfort-dialog[data-offer-trigger="mobile_back"] .alteo-comfort-intro{display:none}
 .alteo-comfort-dialog[data-offer-trigger="mobile_back"] .alteo-comfort-panel{gap:8px}
}
@media(max-height:420px){
 .alteo-comfort-eyebrow,.alteo-comfort-intro{display:none}
 .alteo-comfort-panel{max-width:620px;padding:18px 24px;gap:8px}
 .alteo-comfort-panel h2{padding-right:30px;font-size:22px}
 .alteo-comfort-benefits{flex-direction:row;align-items:center;justify-content:space-between;gap:12px;font-size:12px}
 .alteo-comfort-benefits strong{font-size:15px}
 .alteo-comfort-cta{min-height:44px;padding:11px;font-size:14px}
 .alteo-comfort-note{font-size:11px}
 .alteo-comfort-later{min-height:44px;padding:4px}
}
@media(prefers-reduced-motion:reduce){.site-header,.mobile-action-bar{transition:none!important}.alteo-comfort-highlight{animation:none}}

/* Same authored model while WebGL warms up; no real-project scene photograph. */
.scene-shell .scene-fallback {background:none;border:0;box-shadow:none;overflow:visible}
.scene-shell .scene-fallback:before,.scene-shell .scene-fallback:after{display:none!important}
.scene-shell .scene-fallback .scene-model-poster{display:block;width:100%;height:100%;object-fit:contain;object-position:center;opacity:1;animation:none;filter:none;border-radius:0}
.scene-load-status{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:5px 9px;min-height:22px;margin:3px 0 0;color:#d4e5dc;font:500 11px/1.4 system-ui,sans-serif}
.upgrade-planner .scene-load-status{color:#526b5d}
.scene-shell[data-scene-state="ready"] .scene-load-status{visibility:hidden}
.scene-failed-note,.scene-retry{display:none}
.scene-shell[data-scene-state="fallback"] .scene-loading-note{display:none}
.scene-shell[data-scene-state="fallback"] .scene-failed-note{display:inline}
.scene-shell[data-scene-state="fallback"] .scene-retry{display:inline-flex;align-items:center;min-height:44px;padding:8px 14px;border:1px solid currentColor;border-radius:9px;background:none;color:inherit;font:700 12px/1.4 system-ui;cursor:pointer}
html[data-alteo-startup="fallback"] .scene-retry{display:none}
.scene-shell[data-scene-state="ready"] .scene-fallback{visibility:hidden;pointer-events:none}
@media(max-width:820px){.scene-load-status{font-size:10px}.scene-shell .scene-fallback{inset:0}}
