/* Scandi – Kontaktný formulár (dock) v1.0.0 */
.scd {
  --scd-red: #d7193f;
  --scd-red-dark: #b5102f;
  --scd-ink: #303030;
  --scd-muted: #6f6f6f;
  --scd-bg: #edeef0;
  font-family: inherit;
}

/* Checkbox ostáva prístupný z klávesnice (Tab + medzerník), ale je neviditeľný. */
.scd-toggle {
  position: fixed;
  right: 20px;
  bottom: 16px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Tlačidlo ---------- */
.scd-btn {
  position: fixed;
  right: 20px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 99990;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 300px;
  min-height: 64px;
  padding: 10px 18px 10px 20px;
  box-sizing: border-box;
  border-radius: 12px;
  background: var(--scd-red);
  color: #fff;
  box-shadow: 0 6px 22px rgba(21, 29, 67, .22);
  cursor: pointer;
  user-select: none;
  transition: background .2s, transform .2s, box-shadow .2s;
}
.scd-btn:hover { background: var(--scd-red-dark); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(21, 29, 67, .28); }
.scd-toggle:focus-visible + .scd-btn { outline: 3px solid #111; outline-offset: 3px; }

.scd-ico { flex: 0 0 28px; width: 28px; height: 28px; }
.scd-txt {
  flex: 1 1 auto;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}
.scd-txt small {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 400;
  opacity: .95;
}
.scd-arrow { flex: 0 0 auto; font-size: 26px; font-weight: 700; line-height: 1; }

/* ---------- Panel s formulárom ---------- */
.scd-panel {
  position: fixed;
  right: 20px;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  z-index: 99992;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 420px;
  max-width: calc(100vw - 40px);
  height: min(680px, calc(100vh - 130px));
  box-sizing: border-box;
  overflow: hidden;
  border-top: 5px solid var(--scd-red);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
  /* Zatvorený panel je ďaleko mimo obrazovky → prehliadač nenačíta iframe (loading="lazy"),
     kým ho návštevník neotvorí. Web sa tým nespomalí. */
  transform: translateX(6000px);
  visibility: hidden;
  opacity: 0;
  transition: opacity .2s ease, visibility 0s linear .2s;
}
.scd-toggle:checked ~ .scd-panel {
  transform: none;
  visibility: visible;
  opacity: 1;
  transition: opacity .2s ease;
}

.scd-overlay {
  position: fixed;
  inset: 0;
  z-index: 99991;
  display: none;
  background: rgba(0, 0, 0, .35);
  cursor: pointer;
}
.scd-toggle:checked ~ .scd-overlay { display: block; }

.scd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px 18px;
  color: var(--scd-ink);
}
.scd-head strong { display: block; font-size: 18px; line-height: 1.2; }
.scd-head span { display: block; font-size: 13px; color: var(--scd-muted); }
.scd-close {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f2f2f2;
  color: var(--scd-ink);
  font-size: 24px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
}
.scd-close:hover { background: #e4e4e4; }

/* Lišta „Scroll down / Otvoriť v novom okne“ – panel aj stránka Kontakt */
.scd-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 18px 12px;
  color: var(--scd-muted, #6f6f6f);
  font-size: 13px;
}
.scd-bar b, .scd-bar a { color: var(--scd-red, #d7193f); }
.scd-bar a { text-decoration: underline; text-underline-offset: 3px; }

.scd-view { position: relative; min-height: 0; background: var(--scd-bg, #edeef0); }
.scd-view iframe {
  position: absolute !important;
  inset: 0;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  border: 0 !important;
}

/* ---------- Stránka Kontakt: kompaktná karta namiesto 1150–2200 px ---------- */
.scd-card {
  --scd-red: #d7193f;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 680px;
  margin: 0 0 24px;
  overflow: hidden;
  border-top: 5px solid var(--scd-red);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
}
.entry-content .scd-card iframe.contact-gform { height: 100% !important; }

/* GeneratePress „hore“ tlačidlo posunieme nad dock */
body.scd-active .generate-back-to-top { bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }

/* ---------- Mobil: lišta cez celú šírku + panel na celú obrazovku ---------- */
@media (max-width: 767px) {
  body.scd-active { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  .scd-btn {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-height: 60px;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, .18);
  }
  .scd-btn:hover { transform: none; }
  .scd-txt { font-size: 18px; }
  .scd-txt small { font-size: 12.5px; }

  .scd-panel {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
  }
  .scd-overlay { display: none !important; }

  .scd-card { height: min(640px, 78vh); }
  body.scd-active .generate-back-to-top { bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; }
}

@media (prefers-reduced-motion: reduce) {
  .scd-btn, .scd-panel { transition: none !important; }
}

@media print { .scd { display: none !important; } }
