/* Ported from Header.styled.ts, HeaderActions.tsx, NavList.styled.ts, Drawer.tsx, Lightheme.ts */

.site-header {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  min-height: calc(33.5px + 70px);
  overflow-x: clip;
}

.site-header .umb-block-list {
  display: block;
}

@media (max-width: 599.95px) {
  /* Live mobile toolbar paints at 35px height but keeps min-height 56px */
  .site-header {
    min-height: calc(33.5px + 56px);
  }
}

.ComponentWrapper[data-name="Header"] {
  padding: 0;
  max-width: 100%;
  overflow-x: clip;
}

.MuiToolbar-root.StyledToolBar {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  height: 70px;
  min-height: 56px;
  padding: 15px 40px;
  z-index: 2;
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  will-change: transform, backdrop-filter, box-shadow;
  transition:
    top 0.35s cubic-bezier(0.33, 1, 0.68, 1),
    backdrop-filter 0.35s cubic-bezier(0.33, 1, 0.68, 1),
    -webkit-backdrop-filter 0.35s cubic-bezier(0.33, 1, 0.68, 1),
    box-shadow 0.35s cubic-bezier(0.33, 1, 0.68, 1);
}

.MuiToolbar-root.StyledToolBar--overlay {
  background-color: rgba(0, 0, 0, 0.25);
}

@media (max-width: 599.95px) {
  .MuiToolbar-root.StyledToolBar {
    height: 35px;
    /* Do not override min-height:56px — that clearance stops icons colliding with the logo */
    padding: 0 16px;
    overflow: hidden;
  }
}

.StyledToolbarContentWrapperStack {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.header-actions-root {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  position: relative;
}

.header-actions-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  gap: 18px;
}

@media (max-width: 599.95px) {
  .header-actions-left {
    gap: 12px;
    /* Reserve center band for the absolute logo (160px) so icons never collide */
    max-width: calc(50% - 84px);
  }
}

@media (min-width: 1536px) {
  .header-actions-left {
    gap: 33px;
  }
}

.header-actions-right {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  height: 40px;
  gap: 18px;
}

@media (max-width: 599.95px) {
  .header-actions-right {
    height: auto;
    gap: 12px;
    max-width: calc(50% - 84px);
  }
}

@media (min-width: 900px) {
  .header-actions-right {
    gap: 12px;
  }
}

@media (min-width: 1536px) {
  .header-actions-right {
    gap: 25px;
  }
}

.header-icon-btn {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: transparent;
  color: #000000;
  cursor: pointer;
  line-height: 0;
}

.header--overlay .header-icon-btn,
.header--overlay .header-action-item,
.header--overlay .navListWrapper .MuiTypography-paragraphSmall,
.header--overlay .header-search .MuiInputBase-input,
.header--overlay .header-search .MuiInputBase-input::placeholder {
  color: #ffffff;
}

.header--overlay .header-search {
  border-bottom-color: #ffffff;
}

.header-icon-btn svg {
  display: block;
}

.header-icon-btn--menu svg {
  width: 23px;
  height: 14px;
}

.header-icon-btn--responsive svg {
  width: 1em;
  height: 1em;
  font-size: 19px;
}

@media (min-width: 600px) {
  .header-icon-btn--responsive svg {
    font-size: 20px;
  }
}

.header-logo-mobile {
  pointer-events: auto;
  display: block;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

@media (min-width: 600px) {
  .header-logo-mobile {
    display: none;
  }
}

.header-logo-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  pointer-events: none;
}

@media (min-width: 600px) {
  .header-logo-center {
    display: flex;
  }
}

.header-logo-center__link,
.header-logo-mobile__link {
  pointer-events: auto;
  display: block;
  line-height: 0;
  text-decoration: none;
}

.header-logo-center__img,
.header-logo-mobile__img {
  display: block;
  width: 160px;
  height: 17px;
  object-fit: contain;
}

/* Live skeidar.no keeps 160×17 on mobile; side columns are capped so icons stay clear */

.navListWrapper {
  width: 100%;
  display: none;
  justify-content: flex-end;
}

@media (min-width: 900px) {
  .navListWrapper {
    display: flex;
  }
}

.StylesNavListWrapperStack {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 13px;
  width: 100%;
}

@media (min-width: 1536px) {
  .StylesNavListWrapperStack {
    gap: 20px;
  }
}

