/* ============================================================
   COMPONENTS.CSS — Header, Nav, Hero, Keyword sections
   All overflow-x issues fixed. Professional color palette.
   ============================================================ */

/* ============================================================
   TOP BAR
   ============================================================ */
.mashive-topbar {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  padding: 8px 0;
  overflow: hidden;
}
.mashive-topbar-inner {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 8px;
  max-width: 100%; overflow: hidden;
}
.mashive-topbar-right,
.mashive-topbar-left { display: flex; align-items: center; gap: 16px; }
.mashive-topbar a { color: rgba(255,255,255,0.6); transition: color 0.15s; }
.mashive-topbar a:hover { color: #fff; }
@media (max-width: 640px) { .mashive-topbar-left { display: none; } }

/* ============================================================
   NAVBAR
   ============================================================ */
.mashive-navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.mashive-navbar.scrolled { box-shadow: 0 2px 24px rgba(0,0,0,0.08); }
.mashive-navbar-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  height: 66px; gap: 12px;
  max-width: 100%;
  overflow: hidden;
}

/* Logo */
.mashive-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.mashive-logo-mark {
  width: 40px; height: 40px; background: var(--brand-primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; flex-shrink: 0;
}
.mashive-logo-text { font-size: 16px; font-weight: 800; color: var(--text-dark); line-height: 1.2; }
.mashive-logo-sub  { font-size: 10px; color: var(--text-muted); font-weight: 400; }

/* Nav links */
.mashive-nav-links {
  display: flex; align-items: center;
  gap: 2px; list-style: none; margin: 0; padding: 0;
  flex: 1; justify-content: center;
}
.mashive-nav-links > li { position: relative; }
.mashive-nav-links > li > a {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  color: var(--text-mid); transition: all 0.15s;
  text-decoration: none; white-space: nowrap;
}
.mashive-nav-links > li > a:hover,
.mashive-nav-links > li.current-menu-item > a,
.mashive-nav-links > li a.mn-active {
  color: var(--brand-primary);
  background: var(--brand-primary-light);
}

/* Nav CTA group */
.mashive-nav-cta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Hamburger */
.mashive-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none;
  cursor: pointer; padding: 6px; flex-shrink: 0;
}
.mashive-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-dark); border-radius: 2px;
  transition: all 0.2s;
}
.mashive-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mashive-hamburger.open span:nth-child(2) { opacity: 0; }
.mashive-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mashive-mobile-menu {
  display: none;
  border-top: 2px solid var(--brand-primary);
  background: var(--bg-white);
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 80vh; /* scrollable if menu is very long */
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.mashive-mobile-menu.open {
  display: block;
  animation: mobileMenuOpen 0.22s ease;
}
@keyframes mobileMenuOpen {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mashive-mobile-menu .mashive-container { padding: 12px 16px 20px; }

/* ============================================================
   DESKTOP DROPDOWN — hover to show, click main link to navigate
   ============================================================ */
.mn-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border: none; background: none;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  color: var(--text-mid); cursor: pointer;
  border-radius: var(--radius-sm); transition: all 0.15s;
  white-space: nowrap;
}
.mn-toggle:hover,
.mn-has-drop.mn-open .mn-toggle {
  color: var(--brand-primary);
  background: var(--brand-primary-light);
}
.mn-chevron { transition: transform 0.2s; color: var(--text-muted); }
.mn-has-drop:hover .mn-chevron,
.mn-has-drop.mn-open .mn-chevron { transform: rotate(180deg); color: var(--brand-primary); }

/* Dropdown panel */
.mn-dropdown,
.mashive-nav-links .sub-menu {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  min-width: 240px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  overflow: hidden;
  animation: mnSlideDown 0.15s ease;
}
@keyframes mnSlideDown {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Cities dropdown wider — constrained on mobile */
#mn-drop-cities {
  min-width: 600px;
  right: auto; left: 0;
}
@media (max-width: 768px) {
  #mn-drop-cities { min-width: unset !important; width: calc(100vw - 32px) !important; left: 0 !important; right: 0 !important; }
}

/* Show on hover (desktop) */
@media (min-width: 1025px) {
  .mn-has-drop:hover > .mn-dropdown,
  .mashive-nav-links li.menu-item-has-children:hover > .sub-menu,
  .mn-has-drop.mn-open > .mn-dropdown,
  .mashive-nav-links li.menu-item-has-children.mn-open > .sub-menu {
    display: block;
  }
}

/* Hide on mobile */
@media (max-width: 1024px) {
  .mn-dropdown,
  .mashive-nav-links .sub-menu { display: none !important; }
  .mashive-hamburger { display: flex; }
  .mashive-nav-links { display: none; }
  .mashive-nav-cta .btn-call { display: none; }
}

.mn-drop-inner { padding: 8px; }
.mn-drop-header {
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.mn-drop-view-all {
  font-size: 12px; font-weight: 700;
  color: var(--brand-primary); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.mn-drop-view-all:hover { text-decoration: underline; }

/* Services list inside dropdown */
.mn-drop-list { list-style: none; margin: 0; padding: 0; }
.mn-drop-item {
  display: flex; align-items: flex-start;
  gap: 10px; padding: 9px 10px;
  border-radius: var(--radius-md);
  text-decoration: none; transition: background 0.12s;
}
.mn-drop-item:hover { background: var(--brand-primary-light); }
.mn-item-icon  { font-size: 18px; flex-shrink: 0; line-height: 1.3; }
.mn-item-body  { display: flex; flex-direction: column; gap: 2px; }
.mn-item-label { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.mn-item-kw    { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.mn-item-price { font-size: 11px; color: var(--brand-primary); font-weight: 600; }

/* WP .sub-menu styles */
.mashive-nav-links .sub-menu { list-style: none; margin: 0; padding: 8px; }
.mashive-nav-links .sub-menu li { position: static; }
.mashive-nav-links .sub-menu li a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500; color: var(--text-dark);
  text-decoration: none; transition: all 0.12s;
}
.mashive-nav-links .sub-menu li a:hover { background: var(--brand-primary-light); color: var(--brand-primary); }
.mashive-nav-links .sub-menu li.current-menu-item > a { color: var(--brand-primary); background: var(--brand-primary-light); }

/* Parent item chevron via CSS */
.mashive-nav-links li.menu-item-has-children > a {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--text-mid);
  text-decoration: none; transition: all 0.15s;
}
.mashive-nav-links li.menu-item-has-children > a::after {
  content: '▾'; font-size: 10px; opacity: 0.5; transition: transform 0.2s;
}
.mashive-nav-links li.menu-item-has-children:hover > a,
.mashive-nav-links li.menu-item-has-children.mn-open > a {
  color: var(--brand-primary); background: var(--brand-primary-light);
}
.mashive-nav-links li.menu-item-has-children:hover > a::after { opacity: 1; }

/* Cities mega grid */
.mn-cities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
  gap: 6px; padding: 4px 0;
}
.mn-city-col {
  padding: 10px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--bg-page);
  transition: all 0.12s;
}
.mn-city-col:hover { border-color: var(--brand-primary); background: var(--brand-primary-light); }
.mn-city-title {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--text-dark); text-decoration: none;
  padding-bottom: 6px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.mn-city-title:hover { color: var(--brand-primary); }
.mn-city-subs { list-style: none; margin: 0; padding: 0; }
.mn-city-subs li a {
  display: block; font-size: 11px; color: var(--text-muted);
  padding: 3px 2px; border-radius: var(--radius-sm);
  text-decoration: none; transition: color 0.12s;
}
.mn-city-subs li a:hover { color: var(--brand-primary); }
.mn-city-all { color: var(--brand-primary) !important; font-weight: 600 !important; }

/* Active states */
.mn-active, .mn-has-drop.mn-current-parent > .mn-toggle { color: var(--brand-primary) !important; }

/* ============================================================
   MOBILE NAV ACCORDION
   ============================================================ */
.mashive-mobile-nav { list-style: none; margin: 0; padding: 0; }
.mashive-mobile-nav > li { list-style: none; }
.mashive-mobile-nav > li > a {
  display: block; padding: 13px 0;
  font-size: 15px; font-weight: 500; color: var(--text-dark);
  border-bottom: 1px solid var(--border); text-decoration: none;
  transition: color 0.15s;
}
.mashive-mobile-nav > li > a:hover { color: var(--brand-primary); }

.mashive-mob-toggle {
  display: flex; align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 0;
}
.mashive-mob-toggle > a {
  display: block; padding: 13px 0;
  font-size: 15px; font-weight: 500;
  color: var(--text-dark); text-decoration: none; flex: 1;
  transition: color 0.15s;
}
.mashive-mob-toggle > a:hover { color: var(--brand-primary); }
.mashive-mob-expand {
  background: none; border: none;
  font-size: 18px; color: var(--text-muted);
  cursor: pointer;
  padding: 10px 12px; /* bigger tap target */
  transition: transform 0.25s ease, color 0.15s;
  flex-shrink: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent; /* remove iOS tap flash */
}
.mashive-mob-expand:hover { color: var(--brand-primary); }
.mashive-mob-accordion.open > .mashive-mob-toggle .mashive-mob-expand {
  transform: rotate(180deg);
  color: var(--brand-primary);
}
/* Nested city level expand */
.mashive-mob-city-item.open > .mashive-mob-toggle .mashive-mob-expand {
  transform: rotate(90deg);
  color: var(--brand-primary);
}

.mashive-mob-sub {
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
  border-right: 2px solid var(--brand-primary-light);
  margin-right: 6px;
  /* JS controls max-height for animation */
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.28s ease, opacity 0.2s ease;
}
/* When JS adds .open, JS also sets max-height via scrollHeight */
.mashive-mob-accordion.open > .mashive-mob-sub {
  /* Fallback if JS hasn't set max-height yet */
  max-height: 2000px;
  opacity: 1;
  padding: 4px 0 4px 14px;
}
.mashive-mob-sub li { list-style: none; }
.mashive-mob-sub li a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 8px;
  font-size: 14px; color: var(--text-mid);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  text-decoration: none; transition: color 0.12s, background 0.12s;
  border-radius: var(--radius-sm);
}
.mashive-mob-sub li a:hover {
  color: var(--brand-primary);
  background: var(--brand-primary-light);
}
.mashive-mob-all {
  color: var(--brand-primary) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  margin-top: 4px;
}
.mashive-mob-kw {
  display: block; font-size: 11px;
  color: var(--text-muted); padding: 0 8px 6px;
}
/* City sub-level */
.mashive-mob-city-item .mashive-mob-toggle > a {
  font-size: 14px; font-weight: 600; padding: 10px 0;
}
.mashive-mob-city-subs { padding-right: 8px; }
.mashive-mob-city-subs li a { font-size: 13px; }

