/* Header baru mowilex.com — lihat inc/mwx-header.php */
:root {
  --mwx-red: #e10912;
  --mwx-red-dark: #b8070f;
  --mwx-ink: #1d1d1f;
  --mwx-muted: #5d5d63;
  --mwx-line: #ececf0;
  --mwx-navy: #12152b;
  --mwx-h: 80px;
  --mwx-h-scrolled: 64px;
  --mwx-tabbar: 64px;
}

.mwx-header,
.mwx-drawer,
.mwx-tabbar {
  font-family: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.mwx-header *, .mwx-drawer *, .mwx-tabbar * { box-sizing: border-box; }
.mwx-header a, .mwx-drawer a, .mwx-tabbar a { text-decoration: none; }
.mwx-ico { flex: none; display: block; }

/* ---------- Bar utama ---------- */
.mwx-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9990;
  color: var(--mwx-ink);
  background: #fff;
  box-shadow: 0 1px 0 var(--mwx-line);
  transition: background-color .3s ease, box-shadow .3s ease, color .3s ease;
}
body.admin-bar .mwx-header { top: 32px; }
.mwx-bar {
  height: var(--mwx-h);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 32px;
  transition: height .3s ease;
}
.mwx-header.is-scrolled .mwx-bar { height: var(--mwx-h-scrolled); }
.mwx-header.is-scrolled { box-shadow: 0 2px 18px rgba(18, 21, 43, .08); }

.mwx-logo { flex: none; display: flex; align-items: center; }
.mwx-logo img { width: 140px; height: auto; display: block; transition: filter .3s ease; }

/* Beranda: transparan di atas banner sampai di-scroll / menu dibuka */
.mwx-hdr-transparent .mwx-header:not(.is-scrolled):not(.is-open) {
  background: linear-gradient(180deg, rgba(10, 12, 28, .55) 0%, rgba(10, 12, 28, 0) 100%);
  box-shadow: none;
  color: #fff;
}
.mwx-hdr-transparent .mwx-header:not(.is-scrolled):not(.is-open) .mwx-logo img { filter: brightness(0) invert(1); }
.mwx-hdr-transparent .mwx-header:not(.is-scrolled):not(.is-open) .mwx-btn-outline,
.mwx-hdr-transparent .mwx-header:not(.is-scrolled):not(.is-open) .mwx-icon-btn { border-color: rgba(255, 255, 255, .45); color: #fff; }

/* ---------- Navigasi desktop ---------- */
.mwx-nav { flex: 1; display: flex; justify-content: center; }
.mwx-nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 30px; }
.mwx-nav-item { position: static; display: flex; align-items: center; gap: 2px; height: var(--mwx-h); }
.mwx-header.is-scrolled .mwx-nav-item { height: var(--mwx-h-scrolled); }
.mwx-nav-link {
  color: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .1px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color .2s ease, color .2s ease;
  white-space: nowrap;
}
.mwx-nav-link:hover, .mwx-nav-link:focus-visible { color: inherit; border-bottom-color: var(--mwx-red); }
.mwx-nav-item.is-current > .mwx-nav-link,
.mwx-nav-item.is-open > .mwx-nav-link,
.mwx-nav-item.has-panel:hover > .mwx-nav-link { border-bottom-color: var(--mwx-red); }
.mwx-caret {
  border: 0; background: transparent; color: inherit; padding: 6px 2px; cursor: pointer;
  display: flex; align-items: center; opacity: .8; transition: transform .2s ease;
}
.mwx-nav-item.is-open .mwx-caret { transform: rotate(180deg); }

/* Panel dropdown & mega */
.mwx-panel {
  position: absolute;
  top: calc(100% - 4px);
  left: 50%;
  transform: translate(-50%, 8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  background: #fff;
  color: var(--mwx-ink);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(18, 21, 43, .2);
  z-index: 2;
}
.mwx-nav-item.is-open > .mwx-panel,
.mwx-nav-item.has-panel:hover > .mwx-panel {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0);
}
/* jembatan hover antara menu & panel */
.mwx-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }

.mwx-mega { width: min(1200px, calc(100vw - 48px)); padding: 28px 32px 0; }
.mwx-mega-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.3fr); gap: 28px; }
.mwx-mega-title { display: block; font-size: 15px; font-weight: 700; color: var(--mwx-ink); margin-bottom: 12px; }
.mwx-mega-title:hover { color: var(--mwx-red); }
.mwx-mega-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mwx-mega-col li a { display: block; padding: 6px 0; font-size: 14px; color: var(--mwx-muted); transition: color .15s ease, transform .15s ease; }
.mwx-mega-col li a:hover, .mwx-mega-col li a:focus-visible { color: var(--mwx-red); transform: translateX(3px); }
.mwx-mega-feature { display: block; border-radius: 14px; overflow: hidden; background: var(--mwx-navy); min-height: 220px; align-self: start; }
.mwx-mega-img { display: block; width: 100%; height: 100%; min-height: 220px; object-fit: cover; transition: opacity .2s ease; }
.mwx-mega-foot {
  margin-top: 24px; padding: 16px 0 18px; border-top: 1px solid var(--mwx-line);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 14px; color: var(--mwx-muted);
}
.mwx-mega-foot-links { display: flex; gap: 24px; }
.mwx-mega-foot-links a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--mwx-red); }
.mwx-mega-foot-links a:hover { color: var(--mwx-red-dark); }

