/* Casă 3D — Sin Power Solutions (panouri fotovoltaice) */
.house3d {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 8vw, 88px) 0;
}

.house3d .h2 {
  text-align: left;
}

.house3d .lead {
  text-align: left;
  margin: 12px 0 0;
}

.house3d__stage {
  display: grid;
  grid-template-columns: 1.55fr 0.85fr;
  gap: 26px;
  margin-top: 36px;
  align-items: stretch;
}

.house3d__canvas-wrap {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  border-radius: var(--radius-lg, 22px);
  background: #eaf4fa;
  box-shadow:
    inset 0 0 0 1px rgba(29, 53, 87, 0.1),
    0 18px 50px rgba(29, 53, 87, 0.1);
  transition: background 0.5s ease, box-shadow 0.5s ease;
}

.house3d__canvas-wrap.is-loading::after {
  content: attr(data-loading);
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding-top: 2.5rem;
  font-family: var(--font-body, inherit);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy, #1d3557);
  background: rgba(234, 244, 250, 0.72);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.house3d__canvas-wrap[data-mode="night"].is-loading::after {
  color: #e8eef5;
  background: rgba(15, 28, 46, 0.72);
}

.house3d__canvas-wrap.is-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  width: 28px;
  height: 28px;
  margin: -48px 0 0 -14px;
  border: 2.5px solid rgba(29, 53, 87, 0.2);
  border-top-color: var(--lime, #7ab82e);
  border-radius: 50%;
  animation: houseSpin 0.7s linear infinite;
  pointer-events: none;
}

.house3d__canvas-wrap[data-mode="night"].is-loading::before {
  border-color: rgba(255, 255, 255, 0.2);
  border-top-color: #7ab82e;
}

@keyframes houseSpin {
  to { transform: rotate(360deg); }
}

.house3d__canvas-wrap[data-mode="night"] {
  background: #0f1c2e;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 18px 50px rgba(15, 28, 46, 0.35);
}

.house3d__canvas-wrap[data-mode="night"] .house3d__hint {
  color: rgba(232, 238, 245, 0.7);
  background: rgba(15, 28, 46, 0.65);
  border-color: rgba(255, 255, 255, 0.12);
}

.house3d__canvas-wrap[data-mode="night"] .house3d__readout {
  background: rgba(15, 28, 46, 0.78);
  border-color: rgba(255, 255, 255, 0.12);
}

.house3d__canvas-wrap[data-mode="night"] .house3d__readout h3 {
  color: #fff;
}

.house3d__canvas-wrap[data-mode="night"] .house3d__readout p {
  color: rgba(232, 238, 245, 0.75);
}

#house-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
}

.house3d__hint {
  position: absolute;
  top: 16px;
  right: 18px;
  left: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted, #5a6a7a);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(29, 53, 87, 0.1);
  border-radius: 999px;
  padding: 8px 13px;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

/* Day / night switch — top left on canvas */
.house3d__tod {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(29, 53, 87, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(29, 53, 87, 0.12);
}

.house3d__canvas-wrap[data-mode="night"] .house3d__tod {
  background: rgba(15, 28, 46, 0.78);
  border-color: rgba(255, 255, 255, 0.14);
}

.house3d__tod-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.3s ease, transform 0.3s ease;
  padding: 0;
}

.house3d__tod-btn:hover {
  transform: scale(1.04);
}

.house3d__tod-btn.on {
  background: rgba(122, 184, 46, 0.2);
}

.house3d__canvas-wrap[data-mode="night"] .house3d__tod-btn.on {
  background: rgba(158, 182, 212, 0.28);
}

.house3d__tod-ico {
  width: 18px;
  height: 18px;
  display: block;
  position: relative;
}

.house3d__tod-ico--sun {
  border-radius: 50%;
  background: #f0b429;
  box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.28);
}

.house3d__tod-ico--moon {
  border-radius: 50%;
  background: #c5d0e0;
  box-shadow: inset -5px 0 0 0 #e8eef5;
}

.house3d__canvas-wrap[data-mode="night"] .house3d__tod-ico--moon {
  background: #e8eef5;
  box-shadow: inset -5px 0 0 0 #1a2a3d;
}

.house3d__readout {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(29, 53, 87, 0.1);
  border-radius: 16px;
  pointer-events: none;
  max-width: 460px;
  box-shadow: 0 12px 32px rgba(29, 53, 87, 0.08);
}

