/* =========================
   Fonts / Headings
   ========================= */

@font-face {
  font-family: "Vag Rounded";
  src: url("assets/fonts/VAG-Rounded-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Headings überall mit VAG */
h1, h2, h3, h4, h5, h6 {
  font-family: "Vag Rounded";
  font-weight: 200;
  letter-spacing: .2px;
}

/* =========================
   Global Variables / Base
   ========================= */

:root{
  /* Header-Höhen */
  --topbarH: 36px;
  --logobarH: 72px;
  --headerH: calc(var(--topbarH) + var(--logobarH));

  /* Sticky offset (Designstudio) */
  --stickyTop: var(--headerH);

  /* Brand */
  --hawoGreen: #0b6b2b;
  --hawoGreenDark: #0a3a2c;

  /* Page */
  --containerMax: 1280px;
  --containerPad: 20px;

  /* Theme defaults (werden von JS überschrieben) */
  --bg: #ffffff;
  --fg: #111111;
}

*{ box-sizing: border-box; }

html, body { height: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  transition: background-color .18s ease, color .18s ease;
}

/* Container wie auf hawo */
.container{
  width: 100%;
  max-width: var(--containerMax);
  margin: 0 auto;
  padding: 0 var(--containerPad);
}

/* =========================
   Sticky Header (Shop-like)
   ========================= */

.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Grüner Balken */
.top-green{
  height: var(--topbarH);
  background: var(--hawoGreenDark);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 16px;
}

.top-phone{
  color: #fff;
  width: 100%;
  text-decoration: none;
  letter-spacing: .2px;
  text-align: right;
  gap: 8px;
  font-size: 14px;
  line-height: 1;
  opacity: .95;
}
.top-phone:hover{ opacity: 1; text-decoration: underline; }

.phone-icon{ font-size: 16px; }

/* Logo-Zeile */
.logo-row{
  height: var(--logobarH);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,.10);
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.logo-link{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-img{
  height: 46px;
  width: auto;
  display: block;
}

.logo-text{
  font-weight: 900;
  font-size: 40px;
  color: #111;
  letter-spacing: .5px;
}

/* =========================
   Footer
   ========================= */

.footer{
  margin-top: 0;
  padding: 4px 0;
  background: var(--hawoGreenDark);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;

  font-size: 12px;
  font-weight: 650;
  color: #fff;
}

.footer a{
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.footer a:hover{
  border-bottom: 1px solid var(--hawoGreen);
}

@media (max-width: 720px){
  .footer{ margin-top: 28px; gap: 18px; }
}

/* ============================================================
   DESIGNSTUDIO (scoped) – alles nur innerhalb .designstudio
   ============================================================ */

.designstudio{
  /* Scoped Vars */
  --ds-bg: #ffffff;
  --ds-fg: #111111;
  --ds-muted: rgba(0,0,0,.55);

  --ds-accent: #23A23D;

  --ds-left: 360px;
  --ds-right: 190px;
  --ds-gap: 28px;

  --ds-swatch: 112px;
  --ds-swgap: 18px;

  --ds-border: rgba(0,0,0,.18);

  /* Designstudio übernimmt NICHT automatisch body bg/fg.
     Wenn du das willst, setzt du im JS den body oder .designstudio. */
  background: var(--ds-bg);
  color: var(--ds-fg);
  transition: background-color .18s ease, color .18s ease;
}

/* Seitencontainer */
.designstudio .page{
  max-width: var(--containerMax);
  margin: 0 auto;
  padding: 18px 16px 40px;
}

/* Layout: links/mitte + Platz rechts für Right-Rail */
.designstudio .layout{
  display: grid;
  grid-template-columns: var(--ds-left) 1fr;
  gap: var(--ds-gap);
  padding-right: calc(var(--ds-right) + var(--ds-gap));
}

/* Text */
.designstudio h1{
  margin: 8px 0 6px;
  font-size: 44px;
}

.designstudio .note{
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--ds-muted);
}

/* Suche */
.designstudio .searchbar{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.designstudio .searchbar input{
  width: min(560px, 100%);
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 10px;
  background: rgba(255,255,255,.75);
}

.designstudio .searchbar button{
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 10px;
  background: rgba(255,255,255,.75);
  cursor: pointer;
}
.designstudio .searchbar button:hover{ background: rgba(255,255,255,.92); }

/* Sticky Swatches-Leiste */
.designstudio .swatches-top{
  position: sticky;
  top: var(--stickyTop);
  z-index: 10;
  padding: 10px 0 12px;

  /* Du hast es angepasst – bleibt so */
  background: color-mix(in srgb, var(--ds-bg) 70%, white 0%);
  backdrop-filter: blur(6px);
}

.designstudio .swatches-meta{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: rgba(0,0,0,.55);
  font-size: 12px;
  font-weight: 650;
  margin-top: 8px;
}

.designstudio .badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.55);
}

.designstudio .dot{
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0,0,0,.25);
  background: #fff;
}

/* Kollektionen */
.designstudio .collections{
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.designstudio .collection-btn{
  font-family: "Vag Rounded";
  text-align: left;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 24px;
  line-height: 1.1;
  color: var(--ds-fg);
  cursor: pointer;
}
.designstudio .collection-btn:hover{ text-decoration: underline; }

.designstudio .collection-btn[aria-selected="true"]{
  background: rgba(0,0,0,.70);
  color: #fff;
  padding: 8px 10px;
  border-radius: 0;
  text-decoration: none;
  font-weight: 400;
}

/* Grid + Swatches */
.designstudio .msg{
  color: rgba(0,0,0,.65);
  font-weight: 650;
  font-size: 13px;
  margin-top: 6px;
}

.designstudio .grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--ds-swatch), 1fr));
  gap: var(--ds-swgap);
  margin-top: 10px;
}