.navListWrapper .MuiTypography-paragraphSmall {
  margin: 0;
  font-size: 1rem;
  line-height: 1;
  font-weight: 400;
  color: #000000;
}

.navListWrapper .MuiTypography-paragraphSmall a,
.navListWrapper .header-nav-link {
  color: inherit;
  text-decoration: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  display: inline-block;
  position: relative;
}

.navListWrapper .MuiTypography-paragraphSmall a:hover,
.navListWrapper .header-nav-link:hover {
  opacity: 0.5;
}

.navListWrapper .header-nav-link.is-active,
.navListWrapper .header-nav-item--has-children .header-nav-link.is-active {
  opacity: 1;
}

.navListWrapper .header-nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: currentColor;
}

/* Live keeps the hamburger visible on every breakpoint, left of the nav links. */
.header-icon-btn--menu {
  display: inline-flex;
}

@media (max-width: 599.95px) {
  .navListWrapper .MuiTypography-paragraphSmall {
    font-size: 0.75rem;
  }
}

.StyledHeaderSearchInputWrapperBox--mobile {
  margin-right: 0;
  /* width:100% made the search column overflow into the absolute centered logo */
  width: auto;
  max-width: none;
  flex: 0 0 auto;
  display: block;
}

@media (min-width: 900px) {
  .StyledHeaderSearchInputWrapperBox--mobile {
    display: none;
  }
}

.StyledHeaderSearchInputWrapperBox--desktop {
  margin-right: 18px;
  max-width: 200px;
  width: 100%;
  display: none;
}

@media (min-width: 900px) {
  .StyledHeaderSearchInputWrapperBox--desktop {
    display: block;
  }
}

@media (min-width: 1536px) {
  .StyledHeaderSearchInputWrapperBox--desktop {
    margin-right: 20px;
  }
}

.header-search {
  position: relative;
  width: 100%;
  max-width: 200px;
}

.header-search__mobile-trigger {
  display: flex;
  justify-content: flex-end;
  padding: 0;
}

@media (min-width: 900px) {
  .header-search__mobile-trigger {
    display: none;
  }
}

.header-search__desktop {
  display: none;
}

@media (min-width: 900px) {
  .header-search__desktop {
    display: block;
  }
}

.header-search .MuiInputBase-root.previewSearch {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 200px;
  height: 100%;
  background: transparent;
  border-radius: 0;
  font-size: 16px;
  line-height: 23px;
  padding: 7px;
  letter-spacing: 1px;
  border-bottom: 1px solid #000000;
}

.header-search .MuiInputBase-input {
  flex: 1;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 16px;
  line-height: 23px;
  letter-spacing: 1px;
  color: #000000;
  outline: none;
}

.header-search .MuiInputBase-input::placeholder {
  color: #000000;
  opacity: 1;
}

.header-search__icon-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  line-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
}

.header-search__icon-btn svg {
  width: 1em;
  height: 1em;
  font-size: 18px;
}

@media (min-width: 900px) {
  .header-search__icon-btn svg {
    font-size: 20px;
  }
}

.header-action-item {
  display: none;
  height: 100%;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  color: #000000;
  border: 0;
  background: transparent;
  padding: 0;
}

.header-action-item--visible {
  display: flex;
}

@media (min-width: 900px) {
  .header-action-item--md {
    display: flex;
    justify-content: center;
  }
}

.header-action-item .MuiTypography-caption {
  display: none;
}

/* Drawer — ported from Drawer.tsx */
.MuiDrawer-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
  visibility: hidden;
  pointer-events: none;
}

.MuiDrawer-root.is-open {
  visibility: visible;
  pointer-events: auto;
}

.MuiBackdrop-root {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.MuiDrawer-root.is-open .MuiBackdrop-root {
  opacity: 1;
}

.MuiDrawer-paper {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 88%;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  background-color: #ffffff !important;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
}

.MuiDrawer-root.is-open .MuiDrawer-paper {
  transform: translateX(0);
}

@media (min-width: 900px) {
  .MuiDrawer-paper {
    width: auto;
    min-width: 488px;
  }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  min-height: 36px;
  position: relative;
}

.drawer-header__logo img {
  display: block;
  width: 159px;
  height: 16px;
  object-fit: contain;
}

@media (max-width: 899.95px) {
  .drawer-header {
    padding: 0 24px;
  }

  .drawer-header__logo img {
    width: 108px;
    height: 14px;
  }
}

.drawer-close-btn {
  position: absolute;
  right: 0;
  top: 0;
  padding: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  color: #000000;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 12px;
}

@media (max-width: 899.95px) {
  .drawer-content {
    padding: 0;
  }
}

.drawer-panels {
  position: relative;
  width: 100%;
  min-height: 100%;
}

.drawer-panel {
  display: none;
  width: 100%;
}

.drawer-panel.is-active {
  display: block;
}

.drawer-panel__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  min-height: 48px;
}

