/* Shared AppFactory product-family shell. Product pages only supply color tokens. */

html[data-site="appfactory"] {
  --shell-page: #ffffff;
  --shell-raised: #ffffff;
  --shell-soft: #f5f6f7;
  --shell-deep: #15171a;
  --shell-text: #15171a;
  --shell-muted: #626970;
  --shell-line: #dde1e4;
  --shell-accent: #ff6557;
  --shell-footer-text: #c8cbd0;
}

html[data-site="appfactory"][data-theme="dark"] {
  --shell-page: #111417;
  --shell-raised: #191d21;
  --shell-soft: #20252a;
  --shell-deep: #0a0c0e;
  --shell-text: #f5f7f8;
  --shell-muted: #abb2b9;
  --shell-line: #333a41;
  --shell-accent: #ff7467;
  --shell-footer-text: #aeb5bc;
}

html[data-site="lilcoach"] {
  --shell-page: var(--page);
  --shell-raised: var(--surface-raised);
  --shell-soft: var(--surface-soft);
  --shell-deep: var(--page-deep);
  --shell-text: var(--text);
  --shell-muted: var(--text-muted);
  --shell-line: var(--line);
  --shell-accent: var(--coral);
  --shell-footer-text: var(--text-muted);
}

html[data-site="browse"] {
  --shell-page: var(--page);
  --shell-raised: var(--surface-raised);
  --shell-soft: var(--surface-soft);
  --shell-deep: var(--page-deep);
  --shell-text: var(--text);
  --shell-muted: var(--text-muted);
  --shell-line: var(--line);
  --shell-accent: var(--mint);
  --shell-footer-text: var(--text-soft);
}

.ecosystem-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--shell-line);
  background: color-mix(in srgb, var(--shell-page) 92%, transparent);
  backdrop-filter: blur(18px);
}

.ecosystem-header.scrolled {
  box-shadow: 0 12px 30px rgb(0 0 0 / 8%);
}

