/* ROBBO Club site header — non-Elementor shell. Light/white, robbo-green CTA.
 * Desktop bar + Max Mega Menu restyle + mobile app-style bars (sticky top logo,
 * fixed bottom tab bar, off-canvas drawer). px-only. Scoped under .rc-header;
 * MMM restyle scoped under .rc-header__nav to beat the plugin theme CSS. */

.rc-header {
  --rc-green: #00BF63;
  --rc-green-d: #04a957;
  --rc-ink: #1d2127;
  --rc-ink-2: #5b626c;
  --rc-line: #ececf0;
  --rc-bar-h: 84px;
  --rc-bar-h-stuck: 64px;
  --rc-tabbar-h: 62px;
  font-family: 'ProximaNova', 'Proxima Nova', 'Noto Sans', sans-serif;
}
.rc-header *, .rc-drawer * { box-sizing: border-box; }

/* ---------- Top bar ---------- */
/* Fixed (not sticky) so it stays pinned even when the theme sets
 * overflow-x:hidden on html/body (which silently kills position:sticky). */
.rc-header__bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--rc-line);
  transition: box-shadow .2s, background .2s;
}
body.admin-bar .rc-header__bar { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar .rc-header__bar { top: 46px; } }
/* reserve the bar's height so page content starts below the fixed bar
 * (!important — themes/Elementor reset body{padding:0}) */
body { padding-top: 84px !important; }
.rc-header.is-stuck .rc-header__bar { box-shadow: 0 6px 24px rgba(15,23,42,.08); border-bottom-color: transparent; }
.rc-header__inner {
  max-width: 1366px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--rc-bar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: height .2s;
}
.rc-header.is-stuck .rc-header__inner { height: var(--rc-bar-h-stuck); }

.rc-header__logo { display: inline-flex; align-items: center; flex: none; text-decoration: none !important; }
.rc-header__logo img { display: block; height: 25px; width: auto; transition: height .2s; }
.rc-header.is-stuck .rc-header__logo img { height: 23px; }

.rc-header__nav { flex: 1 1 auto; min-width: 0; }
.rc-header__actions { flex: none; display: flex; align-items: center; gap: 4px; }

