/* ============================================================
   HWS HEADER & FOOTER - Plugin-Grundstyles
   Farben kommen als CSS-Variablen aus dem Admin-Bereich
   (siehe hws-header-footer.php -> wp_add_inline_style)
   ============================================================ */

.hff-header {
  font-family: var(--hff-font);
  border-bottom: 1px solid #eee;
  position: relative;
  background: #fff;
  transition: box-shadow .2s ease;
}

/* Fixiertes/Sticky Menü - bleibt beim Scrollen oben sichtbar */
.hff-header.hff-sticky {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  transition: box-shadow .2s ease;
}
.hff-header.hff-sticky.hff-scrolled {
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}

.hff-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 32px 10px;
  gap: 16px;
  flex-wrap: wrap;
}
.hff-logo img {
  height: var(--hff-logo-h-desktop, 70px);
  width: auto;
  display: block;
  position: relative;
  top: var(--hff-logo-offset-top, 0px);
}

.hff-header-right {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.hff-lang a { color: var(--hff-menu-text); text-decoration: none; font-size: 14px; letter-spacing: .5px; }
.hff-lang a.active { font-weight: 600; }
.hff-lang span { color: #ccc; margin: 0 4px; }

.hff-btn {
  background: var(--hff-btn-bg);
  color: #fff !important;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.hff-btn:hover { background: var(--hff-btn-bg-hover); }

/* Suche: Icon + aufklappbares Eingabefeld */
.hff-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.hff-search-btn {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px !important;
  cursor: pointer;
  line-height: 0;
}
.hff-search-btn svg { width: 20px; height: 20px; stroke: var(--hff-menu-text); }
.hff-search-form {
  display: flex;
  align-items: center;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,.10);
  padding: 6px 6px 6px 14px;
  min-width: 260px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  z-index: 30;
}
.hff-search-wrap.hff-search-open .hff-search-form {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear 0s;
}
.hff-search-form input[type="search"] {
  border: none;
  outline: none;
  font-size: 14px;
  font-family: var(--hff-font);
  flex: 1;
  min-width: 0;
  background: transparent;
  color: var(--hff-menu-text);
}
.hff-search-form button[type="submit"] {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  padding: 4px !important;
  line-height: 0;
}
.hff-search-form button[type="submit"] svg { width: 18px; height: 18px; stroke: var(--hff-menu-text); }

/* Suche komplett ausblenden, wenn im Admin deaktiviert */
.hff-header.hff-no-search .hff-search-wrap { display: none; }

/* Burger-Icon (nur mobil sichtbar) */
.hff-burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0;
  cursor: pointer;
  order: 1;
  -webkit-appearance: none;
  appearance: none;
}
.hff-burger:hover,
.hff-burger:focus,
.hff-burger:active {
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
}
.hff-burger span {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--hff-menu-text);
  transition: transform .25s ease, opacity .25s ease;
}
.hff-header.hff-open .hff-burger span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.hff-header.hff-open .hff-burger span:nth-child(2) { opacity: 0; }
.hff-header.hff-open .hff-burger span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* Navigation (Desktop) */
.hff-nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
.hff-nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.hff-nav li { position: relative; }
.hff-nav > ul > li > a {
  display: inline-block;
  padding: 14px 0 16px;
  color: var(--hff-menu-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .5px;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
}
.hff-nav > ul > li:hover > a,
.hff-nav > ul > li.hff-current > a,
.hff-nav > ul > li > a.hff-current { color: var(--hff-menu-hover); }
.hff-nav > ul > li.hff-current > a,
.hff-nav > ul > li > a.hff-current { border-bottom-color: var(--hff-menu-underline); }

/* Dropdown (Desktop = Hover, Mobil = Klick via JS-Klasse) */
/* Dropdown wird ausschliesslich per JS-Klasse gesteuert (kein CSS :hover mehr),
   damit es nicht "haengen bleiben" kann und auf allen Geraeten gleich funktioniert. */
.hff-dropdown {
  display: none !important;
  position: absolute;
  top: 100%;
  left: 0;
  background: #f4f4f4;
  min-width: 200px;
  padding: 4px 0;
  margin: 0;
  list-style: none;
  box-shadow: 0 8px 16px rgba(0,0,0,.08);
  z-index: 20;
}
.hff-has-dropdown.hff-dd-open .hff-dropdown { display: block !important; }
.hff-dropdown li a {
  display: block;
  padding: 14px 20px;
  color: var(--hff-menu-text);
  text-decoration: none;
  font-weight: 400;
  font-size: 14px;
  text-transform: none;
  border-bottom: 1px solid #e9e9e9;
}
.hff-dropdown li:last-child a { border-bottom: none; }
.hff-dropdown li a:hover { color: var(--hff-menu-hover); }

/* ============================================================
   MOBILE (Burger-Menü)
   ============================================================ */
@media (max-width: 900px) {
  .hff-logo img { height: var(--hff-logo-h-mobile, 50px); top: 0; }
  .hff-header-top { padding: 16px 20px; flex-wrap: wrap; }
  .hff-burger { display: flex; }
  .hff-header.hff-burger-left .hff-burger { order: -1; }

  /* Statt hartem display:none/block -> sanftes Auf-/Zuklappen
     mit max-height + Opacity + leichtem Verschieben.
     flex-basis: 100% sorgt dafuer, dass dieser Block IMMER auf
     eine eigene Zeile faellt, egal ob sichtbar oder eingeklappt -
     so bleiben Logo und Burger zuverlaessig in einer Reihe. */
  .hff-header-right {
    order: 2;
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 12px;
    padding: 0 20px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-6px);
    transition: max-height .35s ease, opacity .25s ease, transform .3s ease, padding .35s ease;
  }
  .hff-nav {
    order: 4;
    flex-basis: 100%;
    width: 100%;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-6px);
    transition: max-height .35s ease, opacity .25s ease .05s, transform .3s ease;
  }

  .hff-header.hff-open .hff-header-right {
    max-height: 220px;
    opacity: 1;
    transform: translateY(0);
    padding: 16px 20px 0;
  }
  .hff-header.hff-open .hff-nav {
    max-height: 800px;
    opacity: 1;
    transform: translateY(0);
    padding: 0 20px 20px;
  }

  .hff-nav ul { flex-direction: column; gap: 0; justify-content: flex-start; }
  .hff-nav > ul > li > a { width: 100%; padding: 14px 0; border-bottom: 1px solid #eee; }

  /* Untermenü (Dropdown) auf Mobile ebenfalls sanft auf-/zuklappen */
  .hff-dropdown {
    display: block !important;
    position: static;
    box-shadow: none;
    background: #fafafa;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .3s ease, opacity .2s ease;
  }
  .hff-has-dropdown.hff-dd-open .hff-dropdown {
    max-height: 500px !important;
    opacity: 1 !important;
  }
}

