/* SafeWorld — menu.css
   Burger menu για κινητά και tablet. Σε desktop το μενού μένει όπως είναι. */

.header { position: relative; z-index: 50; }

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.menu-toggle:hover { border-color: var(--ink); }

.menu-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transition: background-color 0.2s ease;
}
.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease, top 0.25s ease;
}
.menu-icon::before { top: -7px; }
.menu-icon::after { top: 7px; }

/* Ανοιχτό: γίνεται Χ */
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { top: 0; transform: rotate(-45deg); }

.menu-backdrop { display: none; }

@media (max-width: 860px) {
  .header { flex-wrap: nowrap; }

  /* Χωρίς JavaScript το μενού μένει ορατό, για να δουλεύει πάντα. */
  .js .menu-toggle { display: inline-flex; }

  .js .nav {
    position: absolute;
    top: calc(100% - 4px);
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    padding: 12px;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(20, 33, 61, 0.16);
    font-size: 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }

  .js .header.is-open .nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
  }

  .js .nav a {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 14px;
  }
  .js .nav a:hover { background: var(--ground); color: var(--ink); }

  .js .nav .nav-cta {
    justify-content: center;
    margin-top: 8px;
    min-height: 56px;
  }
  .js .nav .nav-cta:hover { background: var(--teal-dark); color: #FFFFFF; }

  .js .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(20, 33, 61, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  }
  .js .menu-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0s;
  }

  body.menu-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-icon,
  .menu-icon::before,
  .menu-icon::after,
  .js .nav,
  .js .menu-backdrop { transition: none !important; }
}
