/* ============================================
   GLOBAL.CSS — Empire Plumber Malaysia
   Header, footer, mobile menu, WA float
   ============================================ */

:root {
  --ep-navy: #1B3A5C;
  --ep-navy-deep: #0F2440;
  --ep-navy-light: #264D73;
  --ep-orange: #E87A2E;
  --ep-orange-light: #F4943E;
  --ep-white: #FFFFFF;
  --ep-off-white: #F8FAFB;
  --ep-gray-50: #F1F5F9;
  --ep-gray-100: #E2E8F0;
  --ep-gray-200: #CBD5E1;
  --ep-gray-400: #94A3B8;
  --ep-gray-500: #64748B;
  --ep-gray-600: #475569;
  --ep-gray-800: #1E293B;
  --ep-gray-900: #0F172A;
  --ep-green: #22C55E;
  --ep-green-dark: #16A34A;
  --ep-red: #EF4444;
}

/* ===== Header ===== */
.ep-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1100;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--ep-gray-100);
  transition: box-shadow .3s, background .3s;
}
.ep-header.scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.ep-header-inner {
  max-width: 1260px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 80px;
}

/* Logo */
.ep-header-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.ep-header-logo img { height: 60px; width: auto; border-radius: 8px; transition: transform .2s; }
.ep-header-logo:hover img { transform: scale(1.03); }

/* Nav */
.ep-nav { display: flex; align-items: center; gap: 2px; }
.ep-nav-item { position: relative; }
.ep-nav-link {
  display: flex; align-items: center; gap: 5px; text-decoration: none;
  color: var(--ep-gray-600); font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14.5px; font-weight: 600; padding: 8px 14px; border-radius: 8px;
  transition: color .2s, background .2s; white-space: nowrap; cursor: pointer;
}
.ep-nav-link:hover, .ep-nav-item:hover > .ep-nav-link {
  color: var(--ep-navy); background: var(--ep-gray-50);
}
.ep-nav-link svg { width: 13px; height: 13px; fill: currentColor; transition: transform .25s; }
.ep-nav-item:hover > .ep-nav-link svg { transform: rotate(180deg); }

/* Mega menu base */
.ep-mega {
  position: absolute; top: calc(100% + 8px); left: 50%;
  opacity: 0; visibility: hidden;
  transform: translateX(-50%) translateY(6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  background: var(--ep-white); border: 1px solid var(--ep-gray-100);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.1), 0 0 0 1px rgba(0,0,0,.02);
  padding: 0; z-index: 1200; pointer-events: none; overflow: hidden;
}
.ep-nav-item:hover > .ep-mega {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0); pointer-events: auto;
}

/* Services mega */
.ep-mega-services { width: 780px; }
.ep-mega-header {
  padding: 20px 28px 0; display: flex; align-items: center; justify-content: space-between;
}
.ep-mega-title {
  font-family: "Plus Jakarta Sans", sans-serif; font-size: 16px;
  font-weight: 800; color: var(--ep-navy); margin: 0;
}
.ep-mega-viewall {
  font-family: "Plus Jakarta Sans", sans-serif; font-size: 12.5px;
  font-weight: 700; color: var(--ep-orange); text-decoration: none;
  display: flex; align-items: center; gap: 4px; transition: color .2s;
}
.ep-mega-viewall:hover { color: var(--ep-navy); }
.ep-mega-viewall svg { width: 14px; height: 14px; fill: currentColor; }
.ep-mega-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2px; padding: 16px 20px 20px;
}
.ep-mega-link {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px;
  border-radius: 12px; text-decoration: none; color: var(--ep-gray-800);
  transition: background .15s;
}
.ep-mega-link:hover { background: var(--ep-gray-50); }
.ep-mega-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ep-mega-icon svg { width: 18px; height: 18px; }
.ep-mega-icon.navy { background: rgba(27,58,92,.06); }
.ep-mega-icon.navy svg { fill: var(--ep-navy); }
.ep-mega-icon.orange { background: rgba(232,122,46,.06); }
.ep-mega-icon.orange svg { fill: var(--ep-orange); }
.ep-mega-icon.emergency { background: rgba(239,68,68,.06); }
.ep-mega-icon.emergency svg { fill: var(--ep-red); }
.ep-mega-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ep-mega-text strong {
  font-family: "Plus Jakarta Sans", sans-serif; font-size: 13.5px;
  font-weight: 700; color: var(--ep-gray-900); line-height: 1.3;
}
.ep-mega-text small { font-size: 12px; color: var(--ep-gray-400); line-height: 1.3; }