/* ============================================================
   HERO SECTION
   ============================================================ */
.mashive-hero {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-mid) 60%, #0D2137 100%);
  position: relative; overflow: hidden;
  padding: 90px 0 72px;
}
.mashive-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 55% 75% at 85% 45%, rgba(13,122,95,0.22) 0%, transparent 70%),
    radial-gradient(ellipse 35% 50% at 10% 80%, rgba(184,134,11,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.mashive-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 52px; align-items: center;
  position: relative; z-index: 1;
}
.mashive-hero-badges { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.mashive-hero-content h1 { color: #fff; margin-bottom: 18px; }
.mashive-hero-content > p {
  color: rgba(255,255,255,0.62);
  font-size: 16px; line-height: 1.85;
  margin-bottom: 28px; max-width: 520px;
}
.mashive-hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 44px; }

/* Stats row */
.mashive-hero-stats {
  display: flex; align-items: center; gap: 24px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-wrap: wrap;
  /* FIX: never push past screen edge */
  max-width: 100%;
  overflow: hidden;
}
.mashive-stat-num { font-size: 24px; font-weight: 800; color: #fff; line-height: 1; }
.mashive-stat-lbl { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 3px; }
.mashive-stat-divider { width: 1px; height: 34px; background: rgba(255,255,255,0.1); flex-shrink: 0; }

/* Hero visual cards */
.mashive-hero-visual { display: flex; flex-direction: column; gap: 12px; }
.mashive-hero-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  backdrop-filter: blur(10px);
}
.mashive-hero-card-label { font-size: 10px; color: rgba(255,255,255,0.38); letter-spacing: 0.5px; margin-bottom: 5px; }
.mashive-hero-card-value { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.mashive-service-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.mashive-service-tag {
  padding: 4px 10px;
  background: rgba(13,122,95,0.2);
  border: 1px solid rgba(13,122,95,0.3);
  border-radius: 100px; font-size: 11px; color: rgba(255,255,255,0.82);
}
.mashive-nat-bars { display: flex; flex-direction: column; gap: 8px; }
.mashive-bar-label {
  display: flex; justify-content: space-between;
  font-size: 11px; color: rgba(255,255,255,0.45); margin-bottom: 3px;
}

/* Hide hero visual on mobile */
@media (max-width: 1024px) {
  .mashive-hero-grid { grid-template-columns: 1fr; }
  .mashive-hero-visual { display: none; }
  .mashive-hero { padding: 60px 0 52px; }
}
@media (max-width: 768px) {
  .mashive-hero { padding: 44px 0 40px; overflow: hidden; }
  .mashive-hero-content h1 { font-size: clamp(22px, 7vw, 32px); }
  .mashive-hero-cta { flex-direction: column; gap: 10px; }
  .mashive-hero-cta .btn { width: 100%; justify-content: center; }
  .mashive-hero-badges { flex-wrap: wrap; }
}

/* ============================================================
   CITIES STRIP — FIX horizontal scroll
   ============================================================ */
.mashive-cities-strip {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  /* FIX: contain overflow within strip */
  overflow: hidden;
}
.mashive-cities-inner {
  display: flex; align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  overflow-x: hidden;
  max-width: 100%;
}
.mashive-cities-label {
  font-size: 12px; font-weight: 700;
  color: var(--text-muted); white-space: nowrap;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  flex-shrink: 0;
}

/* ============================================================
   KEYWORD PILLS — hero
   ============================================================ */
.mashive-kw-pills {
  display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 26px;
  /* FIX: never overflow container */
  max-width: 100%;
  overflow: hidden;
}
.mashive-kw-pill {
  display: inline-flex; align-items: center;
  padding: 5px 13px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 100px; font-size: 12px;
  color: rgba(255,255,255,0.75); text-decoration: none;
  transition: all 0.15s;
  /* FIX: allow wrapping, no min-width forcing overflow */
  white-space: normal;
  word-break: keep-all;
  max-width: 100%;
}
.mashive-kw-pill:hover {
  background: var(--brand-primary); border-color: var(--brand-primary); color: #fff;
}

/* ============================================================
   KEYWORD SEARCH CARDS GRID
   ============================================================ */
.mashive-kw-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 18px;
}
.mashive-kw-card {
  display: flex; flex-direction: column; gap: 7px;
  padding: 22px; background: var(--bg-page);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none; transition: all 0.2s;
}
.mashive-kw-card:hover {
  border-color: var(--brand-primary);
  background: var(--brand-primary-light);
  transform: translateY(-2px); box-shadow: var(--shadow-md);
}
.mashive-kw-card-icon { font-size: 26px; }
.mashive-kw-card h3   { font-size: 16px; font-weight: 700; color: var(--text-dark); margin: 0; }
.mashive-kw-card p    { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin: 0; }
.mashive-kw-card-btn  { font-size: 12px; font-weight: 700; color: var(--brand-primary); margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }
.mashive-kw-card:hover .mashive-kw-card-btn { color: var(--brand-primary-dark); }

/* ============================================================
   CALL BUTTON ROW — appears on each section
   ============================================================ */
.mashive-call-row {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-top: 20px;
}
.mashive-call-row .mashive-call-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: var(--bg-dark); color: #fff;
  border-radius: var(--radius-md); font-size: 14px; font-weight: 600;
  text-decoration: none; transition: all 0.2s;
  border: 2px solid transparent; direction: ltr;
  /* FIX: allow wrapping on very small screens */
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 400px) {
  .mashive-call-row .mashive-call-btn { font-size: 13px; padding: 8px 14px; }
}
.mashive-call-row .mashive-call-btn:hover { background: var(--brand-primary); transform: translateY(-1px); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal-ready { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal-ready.revealed { opacity: 1; transform: translateY(0); }

/* ============================================================
   RESPONSIVE — all remaining fixes
   ============================================================ */
@media (max-width: 768px) {
  .mashive-kw-grid { grid-template-columns: 1fr 1fr; }
  .mashive-kw-pills { gap: 5px; }
  .mashive-kw-pill  { font-size: 11px; padding: 4px 10px; }
  .mashive-cities-inner { gap: 6px; }
  .city-tag { font-size: 12px; padding: 4px 10px; }
}
@media (max-width: 480px) {
  .mashive-kw-grid { grid-template-columns: 1fr; }
  .mashive-call-row { flex-direction: column; align-items: flex-start; }
}


/* ============================================================
   FINAL MOBILE OVERFLOW FIX — applied last, highest priority
   Prevents ANY element from causing horizontal scroll on mobile
   ============================================================ */
@media (max-width: 768px) {
  /* Force all sections to stay within viewport */
  section, div, header, footer, nav, aside, article, main {
    max-width: 100vw;
    overflow-x: hidden;
  }
  /* Tables that might overflow */
  table { display: block; overflow-x: auto; max-width: 100%; }
  /* Pre/code blocks */
  pre, code { overflow-x: auto; max-width: 100%; white-space: pre-wrap; }
  /* Flex rows that can overflow */
  .mashive-hero-cta,
  .mashive-cta-btns,
  .mashive-call-row,
  .mashive-hero-badges,
  .mashive-hero-stats,
  .mashive-service-tags,
  .mashive-kw-pills,
  .city-services,
  .mashive-cities-inner { flex-wrap: wrap; overflow: hidden; }
  /* Grid containers */
  .mashive-kw-grid { grid-template-columns: 1fr 1fr; }
  .mashive-about-cards { grid-template-columns: 1fr 1fr; }
  /* Footer bottom */
  .mashive-footer-bottom { flex-direction: column; align-items: flex-start; }
  .mashive-footer-seo-links { display: none; }
  /* Stat dividers hidden on mobile */
  .mashive-stat-divider { display: none; }
  /* Reviews single column */
  .grid-3 { grid-template-columns: 1fr; }
  /* Price cards no transform */
  .price-card { transform: none !important; }
}
@media (max-width: 400px) {
  .mashive-kw-grid { grid-template-columns: 1fr; }
  .mashive-container { padding: 0 12px; }
  h1 { font-size: 24px !important; }
  h2 { font-size: 20px !important; }
  .btn-lg { padding: 12px 18px; font-size: 13px; }
}