:root {
  --mv-dark-page: #0a0a0d;
  --mv-dark-surface: #0f0f13;
  --mv-dark-soft: #141419;
  --mv-dark-card: #18181f;
  --mv-dark-heading: #ffffff;
  --mv-dark-text: #f1f1f4;
  --mv-dark-muted: #b7b7c2;
  --mv-dark-border: #2b2b34;
  --mv-dark-input: #121217;
  --mv-dark-service-banner: #0a0a0d;
  --mv-dark-service-content: #0f0f13;
  --mv-theme-transition: 220ms;
}

html.mv-theme-booting,
html.mv-theme-booting body { transition: none !important; }

html[data-mv-theme="dark"] {
  color-scheme: dark;
  background: var(--mv-dark-page);
}

html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled {
  background-color: var(--mv-dark-page) !important;
  color: var(--mv-dark-text);
}

html[data-mv-theme] body.mv-itechfix-theme-enabled,
html[data-mv-theme] body.mv-itechfix-theme-enabled * {
  transition-property: background-color, color, border-color, fill, stroke, box-shadow;
  transition-duration: var(--mv-theme-transition);
  transition-timing-function: ease;
}

html[data-mv-theme="dark"] .mv-surface,
html[data-mv-theme="dark"] [data-mv-surface] { background-color: var(--mv-dark-surface) !important; }
html[data-mv-theme="dark"] .mv-soft,
html[data-mv-theme="dark"] [data-mv-soft] { background-color: var(--mv-dark-soft) !important; }
html[data-mv-theme="dark"] .mv-card,
html[data-mv-theme="dark"] [data-mv-card] { background-color: var(--mv-dark-card) !important; }
html[data-mv-theme="dark"] .mv-heading,
html[data-mv-theme="dark"] [data-mv-heading],
html[data-mv-theme="dark"] .mv-force-white,
html[data-mv-theme="dark"] .mv-force-white * {
  color: var(--mv-dark-heading) !important;
  -webkit-text-fill-color: var(--mv-dark-heading) !important;
  text-decoration-color: var(--mv-dark-heading) !important;
}
html[data-mv-theme="dark"] .mv-text,
html[data-mv-theme="dark"] [data-mv-text] { color: var(--mv-dark-text) !important; }
html[data-mv-theme="dark"] .mv-muted,
html[data-mv-theme="dark"] [data-mv-muted] { color: var(--mv-dark-muted) !important; }
html[data-mv-theme="dark"] .mv-border,
html[data-mv-theme="dark"] [data-mv-border] { border-color: var(--mv-dark-border) !important; }
html[data-mv-theme="dark"] .mv-light-only { display: none !important; }
html[data-mv-theme="light"] .mv-dark-only { display: none !important; }

/* Service-page fallback. This applies only when the URL contains the configured /services/ path. */
html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled.mv-itechfix-service-page,
html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled.mv-itechfix-service-page #page,
html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled.mv-itechfix-service-page .site,
html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled.mv-itechfix-service-page .site-content,
html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled.mv-itechfix-service-page .site-main,
html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled.mv-itechfix-service-page main {
  background-color: var(--mv-dark-page) !important;
}

html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled.mv-itechfix-service-page
:is([data-elementor-type="wp-page"], [data-elementor-type="single"], .elementor-location-single) {
  background-color: var(--mv-dark-service-content) !important;
}

html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled.mv-itechfix-service-page
:is([data-elementor-type="wp-page"], [data-elementor-type="single"], .elementor-location-single)
> :is(.e-con, .elementor-section, .elementor-element):not(.mv-preserve):not([data-mv-preserve]) {
  background-color: var(--mv-dark-service-content) !important;
}

html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled.mv-itechfix-service-page
:is([data-elementor-type="wp-page"], [data-elementor-type="single"], .elementor-location-single)
> :is(.e-con, .elementor-section, .elementor-element):first-child:not(.mv-preserve):not([data-mv-preserve]) {
  background-color: var(--mv-dark-service-banner) !important;
}

/* Preserve Elementor background-overlay images on service and contact banners.
   The parent section stays dark and the overlay image opacity is controlled from admin. */
html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled
:is(.mv-service-banner, .mv-dark-banner) > .elementor-background-overlay,
html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled
:is(.mv-service-banner, .mv-dark-banner) .elementor-background-overlay.mv-banner-overlay-image {
  opacity: var(--mv-dark-banner-overlay-opacity, .55) !important;
  background-blend-mode: normal !important;
}

/* Elementor Flexbox Containers commonly render Background Overlay through ::before. */
html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled
:is(.mv-service-banner.e-con, .mv-dark-banner.e-con)::before {
  opacity: var(--mv-dark-banner-overlay-opacity, .55) !important;
}