/* Areas mega */
.ep-mega-areas { width: 560px; }
.ep-mega-areas-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.ep-mega-col { padding: 20px 24px; }
.ep-mega-col:first-child { border-right: 1px solid var(--ep-gray-100); }
.ep-mega-col-title {
  font-family: "Plus Jakarta Sans", sans-serif; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ep-orange); margin: 0 0 8px; padding: 0 8px;
}
.ep-mega-col-list { display: flex; flex-direction: column; gap: 0; }
.ep-mega-area-link {
  padding: 6px 8px; border-radius: 6px; text-decoration: none;
  color: var(--ep-gray-600); font-family: "DM Sans", sans-serif;
  font-size: 13.5px; font-weight: 500; transition: background .12s, color .12s;
}
.ep-mega-area-link:hover { background: var(--ep-gray-50); color: var(--ep-navy); }

/* Header WA CTA */
.ep-header-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ep-green); color: #fff !important;
  font-family: "Plus Jakarta Sans", sans-serif; font-size: 13.5px;
  font-weight: 700; padding: 10px 22px; border-radius: 50px;
  text-decoration: none; transition: background .2s, transform .2s;
  box-shadow: 0 2px 10px rgba(34,197,94,.25);
}
.ep-header-cta:hover {
  background: var(--ep-green-dark); transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(34,197,94,.35);
}
.ep-header-cta svg { flex-shrink: 0; width: 16px; height: 16px; }

/* Hamburger */
.ep-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  width: 40px; height: 40px; position: relative; z-index: 1201;
  border-radius: 8px; transition: background .2s;
}
.ep-hamburger:hover { background: var(--ep-gray-50); }
.ep-hamburger span {
  display: block; width: 22px; height: 2px; background: var(--ep-navy);
  border-radius: 2px; position: absolute; left: 9px; transition: transform .3s, opacity .3s;
}
.ep-hamburger span:nth-child(1) { top: 11px; }
.ep-hamburger span:nth-child(2) { top: 18px; }
.ep-hamburger span:nth-child(3) { top: 25px; }
.ep-hamburger.open span:nth-child(1) { top: 18px; transform: rotate(45deg); }
.ep-hamburger.open span:nth-child(2) { opacity: 0; }
.ep-hamburger.open span:nth-child(3) { top: 18px; transform: rotate(-45deg); }

/* Mobile menu */
.ep-mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 1200;
  background: var(--ep-white); flex-direction: column;
  padding: 90px 24px 40px; overflow-y: auto; opacity: 0; transition: opacity .3s;
}
.ep-mobile-menu.open { display: flex; opacity: 1; }
.ep-mm-section { margin-bottom: 20px; }
.ep-mm-heading {
  font-family: "Plus Jakarta Sans", sans-serif; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ep-gray-400); padding: 8px 0; margin: 0;
}
.ep-mm-link {
  display: block; text-decoration: none; color: var(--ep-navy);
  font-family: "Plus Jakarta Sans", sans-serif; font-size: 17px;
  font-weight: 600; padding: 12px 0; border-bottom: 1px solid var(--ep-gray-100);
}
.ep-mm-sub-link {
  display: block; text-decoration: none; color: var(--ep-gray-600);
  font-family: "DM Sans", sans-serif; font-size: 15px;
  font-weight: 500; padding: 8px 0 8px 12px;
}
.ep-mm-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none; cursor: pointer;
  color: var(--ep-navy); font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 17px; font-weight: 600; padding: 12px 0;
  border-bottom: 1px solid var(--ep-gray-100);
}
.ep-mm-toggle svg {
  width: 14px; height: 14px; fill: var(--ep-gray-400); transition: transform .3s;
}
.ep-mm-toggle.open svg { transform: rotate(180deg); }
.ep-mm-submenu { display: none; padding: 4px 0 8px; }
.ep-mm-submenu.open { display: block; }
.ep-mm-cta-wrap { padding-top: 20px; }

