/* ==========================================================================
   invo v2 — dark mode.
   <html data-theme="dark"> is set by the inline script in layout/theme.liquid
   (device preference, the Theme settings > Appearance mode, or the header
   toggle). The semantic tokens flip here; a few surfaces that must stay light
   (logos, product photos) are pinned below.
   ========================================================================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --invo-bg: #0f1b2a;
  --invo-surface: #16283b;
  --invo-tint: #143848;
  --invo-ink: #e8eef5;
  --invo-text-muted: #a3b3c4;
  --invo-line: #2b3f55;
  --invo-turquoise-700: #5cc6da;
  --invo-shadow-float: 0 18px 40px -4px rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] body { background: var(--invo-bg); color: var(--invo-ink); }

/* Pinned light surfaces: client logo circles, product photo boxes, avatars. */
html[data-theme="dark"] .invo-client,
html[data-theme="dark"] .invo-product__img,
html[data-theme="dark"] .invo-hero__avatars img { background: #fff; }
html[data-theme="dark"] .invo-client-card { background: var(--invo-surface); }

/* Header on inner pages: dark bar, white logo and chevrons. */
html[data-theme="dark"] #shopify-section-header .invo-header--light,
html[data-theme="dark"] #shopify-section-header .invo-header--light #header-main-bar { background: var(--invo-header-bg); border-bottom-color: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] #shopify-section-header .invo-header--light .invo-logo-crop img { filter: brightness(0) invert(1); }
html[data-theme="dark"] #shopify-section-header .invo-header--light .invo-nav-main .site-nav__item--flat > summary::after,
html[data-theme="dark"] #shopify-section-header .invo-header--light .invo-nav-main .site-nav__item--mega > summary::after { background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg%3E%3Cpath d='M4 6L8 10L12 6' stroke-width='1.33333' stroke-linecap='round' stroke-linejoin='round' stroke='white'/%3E%3C/g%3E%3C/svg%3E"); }
html[data-theme="dark"] #shopify-section-header .invo-header--light .invo-nav-main .site-nav__item:not(.site-nav__item--sale) > a,
html[data-theme="dark"] #shopify-section-header .invo-header--light .invo-nav-main .site-nav__item--flat:not(.site-nav__item--sale) > summary { color: #fff; }
html[data-theme="dark"] #shopify-section-header .invo-header--light .invo-lang-toggle button { color: #fff; }
html[data-theme="dark"] #shopify-section-header .invo-header--light .invo-header-cta { background: var(--invo-turquoise-500); color: var(--invo-navy-950); }
html[data-theme="dark"] #shopify-section-header .invo-header--light .nav-drawer__toggle,
html[data-theme="dark"] #shopify-section-header .invo-header--light .header-search__toggle,
html[data-theme="dark"] #shopify-section-header .invo-header--light .header-icon-item { color: #fff; }
html[data-theme="dark"] #shopify-section-header .invo-nav-main .site-nav__submenu { background: var(--invo-surface); border-color: var(--invo-line); }
html[data-theme="dark"] #shopify-section-header .invo-nav-main .site-nav__submenu a { color: var(--invo-ink); }

/* Surfaces that used a dark navy as *text-on-light* now need a visible edge. */
html[data-theme="dark"] .invo-btn--dark { background: var(--invo-navy-700); }
html[data-theme="dark"] .invo-btn--dark:hover { background: var(--invo-navy-900); }
html[data-theme="dark"] .invo-toggle button.is-active,
html[data-theme="dark"] .invo-filters button.is-active { background: var(--invo-turquoise-500); border-color: var(--invo-turquoise-500); color: var(--invo-navy-950); }
html[data-theme="dark"] .invo-plan--featured,
html[data-theme="dark"] .invo-side:not(.invo-side--light) { background: #1b3148; border-color: #1b3148; }
html[data-theme="dark"] .invo-side--light { background: var(--invo-tint); }
html[data-theme="dark"] .invo-stats { background: #12263a; }
html[data-theme="dark"] .invo-faq__icon { background: var(--invo-turquoise-500); }
html[data-theme="dark"] .invo-faq__icon::before, html[data-theme="dark"] .invo-faq__icon::after { background: var(--invo-navy-950); }
html[data-theme="dark"] .invo-table__row--head { background: #1b3148; }
html[data-theme="dark"] .invo-phone { background: #1b3148; }
html[data-theme="dark"] .invo-post--event .invo-post__top { background: #1b3148; }
html[data-theme="dark"] .invo-stepcard__num, html[data-theme="dark"] .invo-step__num { color: var(--invo-navy-950); }

/* Legacy store pages (cart, shop, product, account ...): they still use the
   old fixed colours, so the page body is inverted and photos/video flipped back. */
html[data-theme="dark"] #shopify-section-main { filter: invert(0.92) hue-rotate(180deg); background: #f4f7fb; }
html[data-theme="dark"] #shopify-section-main :is(img, video, picture, iframe, canvas, model-viewer, [style*="background-image"]) { filter: invert(1) hue-rotate(180deg); }
/* The cart drawer is styled with the tokens now (invo-cart.css), so it is not inverted. */
html[data-theme="dark"] :is(.wishlist-drawer-panel, .auth-modal, .logout-confirm-modal, .cx-cart-popup) { filter: invert(0.92) hue-rotate(180deg); }
html[data-theme="dark"] :is(.wishlist-drawer-panel, .auth-modal) :is(img, video) { filter: invert(1) hue-rotate(180deg); }

/* Theme toggle in the header */
.invo-color-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.invo-color-toggle:hover { background: rgba(255, 255, 255, 0.2); }
.invo-color-toggle svg { width: 22px; height: 22px; }
.invo-color-toggle .invo-ico-sun { display: none; }
html[data-theme="dark"] .invo-color-toggle .invo-ico-sun { display: block; }
html[data-theme="dark"] .invo-color-toggle .invo-ico-moon { display: none; }
#shopify-section-header .invo-header--light .invo-color-toggle { background: var(--invo-surface); color: var(--invo-ink); }
html[data-theme="dark"] #shopify-section-header .invo-header--light .invo-color-toggle { background: rgba(255, 255, 255, 0.1); color: #fff; }
@media (max-width: 999px) { .invo-color-toggle { width: 42px; height: 42px; } }

/* Teal line icons on dark tiles: lift their brightness. */
html[data-theme="dark"] :is(.invo-card__icon, .invo-feature__icon, .invo-ind__icon, .invo-chip, .invo-offer, .invo-sector__foot, .invo-link, .invo-crumbs, .invo-plan__check) :is(img, svg) { filter: brightness(1.75); }

html[data-theme="dark"] .invo-plan:not(.invo-plan--featured) .invo-plan__list li { color: var(--invo-ink); }
html[data-theme="dark"] .invo-pricing--page .invo-plan:not(.invo-plan--featured) .invo-plan__list li.invo-plan__note-item { color: var(--invo-text-muted); }

/* Small phones: fit logo + toggle + language + demo button on one row. */
@media (max-width: 480px) {
  #shopify-section-header .header-main { gap: 8px; padding-inline: 14px; }
  #shopify-section-header .header-main__right { gap: 8px; }
  #shopify-section-header .invo-logo-crop--header { width: 84px; height: 31px; }
  .invo-color-toggle { width: 38px; height: 38px; }
  .invo-color-toggle svg { width: 20px; height: 20px; }
  .invo-lang-toggle button { font-size: 13px; }
  .invo-header-cta { padding: 8px 10px; font-size: 13px; line-height: 18px; border-radius: 9px; }
}

/* Mobile header: dark mode toggle stays visible, the language toggle moves to the side menu. */
@media (max-width: 999px) {
  #shopify-section-header .header-main__right .invo-lang-toggle { display: none; }
}
.invo-drawer-actions__theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: #1b3a5f;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 24px;
  cursor: pointer;
  text-align: start;
}
.invo-drawer-actions__theme:hover { background: #20426b; }
.invo-drawer-actions__theme-label { display: inline-flex; align-items: center; gap: 12px; }
.invo-drawer-actions__theme-label svg { width: 20px; height: 20px; flex: 0 0 auto; }
.invo-switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #4b6280;
  transition: background-color 0.2s ease;
}
.invo-switch__knob {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: inset-inline-start 0.2s ease;
}
html[data-theme="dark"] .invo-switch { background: var(--invo-turquoise-500); }
html[data-theme="dark"] .invo-switch__knob { inset-inline-start: 21px; }

/* Restyled pages (cart) use the tokens, so they must not be inverted by the legacy fallback above. */
html[data-theme="dark"] #shopify-section-main:has(.invo-cart, .invo-shop--category) { filter: none; background: transparent; }
html[data-theme="dark"] #shopify-section-main:has(.invo-cart, .invo-shop--category) :is(img, video, picture, iframe, canvas, [style*="background-image"]) { filter: none; }

/* Offer banners ("Mix & match", progress bars) on the cart, drawer and product pages. */
html[data-theme="dark"] :is(.ox-offer, .ox-offer-card, .ox-offer-progress, .ox-offer-progress-drawer .ox-offer-progress--compact, .cart-offer) { background: var(--invo-tint); border-color: var(--invo-line); color: var(--invo-ink); }
html[data-theme="dark"] :is(.ox-offer-progress__text, .ox-offer-card__title, .ox-offer-card__sub, .ox-offer__title, .cart-offer__title, .cart-offer__sub) { color: var(--invo-ink); }
html[data-theme="dark"] :is(.ox-offer-progress__bar, .cart-offer .ox-offer-progress__bar) { background: var(--invo-line); }
html[data-theme="dark"] .cart-offer__icon { background: var(--invo-bg); color: var(--invo-turquoise-500); }
html[data-theme="dark"] .ox-offer-progress__meta, html[data-theme="dark"] .cart-offer__count { color: var(--invo-text-muted); }
html[data-theme="dark"] .cart-offer__btn { background: transparent; color: var(--invo-turquoise-500); border-color: var(--invo-turquoise-500); }
html[data-theme="dark"] :is(.cart-offer__pct, .ox-offer-card__label, .cart-offer__badge) { color: var(--invo-navy-950); }

/* Areas inverted by the legacy fallback must use light native controls (scrollbars, inputs): the invert turns them dark. */
html[data-theme="dark"] #shopify-section-main,
html[data-theme="dark"] :is(.wishlist-drawer-panel, .auth-modal, .logout-confirm-modal, .cx-cart-popup) { color-scheme: light; }
html[data-theme="dark"] #shopify-section-main:has(.invo-cart, .invo-shop--category) { color-scheme: dark; }

/* ---- Animation when switching light / dark ---- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
/* fallback for browsers without View Transitions: fade the colours */
.invo-theme-anim, .invo-theme-anim *, .invo-theme-anim *::before, .invo-theme-anim *::after {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, fill 0.4s ease, stroke 0.4s ease, box-shadow 0.4s ease !important;
}
/* the sun / moon spins in */
.invo-color-toggle.is-spinning svg, .invo-drawer-actions__theme.is-spinning svg { animation: invoToggleSpin 0.6s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes invoToggleSpin { from { transform: rotate(-120deg) scale(0.3); opacity: 0; } to { transform: rotate(0) scale(1); opacity: 1; } }
.invo-switch, .invo-switch__knob { transition: background-color 0.3s ease, inset-inline-start 0.3s ease; }
@media (prefers-reduced-motion: reduce) {
  .invo-color-toggle.is-spinning svg, .invo-drawer-actions__theme.is-spinning svg { animation: none; }
}
