/* Main navigation: Services mega menu, dropdowns, phone menu */

/* ===== Desktop nav ===== */
.mk-row { position: relative; }
.mk-row .logo { flex: none; }
.mk-nav { flex: 1; display: flex; justify-content: center; }
.mk-nav__list { display: flex; align-items: center; gap: 34px; list-style: none; margin: 0; padding: 0; }
.mk-top, .mk-toggle { position: relative; background: none; border: 0; cursor: pointer; font-family: var(--font-display); font-weight: 600;
  font-size: 0.96rem; color: var(--ink); padding: 8px 0; display: inline-flex; align-items: center; gap: 2px; }
.mk-toggle .material-icons { font-size: 19px; transition: transform 0.2s ease; }
.mk-top:hover, .mk-toggle:hover, .mk-toggle[aria-expanded="true"] { color: var(--cta); }
.mk-toggle[aria-expanded="true"] .material-icons, .mk-has:hover .mk-toggle .material-icons { transform: rotate(180deg); }
.mk-top.is-current, .mk-toggle.is-current { color: var(--cta); }
.mk-top.is-current::after, .mk-toggle.is-current::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--cta); }
/* Hover bridge so the pointer can travel from the button down into the panel */
.mk-has { position: relative; }
.mk-has--mega { position: static; }
.mk-has:hover .mk-toggle::before { content: ""; position: absolute; left: -24px; right: -24px; top: 100%; height: 34px; }

.mk-panel { position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%); z-index: 50; min-width: 300px;
  background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 12px;
  opacity: 0; visibility: hidden; transition: opacity 0.16s ease, visibility 0.16s; }
.mk-panel ul { list-style: none; margin: 0; padding: 0; }
.mk-panel--mega { top: 100%; left: 24px; right: 24px; transform: none; padding: 22px; border-radius: 0 0 var(--radius) var(--radius); }
.mk-has:hover > .mk-panel, .mk-has:focus-within > .mk-panel, .mk-panel.is-open { opacity: 1; visibility: visible; }

.mk-mega { display: grid; grid-template-columns: repeat(3, 1fr) 230px; gap: 18px; }
.mk-col h3 { font-family: var(--font-display); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--accent); margin: 0 0 6px; padding: 0 10px; }
.mk-link { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.mk-link:hover, .mk-link[aria-current="page"] { background: var(--bg); }
.mk-link:hover b, .mk-link[aria-current="page"] b { color: var(--cta); }
.mk-link .material-icons { font-size: 19px; color: var(--cta); margin-top: 1px; }
.mk-link b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; }
.mk-link small { display: block; color: var(--accent); font-size: 0.78rem; line-height: 1.35; }
.mk-feature { background: #373B40; border-radius: var(--radius-sm); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.mk-feature > .material-icons { color: #f3915f; }
.mk-feature b { font-family: var(--font-display); font-size: 1rem; color: #fff; }
.mk-feature p { margin: 0; font-size: 0.85rem; color: rgba(255,255,255,0.8); }
.mk-feature .btn { margin-top: auto; align-self: flex-start; }
.mk-panel__foot { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; font-size: 0.85rem; color: var(--accent); }
.mk-panel__foot a { color: var(--cta); font-weight: 700; }

.mk-cta { gap: 16px; }
.mk-phone { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; color: var(--ink); white-space: nowrap; }
.mk-phone .material-icons { font-size: 18px; color: var(--cta); }
.mk-phone:hover { color: var(--cta); }

@media (max-width: 1180px) {
  .mk-nav__list { gap: 24px; }
  .mk-row { gap: 18px; }
  .mk-phone span:last-child { display: none; }
  .mk-mega { grid-template-columns: repeat(3, 1fr); }
  .mk-feature { grid-column: 1 / -1; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .mk-feature .btn { margin: 0 0 0 auto; }
}

/* ===== Phone menu ===== */
@media (max-width: 980px) {
  .mk-nav { display: none; }
  .mobile-nav.mk-mobile { padding: 4px 24px 20px; max-height: calc(100vh - 80px); overflow-y: auto; }
  .mk-mlink { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-weight: 700; color: var(--ink); }
  .mk-mlink--quiet { color: var(--accent); font-weight: 600; font-size: 0.9rem; border-bottom: 0; }
  .mk-acc { border-bottom: 1px solid var(--line); }
  .mk-acc summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 13px 0;
    font-family: var(--font-display); font-weight: 700; color: var(--ink); }
  .mk-acc summary::-webkit-details-marker { display: none; }
  .mk-acc summary .material-icons { color: var(--accent); transition: transform 0.2s; }
  .mk-acc[open] summary .material-icons { transform: rotate(180deg); }
  .mk-acc h4 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); margin: 8px 0 2px; }
  .mk-acc ul { list-style: none; margin: 0 0 10px; padding: 0; }
  .mobile-nav .mk-acc li a { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border: 0; font-size: 0.92rem; font-weight: 600; }
  .mk-acc li .material-icons { font-size: 19px; color: var(--cta); }
  .mk-mcta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
  .mk-mcta a { justify-content: center; text-align: center; margin: 0 !important; }
  .mk-btn-ghost { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 999px; padding: 10px;
    font-family: var(--font-display); font-weight: 700; color: var(--ink); }
  .mk-btn-ghost .material-icons { font-size: 18px; color: var(--cta); }
}