.house3d__readout h3 {
  font-family: var(--font-display, "Outfit", sans-serif);
  font-size: 21px;
  margin: 0 0 6px;
  color: var(--navy, #1d3557);
}

.house3d__readout p {
  font-size: 14px;
  color: var(--muted, #5a6a7a);
  font-weight: 500;
  margin: 0;
  line-height: 1.45;
}

.house3d__panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.house3d__panel-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted, #5a6a7a);
  margin: 8px 0 4px;
}

.house3d__panel-label:first-child {
  margin-top: 0;
}

.house3d__modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.house3d__modes--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.house3d__mode--warn.on {
  border-color: rgba(225, 29, 72, 0.5);
  background: rgba(225, 29, 72, 0.1);
  box-shadow: 0 8px 22px rgba(225, 29, 72, 0.1);
}

.house3d__legend[data-mode="nopv"] .house3d__legend-item[data-leg="pv"] {
  display: none;
}

.house3d__legend:not([data-mode="nopv"]) .house3d__legend-item[data-leg="nopv"] {
  display: none;
}

.house3d__mode {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  padding: 14px 12px;
  border: 1.5px solid rgba(29, 53, 87, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--navy, #1d3557);
  font-family: var(--font-body, inherit);
  transition: background 0.35s, border-color 0.35s, transform 0.35s, box-shadow 0.35s;
}

.house3d__mode:hover {
  background: #fff;
  transform: translateY(-2px);
}

.house3d__mode.on {
  border-color: rgba(122, 184, 46, 0.55);
  background: rgba(122, 184, 46, 0.14);
  box-shadow: 0 8px 22px rgba(122, 184, 46, 0.12);
}

.house3d__mode[data-house-mode="night"].on {
  border-color: rgba(29, 53, 87, 0.45);
  background: rgba(29, 53, 87, 0.1);
  box-shadow: 0 8px 22px rgba(29, 53, 87, 0.1);
}

.house3d__mode-ico {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  position: relative;
  background: var(--sky-soft, #d6eef8);
}

.house3d__mode[data-house-mode="night"] .house3d__mode-ico {
  background: #e8eef5;
}

.house3d__mode-ico--sun::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f0b429;
  box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.25);
}

.house3d__mode-ico--moon::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #d7dee8;
  /* Crescent: cut with same bg as icon pill — one moon, not two balls */
  box-shadow: inset -5px 0 0 0 #e8eef5;
}

.house3d__mode-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  width: 100%;
}

.house3d__modes .house3d__mode:not(:has(.house3d__mode-ico)) {
  padding-left: 14px;
}

.house3d__mode-text strong {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.house3d__mode-text small {
  font-size: 0.72rem;
  color: var(--muted, #5a6a7a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.house3d__legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.house3d__legend-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(29, 53, 87, 0.1);
}

.house3d__legend-item .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-top: 4px;
  background: var(--c, #7ab82e);
  box-shadow: 0 0 10px var(--c, #7ab82e);
  flex: none;
}

.house3d__legend-item strong {
  display: block;
  font-size: 0.88rem;
  color: var(--navy, #1d3557);
}

.house3d__legend-item p {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: var(--muted, #5a6a7a);
  line-height: 1.4;
}

.house3d__svc {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 14px 16px;
  border: 1px solid rgba(29, 53, 87, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--navy, #1d3557);
  font-family: var(--font-body, inherit);
  font-weight: 700;
  font-size: 14px;
  transition: background 0.35s var(--ease, ease), border-color 0.35s, color 0.35s, transform 0.35s;
}

.house3d__svc .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--c, #7ab82e);
  box-shadow: 0 0 10px var(--c, #7ab82e);
  flex: none;
  opacity: 0.55;
  transition: opacity 0.3s, box-shadow 0.3s;
}

.house3d__svc:hover {
  background: #fff;
  transform: translateX(3px);
}

.house3d__svc.on {
  background: rgba(122, 184, 46, 0.14);
  border-color: rgba(122, 184, 46, 0.55);
  color: var(--navy, #1d3557);
}

.house3d__svc.on .dot {
  opacity: 1;
  box-shadow: 0 0 14px var(--c, #7ab82e), 0 0 4px var(--c, #7ab82e);
}

.house3d__cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.house3d__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  background: var(--lime, #7ab82e);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  border: none;
  border-radius: 14px;
  text-align: center;
  transition: background 0.35s, transform 0.35s;
}

.house3d__cta:hover {
  background: var(--lime-dark, #5f9420);
}

.house3d__cta:active {
  transform: scale(0.98);
}

.house3d__cta--call {
  background: var(--navy, #1d3557);
}

.house3d__cta--call:hover {
  background: #12253d;
}

@media (max-width: 900px) {
  .house3d {
    padding: 2rem 0;
  }

  .house3d__stage {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 1.25rem;
  }

  .house3d__canvas-wrap {
    min-height: 480px;
  }

  #house-canvas {
    image-rendering: auto;
  }

  .house3d__modes--3 {
    grid-template-columns: 1fr;
  }

  .house3d__hint {
    display: none;
  }

  .house3d__readout {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 14px 15px;
    max-width: none;
  }

  .house3d__readout h3 {
    font-size: 17px;
  }
}