/* icon buttons */
.rc-header__icon {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 0; background: transparent; cursor: pointer;
  border-radius: 12px;
  color: var(--rc-ink) !important;
  text-decoration: none !important;
  transition: background .16s, color .16s;
}
.rc-header__icon:hover { background: #f3f4f6; color: var(--rc-green) !important; }

.rc-cart-count {
  position: absolute; top: 4px; right: 4px;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: none; align-items: center; justify-content: center;
  background: var(--rc-green); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px;
  border-radius: 9px;
}
.rc-cart-count.is-filled { display: inline-flex; }

.rc-header__cta {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 16px; margin-left: 2px;
  background: var(--rc-green) !important;
  color: #fff !important;
  font-size: 15px; font-weight: 700; letter-spacing: .2px;
  border-radius: 12px !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background .16s, transform .12s, box-shadow .16s;
  box-shadow: 0 6px 16px rgba(0,191,99,.22);
}
.rc-header__cta:hover { background: var(--rc-green-d) !important; transform: translateY(-1px); }

/* ---------- Desktop search ---------- */
.rc-hsearch { position: relative; }
.rc-hsearch__panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 360px; max-width: 78vw;
  background: #fff; border: 1px solid var(--rc-line);
  border-radius: 14px; box-shadow: 0 16px 40px rgba(15,23,42,.14);
  padding: 12px;
  z-index: 1001;
}
.rc-hsearch__form { display: flex; align-items: center; gap: 10px; padding: 0 6px; color: var(--rc-ink-2); }
.rc-hsearch__form svg { flex: none; }
.rc-hsearch__input {
  flex: 1 1 auto; width: 100%; height: 44px; border: 0; outline: none;
  font-size: 15px; font-family: inherit; color: var(--rc-ink); background: transparent;
}
.rc-hsearch__results { margin-top: 8px; max-height: 60vh; overflow: auto; }
.rc-hsearch__results a {
  display: block; padding: 10px 12px; border-radius: 10px;
  color: var(--rc-ink) !important; text-decoration: none !important;
  font-size: 14px; line-height: 1.3;
}
.rc-hsearch__results a:hover { background: #f3f4f6; color: var(--rc-green) !important; }
.rc-hsearch__results .rc-hsearch__type { display: block; font-size: 11px; color: var(--rc-ink-2); text-transform: uppercase; letter-spacing: .6px; margin-top: 2px; }
.rc-hsearch__results .rc-hsearch__empty { padding: 12px; color: var(--rc-ink-2); font-size: 14px; }

/* ---------- Max Mega Menu restyle (desktop) ---------- */
.rc-header__nav #mega-menu-main {
  background: transparent !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
}
.rc-header__nav #mega-menu-main > li.mega-menu-item { flex: 0 0 auto !important; }
/* "Terminkalender" is the last nav item AND the green CTA — hide the duplicate. */
.rc-header__nav #mega-menu-main > li.mega-menu-item:last-child { display: none !important; }
.rc-header__nav #mega-menu-main > li.mega-menu-item > a.mega-menu-link {
  font-family: 'ProximaNova', 'Proxima Nova', sans-serif !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--rc-ink) !important;
  height: auto !important;
  line-height: 1.2 !important;
  padding: 6px 9px !important;
  white-space: nowrap !important;
  transition: color .16s;
}
.rc-header__nav #mega-menu-main > li.mega-menu-item > a.mega-menu-link:hover,
.rc-header__nav #mega-menu-main > li.mega-menu-item.mega-toggle-on > a.mega-menu-link,
.rc-header__nav #mega-menu-main > li.mega-menu-item.mega-menu-megamenu:hover > a.mega-menu-link {
  color: var(--rc-green) !important;
  background: transparent !important;
}
.rc-header__nav #mega-menu-main > li.mega-menu-item > a.mega-menu-link > span.mega-indicator:after { color: inherit !important; }
/* mega panels */
.rc-header__nav #mega-menu-main li.mega-menu-megamenu > ul.mega-sub-menu {
  background: #fff !important;
  border: 1px solid var(--rc-line) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 60px rgba(15,23,42,.16) !important;
  padding: 22px !important;
  margin-top: 8px !important;
}
.rc-header__nav #mega-menu-main ul.mega-sub-menu a.mega-menu-link { color: var(--rc-ink-2) !important; font-weight: 500 !important; font-size: 15px !important; }
.rc-header__nav #mega-menu-main ul.mega-sub-menu a.mega-menu-link:hover { color: var(--rc-green) !important; background: transparent !important; }
.rc-header__nav #mega-menu-main ul.mega-sub-menu > li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item-has-children > a.mega-menu-link {
  color: var(--rc-ink) !important; font-weight: 700 !important;
}
/* hide MMM's own mobile toggle — we provide our own */
.rc-header__nav .mega-menu-toggle { display: none !important; }

/* ---------- Mobile tab bar + drawer (hidden on desktop) ---------- */
.rc-tabbar { display: none; }
.rc-drawer { display: none; }

