/*!
 * Coalesco UX Enhancement Layer
 * Sits ON TOP of the Webflow stylesheet — never overrides layout, only polish.
 * - Entrance animations (paired with ux-enhance.js Intersection Observer)
 * - Hover/focus micro-interactions on buttons, cards, links
 * - Sticky header with scroll-shadow
 * - Smooth scroll + reduced-motion guard
 */

:root {
  --ux-ease:       cubic-bezier(0.22, 1, 0.36, 1);
  --ux-ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ux-quick:      150ms;
  --ux-medium:     350ms;
  --ux-slow:       700ms;
  --ux-brand:      #1e915d;
  --ux-brand-dark: #0a3c15;
  --ux-accent:     #bcf031;
}

html { scroll-behavior: smooth; }

/* ═══════════════════════════════════════════════════════════
   KEINE Scroll-Entrance-Animationen.
   Inhalte sind IMMER sichtbar — Zuverlässigkeit vor Effekt.
   Der "smooth" Eindruck entsteht über Hover-, Sticky-Header-,
   Button- und Card-Interaktionen (weiter unten), die alle
   fail-safe sind (greifen nur bei echter Nutzer-Interaktion).
   ═══════════════════════════════════════════════════════════ */
.ux-fade,
.section-title,
.feature-content,
.service-card,
.choose-us-item,
.testimonial-card,
.blog-list-item,
.cta-content-wrapper,
.about-content,
.team-card,
.single-faq,
.single-text-box,
.location-address-box {
  opacity: 1 !important;
  transform: none !important;
}

/* ═══════════════════════════════════════════════════════════
   STICKY HEADER + SCROLL SHADOW
   ═══════════════════════════════════════════════════════════ */
section.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  transition: box-shadow var(--ux-medium) var(--ux-ease),
              backdrop-filter var(--ux-medium) var(--ux-ease);
}
section.header.is-scrolled {
  box-shadow: 0 8px 24px -12px rgba(0, 7, 3, 0.12);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}

/* ═══════════════════════════════════════════════════════════
   BUTTON MICRO-INTERACTIONS
   ═══════════════════════════════════════════════════════════ */
.button-primary,
.button-secondary,
.button-white-border,
.header-button,
.service-button,
.service-card-button,
.contact-button,
.w-button {
  transition: transform var(--ux-quick) var(--ux-ease),
              box-shadow  var(--ux-medium) var(--ux-ease),
              background  var(--ux-quick) var(--ux-ease),
              color       var(--ux-quick) var(--ux-ease),
              border-color var(--ux-quick) var(--ux-ease);
  will-change: transform;
}
.button-primary:hover,
.service-button:hover,
.contact-button:hover,
.w-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -8px rgba(30, 145, 93, 0.45);
}
.button-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -8px rgba(188, 240, 49, 0.55);
}
.button-white-border:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -8px rgba(255, 255, 255, 0.25);
}
.button-primary:active,
.button-secondary:active,
.button-white-border:active,
.service-button:active,
.contact-button:active,
.w-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px -6px rgba(0, 7, 3, 0.2);
}

/* Animated arrow inside button-icon containers */
.button-icon,
.header-button img,
.service-button img,
.button-primary img,
.button-secondary img {
  transition: transform var(--ux-medium) var(--ux-ease);
}
.button-primary:hover .button-icon,
.button-primary:hover img,
.button-secondary:hover .button-icon,
.button-secondary:hover img,
.service-button:hover .button-icon,
.service-button:hover img {
  transform: translateX(4px);
}

/* ═══════════════════════════════════════════════════════════
   CARDS: lift + image zoom on hover
   ═══════════════════════════════════════════════════════════ */
.service-card,
.choose-us-item,
.single-blog-item,
.testimonial-card,
.team-card,
.location-address-box {
  transition: transform var(--ux-medium) var(--ux-ease-out),
              box-shadow var(--ux-medium) var(--ux-ease-out);
  will-change: transform;
}
.service-card:hover,
.single-blog-item:hover,
.team-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -16px rgba(0, 7, 3, 0.15);
}
.choose-us-item:hover {
  transform: translateY(-3px);
}

/* Image zoom inside service / blog cards */
.service-card .service-image,
.service-card .service-image-wrapper img,
.single-blog-item .blog-image,
.feature-image,
.feature-image-wrapper img {
  transition: transform var(--ux-slow) var(--ux-ease-out);
  will-change: transform;
}
.service-card:hover .service-image,
.service-card:hover .service-image-wrapper img,
.single-blog-item:hover .blog-image {
  transform: scale(1.04);
}