.mwx-cards { width: 680px; padding: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mwx-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 16px; border: 1px solid var(--mwx-line); border-radius: 14px; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.mwx-card:hover { transform: translateY(-2px); }
.mwx-card-logo { height: 52px; width: 100%; display: flex; align-items: center; justify-content: center; }
.mwx-card-logo img { max-height: 52px; max-width: 150px; width: auto; height: auto; display: block; object-fit: contain; }
.mwx-card strong { font-size: 16px; color: var(--mwx-ink); }
.mwx-card span { font-size: 12.5px; color: var(--mwx-muted); }
.mwx-card:hover, .mwx-card:focus-visible { border-color: var(--mwx-red); box-shadow: 0 6px 18px rgba(225, 9, 18, .1); }
.mwx-card:hover strong { color: var(--mwx-red); }

/* ---------- Tombol kanan ---------- */
.mwx-actions { flex: none; display: flex; align-items: center; gap: 12px; }
.mwx-icon-btn {
  width: 44px; height: 44px; border-radius: 22px; border: 1px solid #dcdce2; background: transparent;
  color: var(--mwx-ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.mwx-icon-btn:hover { border-color: var(--mwx-red); color: var(--mwx-red); }
.mwx-btn {
  height: 44px; padding: 0 18px; border-radius: 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 700; white-space: nowrap; transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.mwx-btn-outline { border: 1px solid #dcdce2; color: inherit; }
.mwx-btn-outline:hover { border-color: var(--mwx-red); color: var(--mwx-red); }
.mwx-btn-red { background: var(--mwx-red); color: #fff !important; padding: 0 22px; }
.mwx-btn-red:hover { background: var(--mwx-red-dark); }
.mwx-lang { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; margin-left: 4px; }
.mwx-lang a { color: inherit; opacity: .55; }
.mwx-lang a.is-current, .mwx-lang a:hover { opacity: 1; }
.mwx-lang-sep { opacity: .4; }
.mwx-mobile-only { display: none !important; }

/* ---------- Pencarian ---------- */
.mwx-search { position: absolute; left: 0; right: 0; top: 100%; background: #fff; box-shadow: 0 18px 40px rgba(18, 21, 43, .15); padding: 16px 24px; }
.mwx-search-form { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; color: var(--mwx-muted); }
.mwx-search-form input {
  flex: 1; height: 48px; border: 0; border-bottom: 2px solid var(--mwx-line); font: 500 17px Montserrat, sans-serif; color: var(--mwx-ink);
  outline: none; background: transparent;
}
.mwx-search-form input:focus { border-bottom-color: var(--mwx-red); }
.mwx-search .mwx-icon-btn { border-color: transparent; color: var(--mwx-ink) !important; }

/* ---------- Konten di bawah header ---------- */
@media (min-width: 992px) {
  .mwx-hdr-transparent main.site-main { margin-top: 0 !important; }
  .mwx-hdr-transparent main.site-main > article > .entry-content:first-child,
  .mwx-hdr-transparent main.site-main .entry-content { margin-top: 0; }
}

/* ---------- Laptop kecil ---------- */
@media (max-width: 1280px) {
  .mwx-bar { padding: 0 24px; gap: 20px; }
  .mwx-nav-list { gap: 22px; }
  .mwx-nav-link { font-size: 14px; }
  .mwx-btn { padding: 0 14px; }
  .mwx-mega-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mwx-mega-feature { display: none; }
}

/* ---------- HP & tablet ---------- */
@media (max-width: 991px) {
  :root { --mwx-h: 56px; --mwx-h-scrolled: 56px; }
  body.admin-bar .mwx-header { top: 46px; }
  .mwx-bar { padding: 0 8px 0 16px; gap: 8px; justify-content: space-between; }
  .mwx-logo img { width: 116px; }
  .mwx-nav, .mwx-desktop-only { display: none !important; }
  .mwx-mobile-only { display: inline-flex !important; }
  .mwx-actions { gap: 0; }
  .mwx-actions .mwx-icon-btn { border-color: transparent !important; }
  /* di HP header selalu putih (logo merah) */
  .mwx-hdr-transparent .mwx-header:not(.is-scrolled):not(.is-open) { background: #fff; color: var(--mwx-ink); box-shadow: 0 1px 0 var(--mwx-line); }
  .mwx-hdr-transparent .mwx-header:not(.is-scrolled):not(.is-open) .mwx-logo img { filter: none; }
  .mwx-hdr-transparent .mwx-header:not(.is-scrolled):not(.is-open) .mwx-icon-btn { color: var(--mwx-ink); }
  .mwx-search { padding: 10px 12px; }

  /* konten mulai tepat di bawah header 56px (dulu 100px → ada celah putih) */
  body.mwx-hdr main.site-main { margin-top: var(--mwx-h) !important; }
  body.mwx-hdr { padding-bottom: calc(var(--mwx-tabbar) + env(safe-area-inset-bottom)); }
  body.mwx-hdr .ht-ctc, body.mwx-hdr .ht_ctc_chat_style, body.mwx-hdr .scrollToTop {
    bottom: calc(var(--mwx-tabbar) + 16px + env(safe-area-inset-bottom)) !important;
  }
}

/* Laci menu HP */
.mwx-drawer { position: fixed; inset: 0; z-index: 10000; }
.mwx-drawer[hidden] { display: none; }
.mwx-drawer-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 28, .55); opacity: 0; transition: opacity .25s ease; }
.mwx-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 92vw); background: #fff; color: var(--mwx-ink);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s ease;
  box-shadow: -12px 0 40px rgba(0, 0, 0, .25);
}
.mwx-drawer.is-open .mwx-drawer-backdrop { opacity: 1; }
.mwx-drawer.is-open .mwx-drawer-panel { transform: translateX(0); }
.mwx-drawer-head { height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 20px; border-bottom: 1px solid var(--mwx-line); }
.mwx-drawer-head span { font-size: 13px; font-weight: 700; letter-spacing: 2px; color: var(--mwx-muted); }
.mwx-drawer-head .mwx-icon-btn { border-color: transparent; }
.mwx-drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px; overscroll-behavior: contain; }
.mwx-drawer-link {
  width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font: 600 17px Montserrat, sans-serif; color: var(--mwx-ink); background: none; border: 0; border-bottom: 1px solid #f0f0f3;
  padding: 0; text-align: left; cursor: pointer;
}
.mwx-acc[aria-expanded="true"] { color: var(--mwx-red); border-bottom-color: transparent; }
.mwx-acc .mwx-ico { transition: transform .2s ease; }
.mwx-acc[aria-expanded="true"] .mwx-ico { transform: rotate(180deg); }
.mwx-acc-body { padding: 4px 0 14px; border-bottom: 1px solid #f0f0f3; }
.mwx-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mwx-tile { min-height: 72px; border-radius: 12px; padding: 12px; background: #f4efe8; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.mwx-tile:nth-child(2) { background: #e9eff3; }
.mwx-tile:nth-child(3) { background: #f1ebe2; }
.mwx-tile:nth-child(4) { background: #eef0ea; }
.mwx-tile strong { font-size: 14px; color: var(--mwx-ink); }
.mwx-tile span { font-size: 11.5px; color: var(--mwx-muted); line-height: 1.35; }
.mwx-acc-all { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--mwx-red); }
.mwx-acc-link { display: block; padding: 11px 0 11px 12px; font-size: 15px; color: var(--mwx-muted); }
.mwx-acc-link:hover { color: var(--mwx-red); }
.mwx-brand-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mwx-brand-list .mwx-acc-link.has-logo {
  height: 64px; padding: 10px 12px; border: 1px solid var(--mwx-line); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.mwx-brand-list .mwx-acc-link.has-logo img { max-height: 40px; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.mwx-drawer-foot { flex: none; padding: 16px 20px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid var(--mwx-line); display: flex; flex-direction: column; gap: 10px; }
.mwx-btn-block { width: 100%; height: 48px; font-size: 15px; }
.mwx-drawer-lang { display: flex; justify-content: center; gap: 8px; padding-top: 4px; }
.mwx-drawer-lang a { padding: 8px 14px; border-radius: 16px; font-size: 14px; font-weight: 700; color: var(--mwx-muted); }
.mwx-drawer-lang a.is-current { background: var(--mwx-ink); color: #fff; }
body.mwx-lock { overflow: hidden; }
body.mwx-lock .mwx-tabbar { display: none !important; }

/* Bar bawah HP */
.mwx-tabbar { display: none; }
@media (max-width: 991px) {
  .mwx-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9980;
    height: calc(var(--mwx-tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: #fff; border-top: 1px solid var(--mwx-line); box-shadow: 0 -4px 16px rgba(18, 21, 43, .06);
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .mwx-tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--mwx-muted); }
  .mwx-tabbar a.is-current, .mwx-tabbar a:hover { color: var(--mwx-red); }
}

@media (prefers-reduced-motion: reduce) {
  .mwx-header, .mwx-header *, .mwx-drawer * { transition: none !important; }
}