/* ============ MOBILE ( < 1200px ) ============ */
@media (max-width: 1199px) {
  .rc-header__nav,
  .rc-header__actions { display: none !important; }

  .rc-header__inner { height: 58px; padding: 0 18px; justify-content: center; }
  .rc-header.is-stuck .rc-header__inner { height: 54px; }
  .rc-header__logo img { height: 28px; }
  .rc-header.is-stuck .rc-header__logo img { height: 26px; }
  .rc-header__bar { box-shadow: 0 2px 10px rgba(15,23,42,.06); }
  body { padding-top: 58px !important; }

  /* bottom tab bar — app style */
  .rc-tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    height: calc(68px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid var(--rc-line);
    box-shadow: 0 -6px 20px rgba(15,23,42,.08);
  }
  /* font props !important so the <button> "Menü" can't inherit the
   * Elementor-kit button rules (uppercase / larger size). */
  .rc-tabbar__item {
    flex: 1 1 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    border: 0; background: transparent; cursor: pointer;
    color: var(--rc-ink-2) !important; text-decoration: none !important;
    font-family: 'ProximaNova', 'Proxima Nova', sans-serif !important;
    font-size: 12.5px !important; font-weight: 600 !important;
    text-transform: none !important; letter-spacing: 0 !important; line-height: 1.1 !important;
    position: relative;
  }
  .rc-tabbar__item svg { width: 26px; height: 26px; }
  .rc-tabbar__item:active { color: var(--rc-green) !important; }
  .rc-tabbar__wa { color: var(--rc-green) !important; }
  .rc-tabbar__ico { position: relative; display: inline-flex; }
  .rc-tabbar__cart .rc-cart-count { top: -5px; right: -8px; }

  /* off-canvas drawer */
  .rc-drawer { display: block; position: fixed; inset: 0; z-index: 1100; overflow: hidden; }
  .rc-drawer[hidden] { display: none; }
  .rc-drawer__backdrop {
    position: absolute; inset: 0; background: rgba(12,15,20,.5);
    opacity: 0; transition: opacity .25s;
  }
  .rc-drawer.is-open .rc-drawer__backdrop { opacity: 1; }
  .rc-drawer__panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(86vw, 380px);
    background: #fff;
    box-shadow: -12px 0 40px rgba(15,23,42,.2);
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column;
    padding: 14px 18px calc(20px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto; overflow-x: hidden;
  }
  .rc-drawer.is-open .rc-drawer__panel { transform: translateX(0); }
  .rc-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 14px; }
  .rc-drawer__head img { height: 34px; width: auto; display: block; }
  .rc-drawer__close {
    width: 42px; height: 42px; border: 0; background: #f3f4f6; border-radius: 12px;
    color: var(--rc-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  }

  .rc-drawer__search { position: relative; display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; padding: 0 14px; height: 50px; background: #f3f4f6; border-radius: 14px; color: var(--rc-ink-2); }
  .rc-drawer__search .rc-hsearch__input { height: 50px; background: transparent; }
  .rc-drawer__search .rc-hsearch__results {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px);
    background: #fff; border: 1px solid var(--rc-line); border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15,23,42,.16); padding: 8px; z-index: 2;
    max-height: 50vh; overflow: auto;
  }

  .rc-drawer__nav { flex: 1 1 auto; min-width: 0; }
  .rc-drawer__list { list-style: none; margin: 0; padding: 0; min-width: 0; max-width: 100%; }
  .rc-drawer__sub { padding-left: 12px; min-width: 0; }
  .rc-drawer__sub[hidden] { display: none; }
  .rc-drawer__row { display: flex; align-items: center; border-bottom: 1px solid var(--rc-line); min-width: 0; }
  .rc-drawer__link {
    flex: 1 1 auto; min-width: 0; padding: 14px 4px; font-size: 16px; font-weight: 600;
    color: var(--rc-ink) !important; text-decoration: none !important;
    overflow-wrap: anywhere;
  }
  .rc-drawer__sub .rc-drawer__link { font-size: 15px; font-weight: 500; color: var(--rc-ink-2) !important; padding: 11px 4px; }
  .rc-drawer__link:active { color: var(--rc-green) !important; }
  .rc-drawer__toggle {
    flex: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
    color: var(--rc-ink-2); display: inline-flex; align-items: center; justify-content: center;
    transition: transform .2s;
  }
  .rc-drawer__toggle[aria-expanded="true"] { transform: rotate(180deg); color: var(--rc-green); }

  .rc-drawer__cta { margin-top: 18px; height: 52px; width: 100%; }

  body.rc-drawer-open { overflow: hidden; }
  /* clear the fixed tab bar so page/footer content isn't covered */
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important; }
}
