:root {
  --casa360-ink: #1e1b16;
  --casa360-paper: #f6f2ea;
  --casa360-accent: var(--ac, #3e6b8f);
  --casa360-muted: #8e8374;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.casa360 {
  display: block;
}

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

.casa360__trigger {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 116px;
  padding: 22px 24px;
  overflow: hidden;
  border: 1px solid rgba(30, 27, 22, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 15%, rgba(62, 107, 143, 0.2), transparent 33%),
    linear-gradient(135deg, #27231d, #151310);
  color: #faf6ec;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 22px 55px -38px rgba(30, 27, 22, 0.75);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.casa360__trigger::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, transparent, #000);
}

.casa360__trigger:hover {
  transform: translateY(-2px);
  border-color: rgba(62, 107, 143, 0.72);
  box-shadow: 0 28px 70px -42px rgba(30, 27, 22, 0.9);
}

.casa360__trigger:focus-visible,
.casa360 button:focus-visible,
.casa360 a:focus-visible {
  outline: 3px solid #e8c37a;
  outline-offset: 3px;
}

.casa360__trigger-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  font: 700 14px ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: -0.03em;
}

.casa360__trigger-icon::before,
.casa360__trigger-icon::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.casa360__trigger-icon::before {
  inset: 8px -8px;
}

.casa360__trigger-icon::after {
  inset: -8px 8px;
}

.casa360__trigger-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.casa360__trigger-copy strong {
  font: 400 clamp(25px, 3vw, 34px) "Instrument Serif", Georgia, serif;
}

.casa360__trigger-copy small {
  color: rgba(250, 246, 236, 0.7);
  font: 500 12px "Instrument Sans", system-ui, sans-serif;
}

.casa360__trigger-arrow {
  position: relative;
  z-index: 1;
  font: 300 32px/1 system-ui, sans-serif;
  transition: transform 180ms ease;
}

.casa360__trigger:hover .casa360__trigger-arrow {
  transform: translateX(4px);
}

.casa360__modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  box-sizing: border-box;
  padding: 0;
  place-items: center;
  font-family: "Instrument Sans", system-ui, sans-serif;
}

.casa360__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 11, 9, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: casa360-fade 200ms ease both;
}

.casa360__dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #171511;
  color: #faf6ec;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.55);
  animation: casa360-enter 240ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.casa360__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
  padding: 12px 16px 12px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.casa360__heading {
  min-width: 0;
}

.casa360__eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #c9b897;
  font: 600 9.5px ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.18em;
}

.casa360__title {
  overflow: hidden;
  margin: 0;
  font: 400 clamp(22px, 2.6vw, 31px)/1.1 "Instrument Serif", Georgia, serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.casa360__header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.casa360__share,
.casa360__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.07);
  color: #faf6ec;
  cursor: pointer;
}

.casa360__share {
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  font: 600 11px "Instrument Sans", system-ui, sans-serif;
}

.casa360__close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font: 300 29px/1 system-ui, sans-serif;
}

.casa360__share:hover,
.casa360__close:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.13);
}

.casa360__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  min-height: 0;
}

.casa360__stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, #333028, #171511 65%);
}

.casa360__viewer,
.casa360__preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.casa360__viewer {
  z-index: 2;
}

.casa360__preview {
  z-index: 1;
  object-fit: cover;
  filter: saturate(0.92) brightness(0.72);
}

.casa360__state {
  position: absolute;
  z-index: 4;
  inset: 50% auto auto 50%;
  display: flex;
  width: min(430px, calc(100% - 48px));
  box-sizing: border-box;
  padding: 24px;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  background: rgba(23, 21, 17, 0.87);
  text-align: center;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.casa360__state-title {
  font: 400 25px/1.15 "Instrument Serif", Georgia, serif;
}

.casa360__state-copy {
  max-width: 38ch;
  color: rgba(250, 246, 236, 0.7);
  font-size: 13px;
  line-height: 1.55;
}

.casa360__spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: #e8c37a;
  border-radius: 50%;
  animation: casa360-spin 800ms linear infinite;
}

