/* ================================================== */
/* Accessibility, safe-area, language switcher, consent */
/* ================================================== */

/* Mobile menu button: meet minimum target size (padding expands hit area) */
@media (max-width: 1023px) {
  .ldv-hamburger {
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
    padding: 12px 8px;
    align-self: center;
  }
  .ldv-hamburger span {
    max-width: 30px;
    margin-left: auto;
    margin-right: auto;
  }
  .ldv-hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .ldv-hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* Focus visibility */
.ldv-nav-link:focus-visible,
.ldv-float-btn:focus-visible,
.ldv-hamburger:focus-visible,
.ldv-scroll-btn:focus-visible,
.ldv-faq-q:focus-visible,
.ldv-lang-btn:focus-visible,
.ldv-lang-option:focus-visible,
.ldv-consent-btn:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

/* Center wrapped nav links (long translations on mobile) */
.ldv-nav-link {
  text-align: center;
  overflow-wrap: break-word;
}

/* Mobile overlay: softer type + side padding so long translations don't hit the viewport edge */
@media (max-width: 1023px) {
  nav.ldv-nav-wrapper .ldv-nav-menu {
    gap: 28px;
    padding: 0 16px;
  }
  nav.ldv-nav-wrapper .ldv-nav-menu .ldv-nav-link {
    font-size: 26px !important;
    letter-spacing: 0.12em;
    line-height: 1.25;
    max-width: 100%;
  }
}

/* Floating CTAs: safe area on notched phones */
.ldv-floating-actions {
  bottom: max(40px, env(safe-area-inset-bottom, 0px) + 16px);
  right: max(40px, env(safe-area-inset-right, 0px) + 12px);
}
@media (max-width: 767px) {
  .ldv-floating-actions {
    bottom: max(24px, env(safe-area-inset-bottom, 0px) + 12px);
    right: max(16px, env(safe-area-inset-right, 0px) + 8px);
  }
}

/* ================================================== */
/* Language switcher                                    */
/* ================================================== */

.ldv-lang-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: 'Montserrat', sans-serif;
  z-index: 1001;
}

/* Desktop: pinned to the right grid column, vertically centered with nav links */
@media (min-width: 1024px) {
  .ldv-nav-container > .ldv-lang-wrap {
    grid-column: 3;
    justify-self: end;
    align-self: center;
  }
}

/* Mobile: switcher sits directly to the left of the hamburger in the top nav bar.
   Higher specificity (nav.ldv-nav-wrapper …) beats the inline grid rule in each HTML. */
@media (max-width: 1023px) {
  nav.ldv-nav-wrapper .ldv-nav-container {
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    padding: 0 20px;
  }
  nav.ldv-nav-wrapper .ldv-nav-container > .ldv-lang-wrap {
    grid-column: 2;
    justify-self: end;
    align-self: center;
    margin: 0;
  }
  nav.ldv-nav-wrapper .ldv-nav-container > .ldv-hamburger {
    grid-column: 3;
  }
}

@media (max-width: 400px) {
  nav.ldv-nav-wrapper .ldv-nav-container {
    gap: 8px;
    padding: 0 14px;
  }
  .ldv-lang-btn {
    padding: 0 8px;
    gap: 6px;
    letter-spacing: 0.1em;
  }
}

.ldv-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ldv-lang-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
}
.ldv-lang-wrap.is-open .ldv-lang-btn {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
}
.ldv-lang-globe,
.ldv-lang-chev {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.85);
}
.ldv-lang-globe svg { width: 14px; height: 14px; }
.ldv-lang-chev svg { width: 10px; height: 10px; }
.ldv-lang-chev {
  transition: transform 0.2s ease;
}
.ldv-lang-wrap.is-open .ldv-lang-chev {
  transform: rotate(180deg);
}
.ldv-lang-current {
  min-width: 22px;
  text-align: center;
}

/* Panel */
.ldv-lang-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(10, 10, 10, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 1100;
}
.ldv-lang-wrap.is-open .ldv-lang-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ldv-lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: 13px;
  text-align: start;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ldv-lang-option:hover,
.ldv-lang-option:focus {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.ldv-lang-option[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.ldv-lang-option[aria-selected="true"]::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  margin-inline-start: 6px;
}
.ldv-lang-option-name {
  font-weight: 600;
}
.ldv-lang-option-code {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.45);
}

/* RTL tweaks */
html[dir="rtl"] .ldv-lang-panel {
  right: auto;
  left: 0;
}
html[dir="rtl"] .ldv-lang-btn {
  letter-spacing: normal;
}

/* ================================================== */
/* Consent banner                                       */
/* ================================================== */

.ldv-consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom, 0px) + 8px);
  z-index: 1200;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease;
  font-family: 'Montserrat', sans-serif;
}
.ldv-consent.is-hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
.ldv-consent-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  padding: 16px 18px;
  max-width: 1200px;
  margin: 0 auto;
}
.ldv-consent-text {
  flex: 1 1 260px;
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 1.5;
}
.ldv-consent-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}
.ldv-consent-link {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-decoration: underline;
}
.ldv-consent-link:hover {
  color: #fff;
}
.ldv-consent-btn {
  padding: 10px 18px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  transition: background 0.2s ease, color 0.2s ease;
}
.ldv-consent-decline:hover {
  background: rgba(255, 255, 255, 0.08);
}
.ldv-consent-accept {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.ldv-consent-accept:hover {
  background: rgba(255, 255, 255, 0.85);
}

/* ================================================== */
/* Reduced motion                                       */
/* ================================================== */

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