.ecosystem-nav {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.ecosystem-header .brand-cluster {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.ecosystem-header .brand,
.ecosystem-footer .footer-brand {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 9px;
  color: var(--shell-text);
  font-family: Sora, "DM Sans", sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.ecosystem-header .brand > img,
.ecosystem-footer .footer-brand > img,
.ecosystem-header .brand-mark-wrap,
.ecosystem-footer .brand-mark-wrap {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}

.ecosystem-header .brand > img,
.ecosystem-footer .footer-brand > img,
.ecosystem-header .brand-mark,
.ecosystem-footer .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: contain;
}

.ecosystem-header .nav-links {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.section-nav {
  display: flex;
  align-items: center;
  gap: 3px;
}

.mobile-product-nav {
  display: none;
}

.ecosystem-header .nav-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--shell-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.ecosystem-header .section-link:hover,
.ecosystem-header .section-link:focus-visible {
  color: var(--shell-text);
  background: var(--shell-soft);
  outline: none;
}

.ecosystem-header .nav-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ecosystem-header .icon-button,
.ecosystem-header .products-switcher > summary,
.ecosystem-header .language-switcher > summary,
.ecosystem-header .menu-button {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--shell-line);
  border-radius: 7px;
  color: var(--shell-muted);
  background: var(--shell-soft);
  cursor: pointer;
}

.ecosystem-header .icon-button:hover,
.ecosystem-header .icon-button:focus-visible,
.ecosystem-header .products-switcher > summary:hover,
.ecosystem-header .products-switcher > summary:focus-visible,
.ecosystem-header .language-switcher > summary:hover,
.ecosystem-header .language-switcher > summary:focus-visible,
.ecosystem-header .menu-button:hover,
.ecosystem-header .menu-button:focus-visible {
  border-color: var(--shell-accent);
  color: var(--shell-text);
  outline: none;
}

.ecosystem-header .products-switcher,
.ecosystem-header .language-switcher {
  position: relative;
}

.ecosystem-header .products-switcher > summary,
.ecosystem-header .language-switcher > summary {
  gap: 6px;
  padding-inline: 9px;
  list-style: none;
  font-size: 12px;
  font-weight: 800;
}

.ecosystem-header .products-switcher > summary {
  min-width: 158px;
  justify-content: flex-start;
  padding-inline: 12px 10px;
}

.ecosystem-header .products-switcher > summary span {
  color: var(--shell-muted);
}

.ecosystem-header .products-switcher > summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--shell-text);
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecosystem-header .language-switcher > summary {
  min-width: 74px;
}

.ecosystem-header .products-switcher > summary::-webkit-details-marker,
.ecosystem-header .language-switcher > summary::-webkit-details-marker {
  display: none;
}

.ecosystem-header .products-menu,
.ecosystem-header .language-menu {
  position: absolute;
  top: calc(100% + 8px);
  display: grid;
  overflow: hidden;
  border: 1px solid var(--shell-line);
  border-radius: 8px;
  background: var(--shell-raised);
  box-shadow: 0 22px 50px rgb(0 0 0 / 18%);
}

.ecosystem-header .products-menu {
  left: 0;
  width: 220px;
  padding: 6px;
}

.ecosystem-header .language-menu {
  right: 0;
  width: 190px;
}

.ecosystem-header .product-menu-link,
.ecosystem-header .language-menu a {
  min-height: 42px;
  justify-content: space-between;
  border: 0;
  border-bottom: 1px solid var(--shell-line);
  border-radius: 0;
  padding: 10px 12px;
}

.ecosystem-header .product-menu-link {
  position: relative;
  border-bottom: 0;
  border-radius: 6px;
  color: var(--shell-muted);
  font-size: 13px;
  font-weight: 800;
}

.ecosystem-header .language-menu a:last-child {
  border-bottom: 0;
}

.ecosystem-header .product-menu-link:hover,
.ecosystem-header .product-menu-link:focus-visible,
.ecosystem-header .product-menu-link[aria-current="page"],
.ecosystem-header .language-menu a:hover,
.ecosystem-header .language-menu a:focus-visible,
.ecosystem-header .language-menu a[aria-current="page"] {
  color: var(--shell-text);
  background: var(--shell-soft);
  outline: none;
}

.ecosystem-header .product-menu-link[aria-current="page"] {
  box-shadow: inset 2px 0 0 var(--shell-accent);
}

.ecosystem-header .language-menu a[aria-current="page"]::after {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: var(--shell-accent);
  content: "";
}

.ecosystem-header .menu-button {
  display: none;
}

.ecosystem-header .theme-toggle .icon-sun,
.ecosystem-header .menu-button .icon-close {
  display: none;
}

html[data-theme="light"] .ecosystem-header .theme-toggle .icon-moon {
  display: none;
}

html[data-theme="light"] .ecosystem-header .theme-toggle .icon-sun {
  display: inline-block;
}

.ecosystem-header .icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 auto;
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.ecosystem-header .icon-moon {
  mask-image: url("/lilcoach/assets/icons/moon.svg");
}

.ecosystem-header .icon-sun {
  mask-image: url("/lilcoach/assets/icons/sun.svg");
}

.ecosystem-header .icon-menu {
  mask-image: url("/lilcoach/assets/icons/menu.svg");
}

.ecosystem-header .icon-close {
  mask-image: url("/lilcoach/assets/icons/x.svg");
}

.ecosystem-header .icon-globe {
  mask-image: url("/lilcoach/assets/icons/globe.svg");
}

.ecosystem-header .icon-chevron {
  width: 13px;
  height: 13px;
  mask-image: url("/lilcoach/assets/icons/chevron-down.svg");
  transition: transform 150ms ease;
}

.ecosystem-header .language-switcher[open] .icon-chevron {
  transform: rotate(180deg);
}

.ecosystem-header .products-switcher[open] .icon-chevron {
  transform: rotate(180deg);
}

.ecosystem-footer {
  border-top: 1px solid var(--shell-line);
  padding: 54px 0 24px;
  color: var(--shell-text);
  background: var(--shell-deep);
}

html[data-site="appfactory"] .ecosystem-footer,
html[data-site="lilcoach"] .ecosystem-footer,
html[data-site="browse"] .ecosystem-footer {
  --shell-text: #f4f6f8;
  --shell-muted: var(--shell-footer-text);
  --shell-line: rgb(255 255 255 / 14%);
}

.ecosystem-footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) repeat(3, minmax(130px, 0.5fr));
  gap: 42px;
}

.ecosystem-footer .footer-copy {
  max-width: 300px;
  margin: 17px 0 0;
  color: var(--shell-muted);
  font-size: 13px;
  line-height: 1.65;
}

.ecosystem-footer .footer-links {
  display: grid;
  align-content: start;
  gap: 9px;
}

