/* "Dizajniraj svoj prostor": rooms on the left, picture in the middle, panels underneath */
.viz {
  --ink: #2b1d14;
  --soft: #7a685a;
  --line: #e6dccf;
  --accent: #9a6a3f;
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-areas: "rooms stage" ". panels";
  gap: 20px 28px;
  margin-top: 36px;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
}

.viz [hidden] { display: none !important; }

/* Rooms: a quiet vertical list, the active one marked with a warm bar */
.viz-rooms { grid-area: rooms; display: flex; flex-direction: column; gap: 4px; align-self: start; }
.viz-rooms button {
  position: relative;
  text-align: left;
  font: inherit;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 300;
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--soft);
  background: none;
  border: 0;
  border-left: 2px solid var(--line);
  padding: 12px 0 12px 18px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.viz-rooms button:hover { color: var(--ink); }
.viz-rooms button[aria-pressed="true"] { color: var(--ink); border-left-color: var(--accent); }

/* Picture */
.viz-stage {
  grid-area: stage;
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 4px;
  background: #efe7dc;
}
.viz-before, .viz-after { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* "After" photo is revealed from the handle to the right edge */
.viz-after { clip-path: inset(0 0 0 var(--pos, 50%)); transition: opacity .35s ease; }
.viz-after.is-loading { opacity: 0; }

/* Slider handle: thin cream line with a round grip */
.viz-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%);
  width: 2px; margin-left: -1px;
  background: #fbf6ef;
  box-shadow: 0 0 12px rgba(24, 13, 6, .35);
  pointer-events: none;
  z-index: 2;
}
.viz-handle span {
  position: absolute; top: 50%; left: 50%;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: #fbf6ef;
  box-shadow: 0 2px 14px rgba(24, 13, 6, .35);
}
.viz-handle span::before, .viz-handle span::after {
  content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -5px;
  border: 5px solid transparent;
}
.viz-handle span::before { left: 9px; border-right-color: var(--ink); }
.viz-handle span::after { right: 9px; border-left-color: var(--ink); }
/* Invisible range input on top does the dragging (mouse, touch and keyboard) */
.viz-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; z-index: 3;
  -webkit-appearance: none; appearance: none;
}
.viz-stage:has(.viz-range:focus-visible) .viz-handle span { outline: 2px solid var(--accent); outline-offset: 3px; }
.viz-tag {
  position: absolute; top: 16px; z-index: 1;
  padding: 5px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; letter-spacing: .02em;
  color: #fbf6ef; background: rgba(24, 13, 6, .5);
  pointer-events: none;
}
.viz-tag-before { left: 16px; }
.viz-tag-after { right: 16px; }
/* Missing photo: a small note on top of whatever is showing */
.viz-soon {
  position: absolute; top: 16px; right: 16px; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px; border-radius: 999px;
  background: rgba(24, 13, 6, .6);
  background-repeat: no-repeat; background-size: 26px 26px; background-position: 6px center;
}
.viz-soon::before { content: ""; width: 26px; height: 26px; }
.viz-soon span { color: #fbf6ef; font-size: .8rem; font-weight: 500; }
.viz-stage.no-before { background: #efe7dc; }
.viz-stage.no-before .viz-soon { inset: 0; top: 0; right: 0; border-radius: 0; justify-content: center; background: none; }
.viz-stage.no-before .viz-soon::before { display: none; }
.viz-stage.no-before .viz-soon span { color: var(--soft); font-size: .95rem; }
.viz-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px 22px 16px;
  color: #fbf6ef;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 300;
  font-size: 1.15rem;
  background: linear-gradient(0deg, rgba(24, 13, 6, .6), rgba(24, 13, 6, 0));
}

/* Panels: round-cornered swatches with the name underneath */
.viz-panels { grid-area: panels; display: flex; gap: 14px; flex-wrap: wrap; }
.viz-panels button {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 84px;
  padding: 0;
  font: inherit;
  font-size: .82rem;
  font-weight: 500;
  color: var(--soft);
  background: none;
  border: 0;
  cursor: pointer;
}
.viz-panels img {
  width: 72px; height: 72px; object-fit: cover; display: block;
  border-radius: 50%;
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color .2s, transform .2s;
}
.viz-panels button:hover img { transform: scale(1.05); }
.viz-panels button[aria-pressed="true"] { color: var(--ink); }
.viz-panels button[aria-pressed="true"] img { outline-color: var(--accent); }

/* Call button under the visualizer */
.viz-cta { margin: 36px 0 0; text-align: center; }
.viz-call {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  background: #2b1d14;
  color: #fbf6ef;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 1rem; font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.viz-call::before {
  content: ""; width: 18px; height: 18px; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.viz-call:hover { background: #9a6a3f; }
.viz-call:focus-visible { outline: 2px solid #9a6a3f; outline-offset: 4px; }

.viz button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Phone: rooms become a scrollable row above the picture, panels a row below */
@media (max-width: 800px) {
  .viz { grid-template-columns: 1fr; grid-template-areas: "rooms" "stage" "panels"; gap: 16px; }
  .viz-rooms { flex-direction: row; overflow-x: auto; gap: 8px; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .viz-rooms button {
    flex: none;
    font-family: inherit; font-size: .92rem; font-weight: 500;
    border: 1px solid var(--line); border-radius: 999px;
    padding: 9px 16px;
  }
  .viz-rooms button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fbf6ef; }
  .viz-stage { aspect-ratio: 4 / 3; }
  .viz-panels { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 6px 16px; scrollbar-width: none; }
  .viz-panels button { flex: none; width: 70px; }
  .viz-panels img { width: 58px; height: 58px; }
}