/* ===== Phone number in the menu bar on phones ===== */
.mk-mphone { display: none; }
@media (max-width: 980px) {
  .mk-row { gap: 12px; }
  .mk-row .logo { margin-right: auto; }
  .mk-row .logo img { height: 34px; }
  .mk-mphone { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-family: var(--font-display); font-weight: 700;
    font-size: 0.88rem; color: var(--cta); }
  .mk-mphone .material-icons { font-size: 18px; }
  .topbar__contact a[href^="tel:"] { display: none; }
}
@media (max-width: 380px) {
  .mk-mphone { font-size: 0.8rem; }
  .mk-row .logo img { height: 30px; }
}

/* ===== Menu animation: slide down + links cascade in ===== */
/* Orange underline grows from the center on hover */
.mk-top::after, .mk-toggle::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--cta);
  transform: scaleX(0); transition: transform 0.25s ease; }
.mk-top:hover::after, .mk-toggle:hover::after, .mk-has:hover .mk-toggle::after, .mk-toggle[aria-expanded="true"]::after,
.mk-top.is-current::after, .mk-toggle.is-current::after { transform: scaleX(1); }
.mk-toggle .material-icons { transition: transform 0.3s cubic-bezier(.3, 1.4, .5, 1); }

/* Panels slide down as they fade in */
.mk-panel { transition: opacity 0.22s ease, visibility 0.22s, transform 0.28s cubic-bezier(.2, .8, .2, 1); }
.mk-panel:not(.mk-panel--mega) { transform: translateX(-50%) translateY(-10px); }
.mk-panel--mega { transform: translateY(-10px); }
:is(.mk-has:hover, .mk-has:focus-within) > .mk-panel:not(.mk-panel--mega), .mk-panel.is-open:not(.mk-panel--mega) { transform: translateX(-50%); }
:is(.mk-has:hover, .mk-has:focus-within) > .mk-panel--mega, .mk-panel--mega.is-open { transform: none; }

/* Links fade up one after another, column by column */
.mk-panel li, .mk-feature, .mk-panel__foot { opacity: 0; transform: translateY(8px); transition: opacity 0.25s ease, transform 0.3s ease; }
:is(.mk-has:hover > .mk-panel, .mk-has:focus-within > .mk-panel, .mk-panel.is-open) :is(li, .mk-feature, .mk-panel__foot) {
  opacity: 1; transform: none; transition-delay: calc(var(--c, 0) * 50ms + var(--i, 0) * 35ms + 60ms);
}
.mk-col:nth-child(2) { --c: 1; } .mk-col:nth-child(3) { --c: 2; }
.mk-panel li:nth-child(2) { --i: 1; } .mk-panel li:nth-child(3) { --i: 2; } .mk-panel li:nth-child(4) { --i: 3; }
.mk-panel li:nth-child(5) { --i: 4; } .mk-panel li:nth-child(6) { --i: 5; }
.mk-feature { --c: 3; --i: 1; } .mk-panel__foot { --c: 3; --i: 4; }

/* Icons nudge right on hover */
.mk-link .material-icons { transition: transform 0.2s ease; }
.mk-link:hover .material-icons { transform: translateX(3px) scale(1.1); }

@media (prefers-reduced-motion: reduce) {
  .mk-panel, .mk-panel li, .mk-feature, .mk-panel__foot, .mk-top::after, .mk-toggle::after, .mk-link .material-icons, .mk-toggle .material-icons {
    transition: opacity 0.15s ease, visibility 0.15s !important;
  }
  .mk-panel--mega, .mk-panel li, .mk-feature, .mk-panel__foot, .mk-link:hover .material-icons { transform: none !important; }
  .mk-panel:not(.mk-panel--mega) { transform: translateX(-50%) !important; }
}

/* ===== Dark mode: logo with white lettering ===== */
.logo__dark { display: none; }
:root[data-theme="dark"] .logo__light { display: none; }
:root[data-theme="dark"] .logo__dark { display: inline; }
