/* LaughlyFun stable responsive header — v1.0.8 */
:root {
  --lf-header-height: 82px;
  --lf-adminbar-height: 0px;
}

html,
body {
  overflow-x: clip;
}

body.admin-bar {
  --lf-adminbar-height: 32px;
}

body {
  padding-top: calc(var(--lf-header-height) + var(--lf-adminbar-height));
}

.site-header {
  top: var(--lf-adminbar-height);
  height: auto;
  min-height: var(--lf-header-height);
  background: linear-gradient(90deg, #081326 0%, #0d1d3a 55%, #13284e 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 7px 22px rgba(5, 13, 29, .22);
}

.site-header.lf-scrolled {
  background: linear-gradient(90deg, rgba(8, 19, 38, .985) 0%, rgba(13, 29, 58, .985) 55%, rgba(19, 40, 78, .985) 100%);
  box-shadow: 0 9px 28px rgba(5, 13, 29, .28);
}

.lf-header-inner {
  min-height: var(--lf-header-height);
  height: auto;
  padding: 11px 0;
}

.site-branding,
.lf-header-actions {
  position: relative;
  z-index: 3;
}

.site-logo img {
  max-height: 45px;
  width: auto;
}

.lf-search-toggle,
.lf-menu-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .18);
}

.lf-search-toggle:hover,
.lf-search-toggle.is-open,
.lf-menu-toggle:hover,
.lf-menu-toggle.is-open {
  background: rgba(255, 255, 255, .15);
  border-color: rgba(255, 255, 255, .34);
}

/* Desktop and laptop: logo | wrapping categories | isolated search */
@media (min-width: 992px) {
  .lf-container {
    width: min(100% - 32px, 1380px);
  }

  .lf-header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 20px;
    row-gap: 0;
    align-items: center;
  }

  .site-branding {
    grid-column: 1;
    align-self: center;
  }

  .site-logo img {
    max-width: min(250px, 22vw);
  }

  .primary-nav {
    grid-column: 2;
    display: flex !important;
    position: static !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    min-width: 0;
    max-width: 100%;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    justify-content: flex-start;
    align-items: center;
  }

  .primary-menu {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 6px 3px;
    margin: 0;
    padding: 0;
  }

  .primary-menu > li {
    width: auto !important;
    flex: 0 0 auto;
  }

  .primary-menu > li > a {
    width: auto !important;
    height: 36px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    white-space: nowrap;
    color: rgba(255, 255, 255, .84);
    font-size: 12.5px;
    line-height: 1;
  }

  .primary-menu > li:hover > a,
  .primary-menu > .current-menu-item > a,
  .primary-menu > .current_page_item > a,
  .primary-menu > .current-menu-ancestor > a {
    background: rgba(255, 255, 255, .11);
    color: #fff;
  }

  .primary-menu .sub-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    display: none !important;
    min-width: 220px;
    width: auto !important;
    height: auto !important;
    padding: 16px 8px 8px !important;
    margin: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  .primary-menu li:hover > .sub-menu,
  .primary-menu li:focus-within > .sub-menu {
    display: block !important;
  }

  .primary-menu .sub-menu::before {
    display: block;
  }

  .lf-header-actions {
    grid-column: 3;
    align-self: center;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .lf-menu-toggle {
    display: none !important;
  }

  .lf-search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    width: 330px;
  }

  body.lf-menu-open::before,
  body.lf-search-open::before {
    content: none !important;
  }
}

/* Smaller laptops: deliberately allow a clean second row */
@media (min-width: 992px) and (max-width: 1240px) {
  :root {
    --lf-header-height: 106px;
  }

  .lf-container {
    width: min(100% - 24px, 1320px);
  }

  .lf-header-inner {
    column-gap: 14px;
  }

  .site-logo img {
    max-height: 41px;
    max-width: min(225px, 22vw);
  }

  .primary-menu {
    gap: 5px 2px;
  }

  .primary-menu > li > a {
    height: 34px;
    min-height: 34px;
    padding: 0 8px;
    font-size: 11.75px;
  }
}

/* Mobile/tablet: compact header with toggle drawer */
@media (max-width: 991px) {
  :root {
    --lf-header-height: 72px;
  }

  body.admin-bar {
    --lf-adminbar-height: 46px;
  }

  .lf-container {
    width: min(100% - 22px, var(--lf-container));
  }

  .lf-header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--lf-header-height);
    padding: 9px 0;
  }

  .site-branding {
    min-width: 0;
  }

  .site-logo img {
    max-height: 37px;
    max-width: min(205px, 56vw);
  }

  .lf-header-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    flex-shrink: 0;
  }

  .lf-search-toggle,
  .lf-menu-toggle {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  .lf-menu-toggle {
    display: inline-flex !important;
  }

  .primary-nav {
    display: none !important;
    position: fixed !important;
    top: calc(var(--lf-header-height) + var(--lf-adminbar-height) + 8px) !important;
    right: 10px !important;
    left: 10px !important;
    width: auto !important;
    height: auto !important;
    max-height: calc(100vh - var(--lf-header-height) - var(--lf-adminbar-height) - 18px) !important;
    overflow-y: auto !important;
    padding: 10px !important;
    background: #fff !important;
    border: 1px solid var(--lf-border) !important;
    border-radius: 18px !important;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .22) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    z-index: 1001;
  }

  .primary-nav.is-open {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
  }

  .primary-menu {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    width: 100%;
    gap: 3px;
  }

  .primary-menu > li,
  .primary-menu > li > a {
    width: 100% !important;
  }

  .primary-menu > li > a {
    min-height: 44px;
    height: auto;
    padding: 11px 13px;
    justify-content: space-between;
    border-radius: 11px;
    white-space: normal;
    color: var(--lf-text);
    font-size: 14px;
    line-height: 1.3;
  }

  .primary-menu > li:hover > a,
  .primary-menu > .current-menu-item > a,
  .primary-menu > .current_page_item > a,
  .primary-menu > .current-menu-ancestor > a {
    background: #eff6ff;
    color: var(--lf-primary-dark);
  }

  .primary-menu .sub-menu {
    position: static !important;
    display: block !important;
    min-width: 100%;
    width: 100% !important;
    padding: 5px !important;
    margin: 3px 0 0 !important;
    background: #f8fafc !important;
    border: 1px solid #eef2f7 !important;
    border-radius: 11px !important;
    box-shadow: none !important;
  }

  .primary-menu .sub-menu::before {
    display: none !important;
  }

  .primary-menu .sub-menu a {
    white-space: normal;
  }

  .lf-search-dropdown {
    position: fixed;
    top: calc(var(--lf-header-height) + var(--lf-adminbar-height) + 8px);
    left: 10px;
    right: 10px;
    width: auto;
    z-index: 1002;
  }

  body.lf-menu-open::before,
  body.lf-search-open::before {
    content: "";
    position: fixed;
    inset: calc(var(--lf-header-height) + var(--lf-adminbar-height)) 0 0;
    background: rgba(2, 6, 23, .40);
    z-index: 999;
  }
}

@media (max-width: 782px) {
  body.admin-bar {
    --lf-adminbar-height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-nav,
  .site-header {
    transition: none !important;
  }
}
