/* GFB Header Plugin — header.css */

/* ── Reset & base ─────────────────────────────────────────── */
.gfb-header *,
.gfb-header *::before,
.gfb-header *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Header shell ─────────────────────────────────────────── */
.gfb-header {
  background: var(--gfb-bg, #ffffff);
  color: var(--gfb-text, #1a1a2e);
  border-bottom: 2px solid var(--gfb-accent, #2ecc71);
  width: 100%;
  z-index: 9999;
  transition: box-shadow 0.2s ease;
}

.gfb-header.gfb-sticky {
  position: sticky;
  top: 0;
}

.gfb-header.gfb-scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

/* ── Inner wrapper ────────────────────────────────────────── */
.gfb-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 64px;
}

/* ── Logo ─────────────────────────────────────────────────── */
.gfb-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.gfb-logo-img {
  height: 40px;
  width: auto;
}

.gfb-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--gfb-accent, #2ecc71);
  color: #fff;
  border-radius: 50%;
  font-size: 1rem;
  flex-shrink: 0;
}

.gfb-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.gfb-logo-line1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gfb-text, #1a1a2e);
}

.gfb-logo-line2 {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gfb-accent, #2ecc71);
  text-transform: uppercase;
}

/* ── Nav ──────────────────────────────────────────────────── */
.gfb-nav {
  margin-left: auto;
}

.gfb-nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.gfb-nav-link {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gfb-text, #1a1a2e);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.gfb-nav-link:hover,
.gfb-nav-link.gfb-active {
  color: var(--gfb-accent, #2ecc71);
  background: rgba(46, 204, 113, 0.08);
}

/* ── Dropdown submenus ────────────────────────────────────── */

/* Parent item needs relative positioning */
.gfb-nav-list > li {
  position: relative;
}

/* The submenu itself — hidden by default */
.gfb-nav-list > li > ul.sub-menu {
  display: block;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 100%;          /* flush — no gap so cursor never loses the <li> */
  left: 0;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-top: 2px solid var(--gfb-accent, #2ecc71);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  list-style: none;
  padding: 0.35rem 0;
  z-index: 10000;
  /* tiny fade only — no translateY so there's no vertical travel gap */
  transition: opacity 0.15s ease, visibility 0.15s;
}

/* Invisible bridge: fills any pixel gap between link bottom and submenu top */
.gfb-nav-list > li.menu-item-has-children::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 8px;       /* covers any sub-pixel rendering gap */
  background: transparent;
}

/* Show on hover of the parent <li> */
.gfb-nav-list > li:hover > ul.sub-menu,
.gfb-nav-list > li:focus-within > ul.sub-menu {
  visibility: visible;
  opacity: 1;
  pointer-events: all;
}

/* Submenu links */
.gfb-nav-list > li > ul.sub-menu a {
  display: block;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: #1a1a2e;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.gfb-nav-list > li > ul.sub-menu a:hover {
  background: rgba(46, 204, 113, 0.08);
  color: var(--gfb-accent, #2ecc71);
}

/* Chevron indicator on parent items that have children */
.gfb-nav-list > li.menu-item-has-children > .gfb-nav-link::after {
  content: '';
  display: inline-block;
  margin-left: 5px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.55;
  transition: transform 0.18s ease;
}

.gfb-nav-list > li.menu-item-has-children:hover > .gfb-nav-link::after {
  transform: rotate(180deg);
}

/* ── Actions (search) ─────────────────────────────────────── */
.gfb-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Search button ────────────────────────────────────────── */
.gfb-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: var(--gfb-accent, #2ecc71);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity 0.15s;
}

.gfb-search-btn:hover {
  opacity: 0.85;
}

/* ── Search overlay ───────────────────────────────────────── */
.gfb-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.gfb-search-overlay.gfb-open {
  opacity: 1;
  pointer-events: all;
}

.gfb-search-form {
  display: flex;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  width: min(560px, 92vw);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.gfb-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  color: #1a1a2e;
  background: transparent;
}

.gfb-search-submit {
  border: none;
  background: var(--gfb-accent, #2ecc71);
  color: #fff;
  padding: 0 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: opacity 0.15s;
}

.gfb-search-submit:hover {
  opacity: 0.85;
}

.gfb-search-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

/* ── Hamburger ────────────────────────────────────────────── */
.gfb-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

.gfb-hamburger span {
  display: block;
  height: 2px;
  background: var(--gfb-text, #1a1a2e);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Animate to X */
.gfb-hamburger.gfb-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.gfb-hamburger.gfb-open span:nth-child(2) { opacity: 0; }
.gfb-hamburger.gfb-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .gfb-hamburger {
    display: flex;
  }

  .gfb-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--gfb-bg, #ffffff);
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    border-bottom: 2px solid var(--gfb-accent, #2ecc71);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
  }

  .gfb-header {
    position: relative; /* needed so nav sits under it */
  }

  .gfb-header.gfb-sticky {
    position: sticky;
  }

  .gfb-nav.gfb-open {
    max-height: 400px;
  }

  .gfb-nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0;
  }

  .gfb-nav-link {
    padding: 0.75rem 1.25rem;
    border-radius: 0;
  }

  /* Mobile submenus — accordion style */
  .gfb-nav-list > li > ul.sub-menu {
    position: static;
    visibility: visible;
    opacity: 1;
    pointer-events: all;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--gfb-accent, #2ecc71);
    border-radius: 0;
    background: rgba(0, 0, 0, 0.03);
    padding: 0;
    min-width: 0;
    display: none;
  }

  .gfb-nav-list > li.gfb-sub-open > ul.sub-menu {
    display: block;
  }

  .gfb-nav-list > li > ul.sub-menu a {
    padding: 0.6rem 1.25rem 0.6rem 2rem;
    font-size: 0.875rem;
  }

  /* Tap to toggle chevron on mobile */
  .gfb-nav-list > li.menu-item-has-children > .gfb-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .gfb-actions {
    margin-left: 0;
  }

  .gfb-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 0.85rem 1.25rem;
  }
}



/* ── Back to top ──────────────────────────────────────────── */
#gfbBackToTop {
  position: fixed;
  bottom: 2rem;
  right: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gfb-accent, #2ecc71);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9998;
}

#gfbBackToTop.gfb-btt-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

#gfbBackToTop:hover {
  opacity: 0.85;
}
