/* Global non-critical site chrome: footer and sticky call bar. */

/* === FOOTER — FINAL LAYOUT (appended) === */
.footer { background: var(--color-bg-footer); color: var(--color-text-muted-on-dark); border-top: 1px solid rgba(var(--primary-rgb), 0.3); padding: 1.6rem 0 1.2rem; padding-bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px)); overflow-x: clip; }
.footer .footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 2.8vw, 2.5rem);
  min-width: 0;
}
.footer .footer__main {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "nav    aside"
    "bottom bottom";
  gap: clamp(1.25rem, 3vw, 2.4rem);
  align-items: start;
}
.footer .footer__mark {
  display: inline-flex;
  align-items: center;
  width: 22px;
  height: 22px;
  line-height: 0;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.footer .footer__mark:hover { opacity: 1; }
.footer .footer__mark svg { display: block; width: 100%; height: 100%; }

/* --- Nav columns: 4 equal columns --- */
.footer .footer__nav {
  grid-area: nav;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.4rem, 2.2vw, 2.4rem);
  align-items: start;
  min-width: 0;
  margin: 0;
  gap: clamp(1rem, 2vw, 2rem);
}

/* --- Bottom bar: © | legal links | social --- */
.footer .footer__bottom {
  grid-area: bottom;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1rem;
}
.footer .footer__copy {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--color-text-muted-on-dark);
}
.footer .footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.15rem 0.65rem;
  flex: 1;
}
.footer .footer__legal a,
.footer .footer__legal .footer-link-button {
  color: var(--color-text-muted-on-dark);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  transition: color 0.2s;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.footer .footer__legal a:hover,
.footer .footer__legal .footer-link-button:hover {
  color: var(--primary);
}
.footer .footer__credits {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.footer .footer__social-link {
  color: rgba(255,255,255,0.35);
  display: inline-flex;
  transition: color 0.2s;
}
.footer .footer__social-link--x svg {
  transform: translateY(1px);
}
.footer .footer__social-link:hover {
  color: #fff;
}
.footer .footer__aside {
  grid-area: aside;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 41px;
}
.footer .footer__group {
  min-width: 0;
}
.footer .footer__heading {
  margin: 0 0 0.95rem;
  color: rgba(255,255,255,0.76);
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer .footer__heading a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.footer .footer__heading a:hover {
  color: var(--primary);
}
.footer .footer__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.56rem;
  margin: 0;
  padding: 0;
}
.footer .footer__item--sub {
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.76);
  margin-top: 0.95rem;
  margin-bottom: 0;
}

.footer .footer__item--sub:first-child {
  margin-top: 0;
}

.footer .footer__item.footer__item--sub a {
  color: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.footer .footer__item.footer__item--sub a:hover {
  color: var(--primary);
}

.footer .footer__item a {
  color: var(--color-text-muted-on-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.06rem 0;
  position: relative;
  transition: color 0.2s;
}
.footer .footer__item a:hover {
  color: var(--primary);
}
.footer .footer__item a.active {
  color: var(--primary);
}
.footer .footer__item a::after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.footer .footer__item a:hover::after,
.footer .footer__item a.active::after {
  width: 100%;
}
.footer .footer__item a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.footer .footer-link-button {
  background: transparent;
  border: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  display: inline-block;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.45;
  padding: 0.06rem 0;
  text-align: left;
  transition: color 0.2s;
  white-space: normal;
}
.footer .footer-link-button:hover,
.footer .footer-link-button:focus-visible {
  color: var(--primary);
  outline: none;
}
/* (old footer__tools/social-link rules removed — social now in footer__bottom) */

/* Back-to-top: fixed bottom-right, minimal arrow, fade in */
.footer__up-button {
  position: fixed;
  bottom: 2.5rem;
  right: 1.2rem;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(var(--primary-rgb), 0.5);
  font-size: 1.5rem;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.4s ease, color 0.25s ease, font-size 0.3s ease, padding 0.3s ease, background 0.3s ease;
  cursor: pointer;
}
.footer__up-button.is-visible {
  display: inline-flex;
  opacity: 1;
}
.footer__up-button.is-scrolling-up {
  font-size: 1.6rem;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
  padding: 0.4rem 0.3rem 0.5rem;
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(var(--primary-rgb), 0.15);
}
.footer__up-button:hover,
.footer__up-button:focus-visible {
  color: var(--primary);
  background: transparent;
  border: none;
  box-shadow: none;
  transform: none;
  outline: none;
}

/* --- Footer mobile (≤ 900px) --- */
@media (max-width: 900px) {
  .footer .footer__inner {
    padding-left: calc(1.5rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1.5rem + env(safe-area-inset-right, 0px));
  }
  .footer .footer__main {
    display: flex;
    flex-direction: column;
    gap: 1.45rem;
  }
  /* Roboter full width, then Leistungen | Unternehmen side by side */
  .footer .footer__nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.45rem 2rem;
    width: 100%;
  }
  /* 4 columns → 2x2 grid on mobile */
  .footer .footer__group {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .footer .footer__item a,
  .footer .footer-link-button {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  /* Footer headings keep one-line uppercase styling; long German labels
     ("REINIGUNGSROBOTER", "TRANSPORTROBOTER", "SERVIERROBOTER") used to
     break a single trailing letter onto the next line because the 2x2
     grid only gives ~140 px per column on a 360 px viewport. Solution:
     scale the heading font with the viewport via clamp() and tighten
     letter-spacing slightly so the word always fits. Style is otherwise
     unchanged (same family, weight, uppercase). Min/max are calibrated
     to keep the word inside a 320 px viewport column at the floor and
     match the desktop 0.79rem at the ceiling. */
  .footer .footer__heading,
  .footer .footer__item.footer__item--sub,
  .footer .footer__item.footer__item--sub a {
    font-size: clamp(0.6rem, 0.47rem + 0.56vw, 0.79rem);
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
  .footer .footer__aside {
    position: fixed;
    bottom: 2.5rem;
    right: 1rem;
    z-index: 100;
  }
  /* Bottom bar: stack centered */
  .footer .footer__bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2.2rem;
  }
  .footer .footer__legal {
    justify-content: center;
    order: -1;
  }
  .footer .footer__credits {
    margin-left: 0;
    order: 1;
  }
  .footer .footer__item a,
  .footer .footer-link-button {
    display: block;
    padding: 0.2rem 0;
  }
}

/* --- Footer small mobile (≤ 599px) --- */
@media (max-width: 599px) {
  .footer { padding-top: 1.2rem; padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)); }
  .footer .footer__heading { margin-bottom: 0.65rem; }
  .footer .footer__copy {
    font-size: 0.75rem;
    white-space: normal;
  }
}

/* Mobile sticky call bar */
.call-bar { position: fixed; left: 12px; right: 12px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); background: rgba(24,24,24,0.96); border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 8px 24px rgba(0,0,0,0.35); border-radius: 12px; display: none; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.55rem 0.75rem; z-index: 4000; backdrop-filter: saturate(140%) blur(8px); }
.call-bar.show { display: flex; }
.call-bar .call-bar-link { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--accent); font-weight: 800; text-decoration: none; }
.call-bar .call-bar-link:hover .call-bar-text { text-decoration: underline; }
.call-bar .call-bar-link:active { transform: translateY(1px); }
.call-bar .call-bar-icon { font-size: 1.1rem; }
.call-bar .call-bar-text { font-size: 1rem; color: #fff; }
.call-bar .call-bar-close { margin-left: auto; background: none; border: none; color: #aaa; font-size: 1.2rem; cursor: pointer; padding: 0 0.35rem; }
.call-bar .call-bar-close:hover { color: #fff; }

/* Only show the call bar on small viewports */
@media (min-width: 641px) {
  .call-bar { display: none !important; }
}