.ecosystem-footer .footer-links strong {
  margin-bottom: 3px;
  color: var(--shell-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ecosystem-footer .footer-links a {
  width: max-content;
  max-width: 100%;
  color: var(--shell-muted);
  font-size: 14px;
  text-decoration: none;
}

.ecosystem-footer .footer-links a:hover,
.ecosystem-footer .footer-links a:focus-visible,
.ecosystem-footer .footer-links a[aria-current="page"] {
  color: var(--shell-text);
  outline: none;
}

.ecosystem-footer .footer-links a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--shell-accent);
  text-underline-offset: 4px;
}

.ecosystem-footer .footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 44px;
  border-top: 1px solid var(--shell-line);
  padding-top: 20px;
  color: var(--shell-muted);
  font-size: 12px;
}

.ecosystem-footer .footer-languages {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 15px;
}

.ecosystem-footer .footer-languages a {
  color: var(--shell-muted);
  text-decoration: none;
}

.ecosystem-footer .footer-languages a:hover,
.ecosystem-footer .footer-languages a:focus-visible,
.ecosystem-footer .footer-languages a[aria-current="page"] {
  color: var(--shell-text);
  outline: none;
}

@media (max-width: 1120px) {
  body.nav-open {
    overflow: hidden;
  }

  .ecosystem-nav {
    grid-template-columns: 1fr auto;
  }

  .ecosystem-header .nav-links {
    position: fixed;
    inset: 68px 0 auto;
    max-height: calc(100vh - 68px);
    display: none;
    overflow-y: auto;
    border-bottom: 1px solid var(--shell-line);
    padding: 18px max(24px, calc((100vw - 1120px) / 2)) 26px;
    background: var(--shell-page);
  }

  .ecosystem-header .nav-links.open {
    display: grid;
    align-items: stretch;
    justify-content: stretch;
    gap: 16px;
  }

  .section-nav,
  .mobile-product-nav {
    width: 100%;
    display: grid;
    gap: 0;
  }

  .mobile-product-nav {
    border-top: 1px solid var(--shell-line);
    padding: 16px 0 0;
  }

  .ecosystem-header .nav-links a {
    min-height: 48px;
    border-bottom: 1px solid var(--shell-line);
    border-radius: 0;
    padding: 13px 4px;
    font-size: 15px;
  }

  .ecosystem-header .mobile-product-nav .product-menu-link {
    margin-top: 7px;
    border: 1px solid var(--shell-line);
    border-radius: 6px;
    padding-inline: 12px;
  }

  .ecosystem-header .menu-button {
    display: inline-flex;
  }

  .ecosystem-header .menu-button[aria-expanded="true"] .icon-menu {
    display: none;
  }

  .ecosystem-header .menu-button[aria-expanded="true"] .icon-close {
    display: inline-block;
  }
}

@media (max-width: 760px) {
  .ecosystem-nav {
    min-height: 60px;
    gap: 12px;
  }

  .ecosystem-header .nav-links {
    inset: 60px 0 auto;
    max-height: calc(100vh - 60px);
    padding-inline: 16px;
  }

  .ecosystem-header .products-switcher {
    display: none;
  }

  .ecosystem-header .language-switcher > summary {
    min-width: 66px;
    padding-inline: 8px;
  }

  .ecosystem-header .language-switcher > summary .icon-chevron {
    display: none;
  }

  .ecosystem-header .language-switcher > summary .icon-globe {
    display: inline-block;
  }

  .ecosystem-footer {
    padding-top: 42px;
  }

  .ecosystem-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 34px 24px;
  }

  .ecosystem-footer-grid > :first-child {
    grid-column: 1 / -1;
  }

  .ecosystem-footer .footer-bottom {
    display: grid;
  }

  .ecosystem-footer .footer-languages {
    justify-content: flex-start;
  }
}

@media (max-width: 460px) {
  .ecosystem-header .brand {
    max-width: 136px;
  }

  .ecosystem-header .brand-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ecosystem-footer-grid {
    grid-template-columns: 1fr;
  }

  .ecosystem-footer-grid > :first-child {
    grid-column: auto;
  }
}

@media (max-width: 360px) {
  .ecosystem-nav {
    gap: 10px;
  }

  .ecosystem-header .brand {
    max-width: 28px;
    gap: 0;
  }

  .ecosystem-header .brand-name {
    display: none;
  }
}
