/*
 * Mira — modal styles
 */

/* ── Menu icon button ────────────────────────────────────────────────────── */

.mira-menu-item {
  display: flex;
  align-items: center;
}

.mira-menu-link,
.mira-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 6px;
  margin: 0;
  cursor: pointer;
  color: inherit;
  line-height: 1;
  text-decoration: none;
  transition: opacity 0.15s;
}

.mira-menu-link:hover,
.mira-menu-btn:hover,
.mira-menu-link:focus-visible,
.mira-menu-btn:focus-visible {
  opacity: 0.6;
  outline: none;
  background: none;
}

.mira-icon {
  display: block;
  flex-shrink: 0;
}

/* ── Modal overlay ───────────────────────────────────────────────────────── */

.mira-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.mira-modal[hidden] {
  display: none !important;
}

.mira-modal--open {
  opacity: 1;
  pointer-events: auto;
}

/* Transparent backdrop — catches clicks outside to close */
.mira-modal__backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  cursor: pointer;
  z-index: 0;
}

/* ── Modal box + full-width separator ───────────────────────────────────── */

.mira-modal__box {
  position: relative;
  z-index: 1;
  /* Full width white background */
  background: #fff;
  /* No individual border — separator is handled below */
  border: none;
  padding: 12px 0;
  transform: translateY(-4px);
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
  /* Full-width grey separator at bottom */
  border-bottom: 1px solid #e0e0e0;
}

.mira-modal--open .mira-modal__box {
  transform: translateY(0);
}

/* ── Inner search field — bordered box centered in the white area ────────── */

.mira-modal__form {
  margin: 0 auto;
  width: min(720px, calc(100% - 48px));
}

.mira-modal__field {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 2px solid #111;
  background: #fff;
}

.mira-modal__field-icon {
  display: flex;
  align-items: center;
  padding: 0 12px 0 16px;
  color: #888;
  flex-shrink: 0;
  pointer-events: none;
}

.mira-modal__input {
  flex: 1;
  border: none;
  outline: none;
  background: #fff;
  padding: 14px 8px;
  font-size: 18px;
  color: #111;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  margin: 0;
}

.mira-modal__input::placeholder {
  color: #aaa;
}

.mira-modal__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.mira-modal__submit {
  flex-shrink: 0;
  border: none;
  border-left: 2px solid #111;
  background: #111;
  color: #fff;
  padding: 0 24px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
  line-height: normal;
  margin: 0;
}

.mira-modal__submit:hover,
.mira-modal__submit:focus-visible {
  background: #333;
  outline: none;
}

/* Hidden elements */
.mira-modal__close,
.mira-modal__hint {
  display: none;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .mira-modal,
  .mira-modal__box {
    transition: none;
  }
}

/* ── Hide menu-link text until JS replaces it with the SVG icon ──────────── */

a[href="#mira-search"] {
  font-size: 0;
  line-height: 0;
}

a[href="#mira-search"] .mira-icon {
  font-size: 1rem;
}
