/* Global enhancements (a11y, layout safety, small UX polish) */
:root { color-scheme: light; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { line-height: 1.6; }

*, *::before, *::after { box-sizing: border-box; }

img, svg, video { max-width: 100%; height: auto; }

.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #4a90e2;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #4a90e2;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

main {
  overflow-wrap: anywhere;
  word-break: break-word;
}

main img,
main svg,
main video,
main iframe {
  max-width: 100%;
  height: auto;
}

main .flex > * {
  min-width: 0;
}

main .comparison-table,
main .table-scroll {
  max-width: 100%;
}

@media (max-width: 767px) {
  .comparison-table table {
    min-width: 100%;
  }
}

a:focus-visible, button:focus-visible, [role="button"]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 1000;
  padding: 0.5rem 0.75rem;
  background: #fff;
  color: #111827;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  transform: translateY(-200%);
  transition: transform 0.15s ease;
}
.skip-link:focus { transform: translateY(0); }

.code-block, pre, code {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 640px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* Button disabled state (keeps existing visual system, improves UX) */
.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Cookie banner + toast (small, native look, no new visual system) */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  padding: 0.75rem;
}

.cookie-banner__inner {
  max-width: 64rem;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  padding: 0.85rem 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.cookie-banner__text {
  margin: 0;
  color: #111827;
  font-size: 0.95rem;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cookie-banner__btn {
  padding: 0.55rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.cookie-banner__btn--primary {
  background: linear-gradient(135deg, #4a90e2, #28a745);
  color: #fff;
  box-shadow: 0 6px 18px rgba(74,144,226,0.25);
}

.cookie-banner__btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(74,144,226,0.3);
}

.cookie-banner__btn--secondary {
  background: #fff;
  border: 1px solid rgba(17,24,39,0.18);
  color: #111827;
}

.cookie-banner__btn--secondary:hover {
  background: rgba(17,24,39,0.03);
}

.cookie-banner__btn:focus-visible {
  outline: 3px solid rgba(74,144,226,0.5);
  outline-offset: 2px;
}

.cookie-banner--hide {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 10px);
  opacity: 0;
  z-index: 1100;
  background: rgba(17,24,39,0.95);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  max-width: min(34rem, calc(100vw - 2rem));
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast--show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 480px) {
  .cookie-banner__inner {
    align-items: flex-start;
    flex-direction: column;
  }
  .cookie-banner__actions {
    width: 100%;
  }
  .cookie-banner__btn {
    width: 100%;
  }
}

/* Mobile drawer: slide in from the right */
@media (max-width: 767px) {
  .mobile-menu-trigger {
    margin-left: auto;
    margin-right: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  [data-mobile-menu-button="true"] {
    margin-left: auto;
  }

  #mobile-menu-btn {
    margin-left: auto;
    display: inline-flex;
  }

  #mobile-menu-btn {
    position: relative;
    z-index: 80;
  }

  #mobile-menu {
    position: fixed;
    top: 4rem;
    right: 0;
    left: auto;
    width: min(85vw, 320px);
    height: calc(100% - 4rem);
    overflow-y: auto;
    background: #ffffff;
    box-shadow: -12px 0 30px rgba(0,0,0,0.18);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 60;
  }

  #mobile-menu:not(.hidden) {
    transform: translateX(0);
  }
}
