/* Hele actions-blokka i header på desktop */
.tfs-header-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:16px;

  /* Tving samme “rad-høyde” og sentrering */
  height:64px; /* juster om headeren din er høyere/lavere */
  line-height:1;
}

/* Nullstill typiske theme-marginer */
.tfs-header-actions *{
  box-sizing:border-box;
}

/* Ikke gjør * til flex – kun de riktige wrapperne */
.tfs-actions-left,
.tfs-actions-right,
.tfs-account-wrap,
.tfs-account-main,
.tfs-actions-right form,
.tfs-actions-right label,
.tfs-actions-right .wp-block-search__inside-wrapper,
.tfs-actions-right .search-form,
.tfs-actions-right .search-field{
  display:flex;
  align-items:center;
}

/* Konto */
.tfs-account-wrap{
  position:relative;
  height:64px; /* matcher wrapper */
  margin:0;
  padding:0;
}

.tfs-account-main{
  gap:10px;
  height:42px; /* matcher input */
  padding:0;   /* unngå theme padding */
  margin:0;

  line-height:1; /* viktig: ikke arve meny-lineheight */
  text-decoration:none;
  cursor:pointer;
}

.tfs-account-avatar{
  display:flex;
  align-items:center;
  justify-content:center;
  height:42px;
}

.tfs-account-avatar img{
  width:28px;
  height:28px;
  border-radius:999px;
  display:block;
}

.tfs-account-name{
  display:flex;
  align-items:center;
  height:42px;

  white-space:nowrap;
  max-width:180px;
  overflow:hidden;
  text-overflow:ellipsis;

  line-height:1;
}

/* Dropdown */
.tfs-account-dropdown{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  min-width:200px;
  background:#111;
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  padding:8px;
  z-index:9999;

  display:block; /* IKKE flex */
}

.tfs-account-dropdown[hidden]{
  display:none !important;
}

.tfs-account-dropdown a{
  display:block !important;
  width:100%;
  padding:10px 10px;
  border-radius:10px;
  text-decoration:none;
  margin:0;
}

.tfs-account-dropdown a:hover{
  background:rgba(255,255,255,.08);
}

/* Search */
.tfs-actions-right{
  height:64px; /* matcher wrapper */
  margin:0;
  padding:0;
}

.tfs-actions-right form.search-form,
.tfs-actions-right form{
  height:42px;
  margin:0 !important;
  padding:0 !important;
}

/* Viktig: label må ikke ha default margin/padding som kan dytte ting ned */
.tfs-actions-right label{
  margin:0 !important;
  padding:0 !important;
}

/* Skjul submit-knappen (enter fungerer fortsatt) */
.tfs-actions-right input[type="submit"],
.tfs-actions-right button[type="submit"],
.tfs-actions-right .search-submit{
  display:none !important;
}

.tfs-actions-right input[type="search"]{
  width:260px;
  max-width:26vw;

  height:42px;
  padding:0 14px;
  margin:0;

  border-radius:999px;
  line-height:1;
}

/* Mellomstore skjermer: gi plass til nav-lenkene */
@media (max-width: 1070px) and (min-width: 771px){
  .tfs-actions-right input[type="search"]{
    width:200px !important;
    max-width:20vw !important;
  }

  .tfs-account-name{
    display:none !important;
  }

  .tfs-header-actions{
    gap:12px;
  }
}

/* Mobil: skjul i topplinja, men vis når flyttet inn i overlay */
@media (max-width: 770px){
  #tfs-header-actions{
    display:none;
  }

  /* Når den ligger inne i overlayen: full bredde + venstrejustert + nederst */
  .wp-block-navigation__responsive-container-content #tfs-header-actions{
    display:flex !important;
    width:100% !important;
    max-width:100% !important;
    margin-left:0 !important;
    margin-right:0 !important;

    flex-direction:column;
    align-items:stretch;
    gap:12px;

    margin-top:18px;
    padding-top:18px;
    border-top:1px solid rgba(255,255,255,.12);

    height:auto;
  }

  .wp-block-navigation__responsive-container-content #tfs-header-actions .tfs-actions-left,
  .wp-block-navigation__responsive-container-content #tfs-header-actions .tfs-actions-right{
    align-items:flex-start !important;
    height:auto;
  }

  .wp-block-navigation__responsive-container-content #tfs-header-actions .tfs-account-wrap{
    height:auto;
  }

  .wp-block-navigation__responsive-container-content #tfs-header-actions input[type="search"]{
    width:100% !important;
    max-width:100% !important;
  }

  .wp-block-navigation__responsive-container-content #tfs-header-actions .tfs-account-main{
    width:100%;
    justify-content:flex-start;
    height:auto;
    padding:10px 0;
  }
}