/* Strong service-page typography fallback for Elementor widgets. */
html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled.mv-itechfix-service-page
:is(h1, h2, h3, h4, h5, h6, .elementor-heading-title, .elementor-icon-box-title, .elementor-image-box-title,
.elementor-accordion-title, .e-n-accordion-item-title-text, .elementor-tab-title, .elementor-counter-number-wrapper,
.elementor-counter-title, .elementor-testimonial__name)
:not(.mv-keep-color):not(.mv-keep-color *) {
  color: var(--mv-dark-heading) !important;
  -webkit-text-fill-color: var(--mv-dark-heading) !important;
  text-decoration-color: var(--mv-dark-heading) !important;
}

html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled.mv-itechfix-service-page
:is(.elementor-widget-text-editor, .elementor-icon-box-description, .elementor-image-box-description,
.elementor-testimonial__text, .elementor-accordion-content, .elementor-tab-content, .elementor-icon-list-text)
:not(.mv-keep-color):not(.mv-keep-color *) {
  color: var(--mv-dark-text) !important;
  -webkit-text-fill-color: var(--mv-dark-text) !important;
}

html[data-mv-theme="dark"] body.mv-itechfix-theme-enabled.mv-itechfix-service-page
:is(.elementor-widget-text-editor, .elementor-accordion-content, .elementor-tab-content)
*:not(.elementor-button):not(.elementor-button *):not(.mv-keep-color):not(.mv-keep-color *) {
  color: inherit;
  -webkit-text-fill-color: inherit;
}

/* Keep manually protected brand colors untouched. */
html[data-mv-theme="dark"] .mv-keep-color,
html[data-mv-theme="dark"] .mv-keep-color * {
  -webkit-text-fill-color: currentColor !important;
}

.mv-theme-floating {
  position: fixed;
  z-index: 999999;
  pointer-events: none;
}
.mv-theme-floating--bottom-right { right: 22px; bottom: 22px; }
.mv-theme-floating--bottom-left { left: 22px; bottom: 22px; }
.mv-theme-floating--top-right { right: 22px; top: 22px; }
.mv-theme-floating--top-left { left: 22px; top: 22px; }
.admin-bar .mv-theme-floating--top-right,
.admin-bar .mv-theme-floating--top-left { top: 54px; }

.mv-theme-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font: inherit;
  pointer-events: auto;
}
.mv-theme-toggle:focus-visible { outline: 3px solid rgba(245, 132, 31, .38); outline-offset: 4px; border-radius: 999px; }
.mv-theme-toggle__track {
  width: 58px;
  height: 32px;
  border-radius: 999px;
  background: #e7ecf2;
  border: 1px solid rgba(12, 28, 48, .12);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  position: relative;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .15);
}
.mv-theme-toggle__sun,
.mv-theme-toggle__moon { z-index: 2; display: grid; place-items: center; }
.mv-theme-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mv-theme-toggle__sun { color: #ef8a20; }
.mv-theme-toggle__moon { color: #64748b; }
.mv-theme-toggle__thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 9px rgba(15, 23, 42, .24);
  transform: translateX(0);
  transition: transform var(--mv-theme-transition) ease, background-color var(--mv-theme-transition) ease;
  z-index: 1;
}
html[data-mv-theme="dark"] .mv-theme-toggle__track { background: #16161c; border-color: #34343e; }
html[data-mv-theme="dark"] .mv-theme-toggle__thumb { transform: translateX(26px); background: #f8fafc; }
html[data-mv-theme="dark"] .mv-theme-toggle__moon { color: #d7e4ff; }
.mv-theme-toggle__label { font-size: 13px; font-weight: 700; color: inherit; }
.mv-theme-toggle--floating {
  padding: 9px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 12px 35px rgba(15,23,42,.20);
  backdrop-filter: blur(12px);
}
html[data-mv-theme="dark"] .mv-theme-toggle--floating {
  background: rgba(18,18,23,.94);
  color: var(--mv-dark-heading);
  border: 1px solid var(--mv-dark-border);
}

@media (prefers-reduced-motion: reduce) {
  html[data-mv-theme] body.mv-itechfix-theme-enabled,
  html[data-mv-theme] body.mv-itechfix-theme-enabled *,
  .mv-theme-toggle__thumb { transition-duration: 0ms !important; }
}
@media (max-width: 767px) {
  .mv-theme-floating--bottom-right { right: 14px; bottom: 14px; }
  .mv-theme-floating--bottom-left { left: 14px; bottom: 14px; }
}