.casa360__fallback-actions {
  display: flex;
  margin-top: 6px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.casa360__fallback-link,
.casa360__retry {
  margin-top: 6px;
  padding: 11px 17px;
  border: 1px solid #faf6ec;
  border-radius: 999px;
  background: #faf6ec;
  color: #1e1b16;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.casa360__retry {
  background: transparent;
  color: #faf6ec;
  font-family: inherit;
  cursor: pointer;
}

.casa360__sidebar {
  display: flex;
  min-height: 0;
  padding: 22px 18px 18px;
  overflow-y: auto;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: #1e1b16;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.casa360__description {
  margin: 0 4px 17px;
  color: rgba(250, 246, 236, 0.68);
  font-size: 13px;
  line-height: 1.55;
}

.casa360__scene-summary {
  margin: 0 4px 9px;
  color: #d8c7a7;
  font: 600 9.5px ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.casa360__scenes {
  display: grid;
  gap: 7px;
}

.casa360__scene {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 62px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  color: #faf6ec;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.casa360__scene:hover:not(:disabled),
.casa360__scene.is-active {
  border-color: rgba(62, 107, 143, 0.9);
  background: rgba(62, 107, 143, 0.17);
}

.casa360__scene:disabled {
  color: rgba(250, 246, 236, 0.42);
  cursor: not-allowed;
}

.casa360__scene-number {
  color: #c6b28e;
  font: 600 9.5px ui-monospace, Menlo, Consolas, monospace;
}

.casa360__scene-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.casa360__scene-copy strong {
  overflow: hidden;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.casa360__scene-copy small {
  color: rgba(250, 246, 236, 0.46);
  font-size: 10px;
}

.casa360__scene-arrow {
  font-size: 17px;
}

.casa360__hint {
  margin: 18px 4px 16px;
  color: rgba(250, 246, 236, 0.48);
  font-size: 10.5px;
  line-height: 1.5;
}

.casa360__contact {
  display: block;
  margin-top: auto;
  padding: 13px 16px;
  border-radius: 999px;
  background: var(--casa360-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

/* Hotspots personalizados sobre o Pannellum. */
.casa360-hotspot-scene,
.casa360-hotspot-info {
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--casa360-accent);
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.4);
}

.casa360-hotspot-scene {
  width: 48px;
  height: 48px;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.casa360-hotspot-scene::after {
  content: "↑";
  display: grid;
  height: 100%;
  place-items: center;
  color: #fff;
  font: 700 21px/1 system-ui, sans-serif;
}

.casa360-hotspot-scene--right::after {
  content: "→";
}

.casa360-hotspot-scene--left::after {
  content: "←";
}

.casa360-hotspot-scene--down::after {
  content: "↓";
}

.casa360-hotspot-scene:hover,
.casa360-hotspot-scene:focus-visible {
  background: #2f739d;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.28),
    0 5px 20px rgba(0, 0, 0, 0.48);
}

.casa360-hotspot-scene:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.casa360-hotspot-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  width: max-content;
  max-width: min(220px, 62vw);
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(20, 18, 15, 0.94);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
  color: #fff;
  font: 650 12px/1.35 system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.casa360-hotspot-scene:hover .casa360-hotspot-label,
.casa360-hotspot-scene:focus-visible .casa360-hotspot-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.casa360-hotspot-info {
  width: 34px;
  height: 34px;
}

.casa360-hotspot-info::after {
  content: "i";
  display: grid;
  height: 100%;
  place-items: center;
  color: #fff;
  font: 700 13px/1 Georgia, serif;
}

@media (prefers-reduced-motion: reduce) {
  .casa360-hotspot-scene,
  .casa360-hotspot-label {
    transition: none;
  }
}

@keyframes casa360-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes casa360-enter {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

@keyframes casa360-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 820px) {
  .casa360__modal {
    padding: 0;
  }

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

  .casa360__content {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(280px, 62vh) minmax(0, 1fr);
  }

  .casa360__sidebar {
    padding: 14px 14px max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 0;
  }

  .casa360__hint {
    display: none;
  }

  .casa360__description {
    margin: 0 4px 9px;
    font-size: 11.5px;
    line-height: 1.4;
  }

  .casa360__scenes {
    grid-auto-columns: minmax(190px, 72vw);
    grid-auto-flow: column;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .casa360__scene {
    scroll-snap-align: start;
  }

  .casa360__contact {
    margin-top: 12px;
  }
}

@media (max-width: 520px) {
  .casa360__trigger {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 15px;
    padding: 19px;
  }

  .casa360__trigger-icon {
    width: 54px;
    height: 54px;
  }

  .casa360__trigger-arrow {
    display: none;
  }

  .casa360__header {
    min-height: 64px;
    padding: max(9px, env(safe-area-inset-top)) 10px 9px 15px;
  }

  .casa360__eyebrow {
    display: none;
  }

  .casa360__title {
    max-width: 52vw;
  }

  .casa360__share {
    width: 42px;
    padding: 0;
  }

  .casa360__share span:last-child {
    display: none;
  }

  .casa360__content {
    grid-template-rows: minmax(260px, 59vh) minmax(0, 1fr);
  }

  .casa360__state {
    width: calc(100% - 28px);
    padding: 18px;
  }

  .casa360__state-title {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .casa360 *,
  .casa360 *::before,
  .casa360 *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