/* Image wrapper needs overflow hidden so zoom is contained */
.service-image-wrapper,
.blog-image-link,
.feature-image-wrapper {
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   LINKS — underline reveal, partner logo grayscale
   ═══════════════════════════════════════════════════════════ */
.nav-link {
  position: relative;
  transition: color var(--ux-quick) var(--ux-ease);
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--ux-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ux-medium) var(--ux-ease);
}
.nav-link:hover { color: var(--ux-brand); }
.nav-link:hover::after,
.nav-link.w--current::after {
  transform: scaleX(1);
}

.link {
  transition: color var(--ux-quick) var(--ux-ease);
}
.link:hover { color: var(--ux-brand-dark); }

/* Footer link hover */
.footer-menu-item p,
.social-profile-link {
  transition: opacity var(--ux-quick) var(--ux-ease),
              transform var(--ux-quick) var(--ux-ease);
}
.footer-menu-item:hover p { opacity: 1; transform: translateX(2px); }
.social-profile-link:hover { transform: translateY(-2px); }

/* Partner logos: subtle grayscale to color */
.brand-logo,
.brand-section img {
  filter: grayscale(40%);
  opacity: 0.85;
  transition: filter var(--ux-medium) var(--ux-ease),
              opacity var(--ux-medium) var(--ux-ease),
              transform var(--ux-medium) var(--ux-ease);
}
.brand-logo:hover,
.brand-section img:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════
   FAQ ACCORDION (CSS-only fallback if Webflow JS misses)
   ═══════════════════════════════════════════════════════════ */
.single-faq {
  transition: background var(--ux-quick) var(--ux-ease);
}
.faq-question-wrapper {
  cursor: pointer;
  user-select: none;
}
.faq-answer-wrapper {
  overflow: hidden;
  transition: max-height var(--ux-medium) var(--ux-ease),
              opacity var(--ux-medium) var(--ux-ease);
}
.single-faq:not(.is-open) .faq-answer-wrapper {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
.single-faq.is-open .faq-answer-wrapper {
  max-height: 1000px;
  opacity: 1;
}
.icon-wrapper .line {
  transition: transform var(--ux-medium) var(--ux-ease);
}
.single-faq.is-open .icon-wrapper .line._01 {
  transform: rotate(90deg);
}

/* ═══════════════════════════════════════════════════════════
   FORM POLISH
   ═══════════════════════════════════════════════════════════ */
.text-field, .w-input, .w-select, textarea {
  transition: border-color var(--ux-quick) var(--ux-ease),
              box-shadow var(--ux-quick) var(--ux-ease),
              background var(--ux-quick) var(--ux-ease);
}
.text-field:focus, .w-input:focus, .w-select:focus, textarea:focus {
  border-color: var(--ux-brand) !important;
  box-shadow: 0 0 0 4px rgba(30, 145, 93, 0.12);
  outline: none;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE BURGER MENU — eigener CSS-Hamburger
   (Webflow nutzt ein Lottie-Icon, das ohne IX2-JS leer/unsichtbar
   bleibt. Hier ein robuster 3-Strich-Hamburger, der zu einem X wird.)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  /* Menü als Vollbild-Overlay, das von rechts einfährt.
     display:block !important überschreibt Webflows display:none (das per
     IX2-JS getoggled würde). Sichtbarkeit wird über transform+visibility
     gesteuert — funktioniert ganz ohne Webflow-JS. */
  .nav-menu {
    display: block !important;
    position: fixed;
    inset: 0;
    padding-top: 96px;
    background: #ffffff;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform var(--ux-medium) var(--ux-ease),
                visibility 0s linear var(--ux-medium);
    z-index: 95;
    overflow-y: auto;
  }
  .nav-menu.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform var(--ux-medium) var(--ux-ease);
  }

  .nav-item-list {
    flex-direction: column;
    padding: 16px 28px;
    gap: 0;
    align-items: stretch;
  }
  .nav-item {
    border-bottom: 1px solid #eff5f1;
  }
  .nav-link {
    font-size: 20px;
    font-weight: 500;
    display: block;
    padding: 20px 0;
  }

  /* ── Sichtbarer Hamburger-Button ── */
  .menu-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    cursor: pointer;
    position: relative;
    z-index: 101;
    background: transparent;
  }
  /* mittlerer Strich = das (leere) Lottie-div umfunktioniert */
  .menu-button .humburger-icon {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 24px !important;
    height: 2.5px !important;
    min-height: 2.5px !important;
    margin: -1px 0 0 -12px !important;
    padding: 0 !important;
    background: #0a3c15 !important;
    border-radius: 3px;
    transition: opacity 0.2s ease;
    overflow: hidden;
  }
  /* falls Lottie doch ein SVG einfügt: ausblenden */
  .menu-button .humburger-icon > * { display: none !important; }
  /* oberer + unterer Strich via Pseudo-Elemente */
  .menu-button::before,
  .menu-button::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 24px;
    height: 2.5px;
    margin-left: -12px;
    background: #0a3c15;
    border-radius: 3px;
    transition: transform 0.25s ease, top 0.25s ease, bottom 0.25s ease;
  }
  .menu-button::before { top: 13px; }
  .menu-button::after  { bottom: 13px; }

  /* offen → X */
  .menu-button.is-open .humburger-icon { opacity: 0; }
  .menu-button.is-open::before {
    top: 50%;
    margin-top: -1px;
    transform: rotate(45deg);
  }
  .menu-button.is-open::after {
    bottom: auto;
    top: 50%;
    margin-top: -1px;
    transform: rotate(-45deg);
  }
}