.drawer-panel__title {
  font-size: 16px;
  font-weight: 500;
  color: #000000;
}

.drawer-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 8px 0;
  margin: 0;
  font: inherit;
  font-size: 14px;
  color: #000000;
  cursor: pointer;
}

.drawer-menu-list {
  list-style: none;
  margin: 0;
  padding: 0 24px;
}

.drawer-menu-list a,
.drawer-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 0;
  color: #000000;
  text-decoration: none;
  font-size: 16px;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-sizing: border-box;
}

.drawer-menu-list a:hover,
.drawer-menu-link:hover {
  font-weight: 500;
}

.drawer-menu-link--branch .drawer-chevron {
  flex: 0 0 auto;
  color: #000000;
}

/* Desktop mega-menu — live skeidar.no columnar drill-down */
.header-mega {
  position: fixed;
  inset: 0;
  z-index: 1250;
  visibility: hidden;
  pointer-events: none;
}

.header-mega.is-open {
  visibility: visible;
  pointer-events: auto;
}

.header-mega__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.header-mega__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(78vw, 1000px);
  max-width: 100%;
  background: #ffffff;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  padding: 24px 40px 48px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  transform: translateX(-16px);
  opacity: 0;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.header-mega.is-open .header-mega__panel {
  opacity: 1;
  transform: translateX(0);
}

.header-mega__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.header-mega__logo img {
  display: block;
  width: 160px;
  height: 17px;
  object-fit: contain;
}

.header-mega__close {
  border: 0;
  background: transparent;
  padding: 8px;
  cursor: pointer;
  line-height: 0;
  color: #000000;
}

.header-mega__primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.header-mega__primary-link {
  border: 0;
  background: transparent;
  padding: 0 0 4px;
  margin: 0;
  font: inherit;
  font-size: 15px;
  color: #000000;
  text-decoration: none;
  cursor: pointer;
  position: relative;
}

.header-mega__primary-link:hover {
  opacity: 0.6;
}

.header-mega__primary-link.is-active {
  font-weight: 500;
}

.header-mega__primary-link.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: currentColor;
}

.header-mega__columns {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  flex: 1;
}

.header-mega__column {
  flex: 0 0 auto;
  min-width: 180px;
  max-width: 240px;
}

.header-mega__heading {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.55);
  margin: 0 0 16px;
}

.header-mega__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-mega__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: #000000;
  text-decoration: none;
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.header-mega__link:hover {
  opacity: 0.55;
}

.header-mega__link--branch svg {
  flex: 0 0 auto;
  opacity: 0.7;
}

@media (max-width: 899.95px) {
  .header-mega {
    display: none;
  }
}

/* Search modal — ported from ExpandableSearchModal.tsx + animate.ts */
.search-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1300;
  visibility: hidden;
  pointer-events: none;
}

.search-modal-root.is-open {
  visibility: visible;
  pointer-events: auto;
}

.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
}

.search-modal-paper {
  position: fixed;
  top: calc(33.5px + 70px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  opacity: 0;
  width: min(100%, 960px);
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition:
    opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 24px;
}

.search-modal-root.is-open .search-modal-paper {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

@media (max-width: 899.95px) {
  .search-modal-paper {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(-300px);
    opacity: 0;
    padding: 16px 20px;
  }

  .search-modal-root.is-open .search-modal-paper {
    transform: translateY(0);
    opacity: 1;
  }
}

.search-modal-paper .previewSearch {
  border-bottom: 1px solid #000000;
}

.search-modal-paper .MuiInputBase-input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 0;
  font: inherit;
  font-size: 1rem;
  outline: none;
}

.search-modal-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  margin-bottom: 16px;
  padding: 0;
  font: inherit;
  color: #000000;
}
