/* Silbersee Resort – ILOCA Popup-Widget (Variante 2)
 * Auf der SILBERSEE-WEBSITE einbinden, nicht im ILOCA Custom CSS.
 * !important ist notwendig: Das ILOCA-Skript setzt Inline-Abmessungen.
 */
#ilocaWB {
  --ss-wbe-width: min(80vw, 1280px);
  --ss-wbe-height: min(88dvh, 960px);
  --ss-wbe-radius: 24px;
  --ss-wbe-header: 60px;
  --ss-wbe-fg: var(--color-fg-default, #313C48);
  --ss-wbe-bg: var(--color-bg-bright, #FFFFFF);
  --ss-wbe-surface: var(--color-bg-surface, #EFE9DF);

  position: fixed !important;
  inset: 0 !important;
  display: grid !important;
  place-items: center !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: rgba(0, 0, 0, .4) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: var(--ss-wbe-fg);
  animation: none !important;
  transition: none !important;
  isolation: isolate;
}

/* Ein eigener Rand oberhalb des iframe haelt den Schliessen-Button
 * von Navigation, Sprachauswahl und Formularen des Portals fern.
 */
#ilocaWB > iframe#ilocaWBFrame {
  display: block !important;
  box-sizing: border-box !important;
  width: var(--ss-wbe-width) !important;
  max-width: calc(100vw - 24px) !important;
  height: var(--ss-wbe-height) !important;
  max-height: calc(100dvh - 24px) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-top: var(--ss-wbe-header) solid var(--ss-wbe-bg) !important;
  border-radius: var(--ss-wbe-radius) !important;
  background: var(--ss-wbe-bg) !important;
  box-shadow: none !important;
}

#ilocaWB::before {
  content: "Buchung";
  position: fixed;
  z-index: 1;
  top: calc((100dvh - var(--ss-wbe-height)) / 2);
  left: calc((100vw - var(--ss-wbe-width)) / 2 + 24px);
  display: flex;
  align-items: center;
  height: var(--ss-wbe-header);
  max-width: calc(var(--ss-wbe-width) - 104px);
  overflow: hidden;
  color: var(--ss-wbe-fg);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  pointer-events: none;
}

#ilocaWB > div:has(> a[href="javascript:ilocaWB.close();"]) {
  position: fixed !important;
  z-index: 2 !important;
  top: calc((100dvh - var(--ss-wbe-height)) / 2 + 8px) !important;
  right: calc((100vw - var(--ss-wbe-width)) / 2 + 12px) !important;
  width: 44px !important;
  height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
}

#ilocaWB a[href="javascript:ilocaWB.close();"] {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--ss-wbe-surface) !important;
  color: var(--ss-wbe-fg) !important;
  font-size: 0 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background-color 220ms ease, color 220ms ease !important;
}

#ilocaWB a[href="javascript:ilocaWB.close();"]::before,
#ilocaWB a[href="javascript:ilocaWB.close();"]::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 2px;
  border: 0;
  border-radius: 1px;
  background: currentColor;
  pointer-events: none;
}
#ilocaWB a[href="javascript:ilocaWB.close();"]::before { transform: rotate(45deg); }
#ilocaWB a[href="javascript:ilocaWB.close();"]::after { transform: rotate(-45deg); }
#ilocaWB a[href="javascript:ilocaWB.close();"]:is(:hover, :focus-visible) {
  background: var(--ss-wbe-fg) !important;
  color: var(--ss-wbe-bg) !important;
}
#ilocaWB a[href="javascript:ilocaWB.close();"]:focus-visible {
  outline: 2px solid var(--color-corporate-pastellviolett, #A38995);
  outline-offset: 3px;
}
body:has(#ilocaWB) { overflow: hidden !important; }

@media (max-width: 767px) {
  #ilocaWB {
    --ss-wbe-width: calc(100vw - 24px);
    --ss-wbe-height: calc(100dvh - 24px);
    --ss-wbe-radius: 18px;
  }
  #ilocaWB::before { left: 30px; }
}

/* Bei niedrigen Querformat-Fenstern bleibt die Maske voll bedienbar. */
@media (min-width: 768px) and (max-height: 540px) {
  #ilocaWB { --ss-wbe-height: calc(100dvh - 24px); }
}
@media (prefers-reduced-motion: reduce) {
  #ilocaWB a[href="javascript:ilocaWB.close();"] { transition: none !important; }
}