/* ===== Footer ===== */
.ep-footer {
  background: var(--ep-navy-deep); color: var(--ep-gray-200);
  font-family: "DM Sans", sans-serif; font-size: 14.5px; line-height: 1.6;
}
.ep-footer a {
  color: var(--ep-gray-200); text-decoration: none; transition: color .2s;
}
.ep-footer a:hover { color: var(--ep-orange-light); }
.ep-footer-inner {
  max-width: 1260px; margin: 0 auto; padding: 64px 24px 40px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px;
}
.ep-footer-col h4 {
  font-family: "Plus Jakarta Sans", sans-serif; font-size: 15px;
  font-weight: 700; color: var(--ep-white); margin: 0 0 16px;
}
.ep-footer-col ul { list-style: none; margin: 0; padding: 0; }
.ep-footer-col li { margin-bottom: 7px; }
.ep-footer-brand-logo {
  display: flex; align-items: center; margin-bottom: 16px; text-decoration: none;
}
.ep-footer-brand-logo img { height: 72px; width: auto; border-radius: 10px; }
.ep-footer-tagline {
  margin: 0 0 20px; color: var(--ep-gray-400); font-size: 14px; line-height: 1.7;
}
.ep-footer-wa {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ep-green); color: #fff !important;
  font-family: "Plus Jakarta Sans", sans-serif; font-size: 15px;
  font-weight: 700; padding: 14px 28px; border-radius: 50px;
  transition: background .2s, transform .2s;
  box-shadow: 0 4px 16px rgba(34,197,94,.3);
}
.ep-footer-wa svg { width: 20px; height: 20px; }
.ep-footer-wa:hover {
  background: var(--ep-green-dark); color: #fff !important;
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(34,197,94,.4);
}
.ep-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  max-width: 1260px; margin: 0 auto; padding: 20px 24px 28px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--ep-gray-400);
}
.ep-footer-bottom-links { display: flex; gap: 20px; }
.ep-footer-bottom-links a { font-size: 13px; color: var(--ep-gray-400); }
.ep-footer-bottom-links a:hover { color: var(--ep-orange-light); }

/* ===== WA Float ===== */
.ep-wa-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 1050;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--ep-green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(34,197,94,.4);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none; animation: ep-wa-pulse 2.5s infinite;
}
.ep-wa-float:hover {
  transform: scale(1.1); box-shadow: 0 6px 24px rgba(34,197,94,.5);
}
.ep-wa-float svg { width: 28px; height: 28px; fill: #fff; }
@keyframes ep-wa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
  70% { box-shadow: 0 0 0 16px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .ep-nav, .ep-header-cta { display: none; }
  .ep-hamburger { display: block; }
  .ep-footer-inner { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 768px) {
  .ep-header-inner { height: 68px; padding: 0 16px; }
  .ep-header-logo img { height: 48px; }
  .ep-footer-inner { grid-template-columns: 1fr; gap: 32px; padding: 48px 16px 32px; }
  .ep-footer-brand-logo img { height: 60px; }
  .ep-footer-bottom { padding: 16px; }
}
@media (max-width: 480px) {
  .ep-header-inner { height: 60px; }
  .ep-header-logo img { height: 42px; }
  .ep-footer-bottom { flex-direction: column; text-align: center; }
  .ep-footer-tagline { font-size: 13px; }
  .ep-wa-float { width: 52px; height: 52px; bottom: 16px; right: 16px; }
  .ep-wa-float svg { width: 24px; height: 24px; }
}