/* ============================================================
   HWS FOOTER
   ============================================================ */
.hff-footer {
  background: var(--hff-footer-bg);
  color: var(--hff-footer-text);
  font-family: var(--hff-font);
  padding: 56px 32px 32px;
}
.hff-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr;
  gap: 32px;
}
.hff-footer h4 {
  text-transform: uppercase;
  font-size: 15px;
  letter-spacing: .5px;
  margin: 0 0 18px;
  color: var(--hff-footer-heading);
}
.hff-footer p { margin: 0 0 12px; font-size: 14px; line-height: 1.6; color: var(--hff-footer-text); }
.hff-footer a { color: var(--hff-footer-link); text-decoration: none; font-size: 14px; }
.hff-footer a:hover { color: var(--hff-footer-link-hover); }
.hff-footer-contact strong { color: var(--hff-footer-heading); }

.hff-social-icons {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.hff-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.hff-social-icon:hover {
  opacity: .85;
  transform: translateY(-2px);
}
.hff-social-icon svg {
  width: 17px;
  height: 17px;
  fill: #fff;
  display: block;
}

.hff-footer-col { display: flex; flex-direction: column; }
.hff-footer-col.hff-footer-links {
  text-transform: uppercase;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
}
.hff-footer-col.hff-footer-links a {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 2px solid transparent;
  width: fit-content;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 13px;
}
.hff-footer-col.hff-footer-links a.hff-current {
  border-bottom-color: var(--hff-footer-accent);
  color: var(--hff-footer-heading);
}

.hff-footer-cta { align-items: flex-start; }
.hff-btn-outline {
  border: 2px solid var(--hff-footer-text);
  color: var(--hff-footer-heading) !important;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
  padding: 18px 26px;
  display: inline-block;
  text-align: center;
  line-height: 1.4;
}
.hff-btn-outline:hover { border-color: var(--hff-footer-heading); }

.hff-footer-legal { text-align: left; align-items: flex-start; }
.hff-footer-legal .hff-footer-lang { font-weight: 700; margin-bottom: 12px; }
.hff-footer-legal .hff-footer-lang a { text-transform: uppercase; display: inline; }
.hff-footer-legal .hff-footer-lang span { display: inline; margin: 0 4px; }
.hff-footer-legal-links { display: flex; flex-direction: column; align-items: flex-start; }
.hff-footer-legal-links a { display: block; margin-bottom: 6px; }

@media (max-width: 1000px) {
  .hff-footer-inner { grid-template-columns: 1fr 1fr; }
  .hff-footer-legal { text-align: left; align-items: flex-start; }
}
@media (max-width: 600px) {
  .hff-footer-inner { grid-template-columns: 1fr; }
}