/* ═══════════════════════════════════════════════════════════
   IMAGE LOADING SHIMMER (skeleton for slow connections)
   ═══════════════════════════════════════════════════════════ */
img[loading="lazy"] {
  background: linear-gradient(
    90deg,
    #eff5f1 0%,
    #f8fbf9 50%,
    #eff5f1 100%
  );
  background-size: 200% 100%;
  animation: ux-shimmer 1.6s linear infinite;
}
img[loading="lazy"].is-loaded,
img.is-loaded {
  animation: none;
  background: transparent;
}
@keyframes ux-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════
   PAGE LOAD INTRO
   ═══════════════════════════════════════════════════════════ */
body { animation: ux-page-in 400ms ease-out 1 both; }
@keyframes ux-page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   REDUCED MOTION RESPECT
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ux-fade,
  .section-title,
  .hero-content-wrapper,
  .feature-content,
  .service-card,
  .choose-us-item,
  .testimonial-card,
  .blog-list-item,
  .cta-content-wrapper,
  .about-content,
  .team-card,
  .single-faq,
  .contact-area,
  .terms-content-area,
  .single-text-box,
  .location-address-box {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   IMAGE OVERFLOW SAFETY NET + LOGO SIZING
   (Webflow-Stylesheet enthält keinen globalen img-Reset und
   keine .brand-logo/.footer-logo Größenregel — daher hier.)
   ═══════════════════════════════════════════════════════════ */

/* Kein Bild darf je breiter als sein Container werden.
   height:auto erhält das Seitenverhältnis (CLS-sicher dank width/height-Attributen). */
img { max-width: 100%; height: auto; }

/* Partner-Logo-Band: alle Logos einheitlich hoch, Seitenverhältnis erhalten */
.brand-logo {
  height: 46px !important;
  width: auto !important;
  max-width: 160px;
  object-fit: contain;
  filter: grayscale(35%);
  opacity: 0.9;
  transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}
.brand-logo:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}
.brand-item-list {
  gap: 28px 44px;
}

/* Header-Logo */
.project-logo {
  height: auto !important;
  width: auto !important;
  max-width: 180px;
  max-height: 44px;
}

/* Footer-Logo (Asset ist 1186×1186 — muss hart begrenzt werden) */
.footer-logo {
  height: auto !important;
  width: auto !important;
  max-width: 200px;
  max-height: 56px;
}

/* Service-/Choose-/Core-/Insurance-Icons: konsistente Box */
.service-icon, .choose-icon, .core-icon, .insurance-icon {
  width: auto !important;
  height: auto !important;
  max-width: 60px;
  max-height: 60px;
  object-fit: contain;
}

/* Social-Icons im Footer */
.social-icon {
  width: 24px !important;
  height: auto !important;
}

@media (max-width: 767px) {
  .brand-logo { height: 34px !important; max-width: 110px; }
  .brand-item-list { gap: 20px 28px; }
  .project-logo { max-width: 150px; max-height: 38px; }
}
