/* ============================================================
   KIMANS REDESIGN — PRODUCTS MEGA-MENU ("B" pattern)
   Three panes on desktop: application categories (left) → models
   (middle) → live preview (right). On touch the drawer accordion in
   header.php takes over (styled at the bottom of this file).
   Tokens: Play type, amber #FEBB19, dark #0D0D0D, outline buttons.
   ============================================================ */

/* ---- Panel shell ---- */
.kx-mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #0D0D0D;
  border-bottom: 1px solid #1A1B1D;
  box-shadow: 0 26px 50px rgba(0, 0, 0, 0.55);
}
.kx-mega-inner {
  width: min(1200px, 100vw - 48px);
  margin: 0 auto;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 248px minmax(240px, 1fr) 408px;
  gap: 0;
  align-items: stretch;
}

/* ---- LEFT: application categories ---- */
.kx-mega-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid #1A1B1D;
  padding-right: 14px;
}
.kx-mega-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 12px 14px;
  font-family: var(--font-sans, 'Play', system-ui, sans-serif);
  font-size: 14px;
  font-weight: 700;
  color: #C4CCD4;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.kx-mega-cat:hover,
.kx-mega-cat.is-active { background: #161A1E; color: #fff; }
.kx-mega-cat.is-active { box-shadow: inset 2px 0 0 var(--accent, #FEBB19); }
.kx-mega-cat .kx-mega-cat-arrow { color: #6E7A85; transition: color .15s ease, transform .15s ease; }
.kx-mega-cat.is-active .kx-mega-cat-arrow { color: var(--accent, #FEBB19); transform: translateX(2px); }

/* ---- MIDDLE: models ---- */
.kx-mega-models { padding: 0 18px; min-width: 0; }
.kx-mega-modellist { list-style: none; margin: 0; padding: 0; display: none; }
.kx-mega-modellist.is-active { display: grid; gap: 2px; animation: kxMegaReveal .15s ease both; }
@keyframes kxMegaReveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.kx-mega-model {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: background .15s ease;
}
.kx-mega-model:hover,
.kx-mega-model.is-active { background: #161A1E; }
.kx-mega-model img {
  width: 44px; height: 44px; flex: none;
  object-fit: contain; background: #fff; border-radius: 5px; padding: 4px;
}
.kx-mega-model-txt { display: flex; flex-direction: column; min-width: 0; }
.kx-mega-model-name { color: #ECEFF2; font-size: 13.5px; font-weight: 700; line-height: 1.2; }
.kx-mega-model-one { color: #6E7A85; font-size: 11.5px; line-height: 1.35; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kx-mega-model:hover .kx-mega-model-name,
.kx-mega-model.is-active .kx-mega-model-name { color: var(--accent, #FEBB19); }

/* ---- RIGHT: live preview ---- */
.kx-mega-preview {
  border-left: 1px solid #1A1B1D;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.kx-mega-photo {
  aspect-ratio: 16 / 10;
  width: 100%;
  background: linear-gradient(160deg, #fff, #EEF1F4);
  border: 1px solid #1A1B1D;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 16px;
}
.kx-mega-photo img { max-width: 78%; max-height: 80%; object-fit: contain; mix-blend-mode: multiply; transition: opacity .12s ease; }
.kx-mega-pkicker { color: var(--accent, #FEBB19); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.kx-mega-pname { color: #fff; font-size: 19px; font-weight: 700; line-height: 1.15; margin: 7px 0 6px; }
/* Short "what's unique" line, sourced from the per-product USP. Clamped to 2 lines
   so a long USP can never push the CTA row off-screen. */
.kx-mega-pusp {
  margin: 4px 0 0;
  color: #9AA4AE;
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kx-mega-pusp[hidden] { display: none; }
/* CTA row — pinned to the bottom (margin-top:auto) so both buttons are always
   visible regardless of name/USP length. */
.kx-mega-pcta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
}
/* "View product" — filled amber so it reads clearly on the dark panel. */
.kx-mega-pview {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 18px;
  border: 1px solid var(--accent, #FEBB19);
  border-radius: 3px;
  background: var(--accent, #FEBB19);
  color: #0D0D0D;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.kx-mega-pview:hover { background: var(--accent-strong, #F5A800); border-color: var(--accent-strong, #F5A800); color: #0D0D0D; }
/* "Inquire" — secondary outline button sitting next to the filled "View product". */
.kx-mega-pinquire {
  display: inline-flex;
  align-items: center;
  padding: 11px 18px;
  border: 1px solid #2A3138;
  border-radius: 3px;
  background: transparent;
  color: #ECEFF2;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.kx-mega-pinquire:hover { border-color: var(--accent, #FEBB19); color: var(--accent, #FEBB19); background: #161A1E; }

/* ---- Footer helper row ---- */
.kx-mega-foot {
  border-top: 1px solid #1A1B1D;
  width: min(1200px, 100vw - 48px);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.kx-mega-foot > span { color: #9AA4AE; font-size: 13px; }
/* "Help me choose" — amber so it reads as the clear action on the dark foot row
   (was white, reported as too dark/low-contrast next to the dim utility links). */
.kx-mega-foot-link { color: var(--accent, #FEBB19); font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.kx-mega-foot-link:hover { color: var(--accent-strong, #F5A800); }

/* ---- Focus visibility (a11y) ---- */
.kx-mega-cat:focus-visible,
.kx-mega-model:focus-visible,
.kx-mega-pview:focus-visible,
.kx-mega-pinquire:focus-visible,
.kx-mega-foot-link:focus-visible {
  outline: 2px solid var(--accent, #FEBB19);
  outline-offset: 2px;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .kx-mega-modellist.is-active { animation: none; }
  .kx-mega-photo img, .kx-mega-cat, .kx-mega-model, .kx-mega-pview, .kx-mega-pinquire { transition: none; }
}

/* ============================================================
   TOUCH DRAWER ACCORDION (<=1024px) — the mega-menu fallback.
   Lives inside [data-kx-mobile-nav]; single-open accordion with
   56px thumbnail rows + one-liners.
   ============================================================ */
.kx-mnav-acc { border-bottom: 1px solid #161A1E; }
.kx-mnav-acc-head,
.kx-mnav-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: 0;
  color: #ECEFF2;
  font-family: var(--font-sans, 'Play', system-ui, sans-serif);
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.kx-mnav-acc-head { font-size: 16px; padding: 12px 0; }
.kx-mnav-acc-head svg, .kx-mnav-group-head svg { transition: transform .2s ease; color: #6E7A85; }
.kx-mnav-acc-head[aria-expanded="true"] svg,
.kx-mnav-group-head[aria-expanded="true"] svg { transform: rotate(180deg); }
.kx-mnav-acc-body { padding: 4px 0 10px; }
.kx-mnav-group { border-top: 1px solid #12161A; }
.kx-mnav-group-head { font-size: 14px; color: #C4CCD4; padding: 11px 6px; }
.kx-mnav-group-body { list-style: none; margin: 0; padding: 2px 0 8px; }
.kx-mnav-group-body li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 6px;
  text-decoration: none;
}
.kx-mnav-group-body img {
  width: 56px; height: 56px; flex: none;
  object-fit: contain; background: #fff; border-radius: 6px; padding: 5px;
}
.kx-mnav-group-body span { display: flex; flex-direction: column; min-width: 0; }
.kx-mnav-m-name { color: #ECEFF2; font-size: 14px; font-weight: 700; line-height: 1.2; }
.kx-mnav-m-one { color: #6E7A85; font-size: 12px; line-height: 1.35; margin-top: 2px; }
.kx-mnav-all { display: block; color: var(--accent, #FEBB19); font-weight: 700; font-size: 13.5px; padding: 12px 6px 4px; }
.kx-mnav-acc-head:focus-visible,
.kx-mnav-group-head:focus-visible,
.kx-mnav-group-body li a:focus-visible { outline: 2px solid var(--accent, #FEBB19); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .kx-mnav-acc-head svg, .kx-mnav-group-head svg { transition: none; }
}