.designstudio .swatch{
  aspect-ratio: 1 / 1;
  border: 1px solid var(--ds-border);
  background: #eee;
  border-radius: 0;
  cursor: pointer;
  position: relative;
  padding: 0;
  transition: transform .08s ease;
}
.designstudio .swatch:hover{ transform: translateY(-1px); }

.designstudio .swatch[aria-selected="true"]{
  outline: 3px solid rgba(255,255,255,.78);
  outline-offset: 2px;
}

/* Label */
.designstudio .swatch__label{
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1.1;
  opacity: .95;
}
.designstudio .swatch__label--darkText{
  color: rgba(0,0,0,.78);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.designstudio .swatch__label--lightText{
  color: rgba(255,255,255,.95);
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}

/* Right Rail (Desktop fixed) */
.designstudio .right-rail{
  position: fixed;
  right: 18px;
  top: calc(var(--headerH) + 18px);
  width: var(--ds-right);
  z-index: 9;
  display: grid;
  gap: 10px;
}

.designstudio .template{
  width: 100%;
  padding: 0;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.20);
  border-radius: 0;
  cursor: pointer;
}
.designstudio .template[aria-selected="true"]{
  outline: 3px solid color-mix(in srgb, var(--ds-accent) 55%, white 45%);
  outline-offset: 2px;
}
.designstudio .template img{
  width: 100%;
  height: auto;
  display: block;
}

.designstudio .roof{ margin-top: 4px; }
.designstudio .roof__label{
  font-family: "Vag Rounded";
  font-size: 22px;
  margin: 6px 0 6px;
}
.designstudio .roof__colors{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.designstudio .roof__chip{
  width: 22px;
  height: 22px;
  border: 1px solid rgba(0,0,0,.25);
  border-radius: 0;
  background: #777;
  padding: 0;
  cursor: pointer;
}

/* Mobile */
@media (max-width: 980px){
  .designstudio{
    --ds-left: 1fr;
    --ds-right: 1fr;
    --ds-swatch: 70px;
    --ds-swgap: 10px;
  }

  .designstudio .layout{
    grid-template-columns: 1fr;
    padding-right: 100px;
  }

  .designstudio .right-rail{
    position: fixed;
    right: 10px;
    top: 120px;
    width: 100px;
    z-index: 30;
    /* damit sie nicht die ganze Seite "frisst" */
    max-height: calc(100vh - 20px);
    overflow: auto;                 /* falls Dach + 2 Bilder zu hoch */
    -webkit-overflow-scrolling: touch
  }

  .designstudio h1{ font-size: 34px; }
  .designstudio .collection-btn{ font-size: 20px; }
  .designstudio .roof__label{ font-size: 18px; }
}


/* ============================================================
   PREVIEW (scoped) – alles nur innerhalb body.preview
   ============================================================ */

body.preview{
  /* Preview nutzt ebenfalls --bg/--fg (aus URL Parametern) */
}

.preview .wrap{
  display: grid;
  place-items: center;
  padding: 18px;
}

.preview .stage{
  width: min(1100px, 96vw);
  aspect-ratio: 16 / 9;
  position: relative;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 8px 30px rgba(0,0,0,.14);
  overflow: hidden;
}

.preview .stage img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.preview .info{
  position: absolute;
  left: 14px;
  bottom: 14px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(0,0,0,.12);
  padding: 10px 12px;
  max-width: calc(100% - 28px);
  font-size: 13px;
  font-weight: 650;
  color: rgba(0,0,0,.78);
}

.preview .info .title{
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.preview .info .row{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preview .chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.6);
}

.preview .dot{
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0,0,0,.25);
  background: var(--bg);
}

.preview .small{
  font-size: 12px;
  color: rgba(0,0,0,.60);
}

.preview #disclaimer{
  margin-top: 6px;
  opacity: .9;
}

.preview .toolbar{
  width: min(1100px, 96vw);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.preview .btn{
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.18);
  background: rgba(255,255,255,.75);
  cursor: pointer;
  font-weight: 700;
}
.preview .btn:hover{ background: rgba(255,255,255,.92); }

@media (max-width: 720px){
  .preview .stage{ aspect-ratio: 4 / 3; }
  .preview .info{ font-size: 12px; }
  .preview .toolbar{ flex-direction: column; align-items: stretch; }
}